aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mass_image_import.module24
1 files changed, 13 insertions, 11 deletions
diff --git a/mass_image_import.module b/mass_image_import.module
index 858fe0b..dfc2f48 100644
--- a/mass_image_import.module
+++ b/mass_image_import.module
@@ -83,7 +83,7 @@ function mass_image_import_types() {
*/
function mass_image_import_form_submit($form, &$form_state) {
// Save form input.
- $type = $form_state['values']['node_type'];
+ $type = $form_state['values']['node_type'];
variable_set('mass_image_import_node_type', $type);
// Setup batch configuration
@@ -148,16 +148,16 @@ function mass_image_import_get_files() {
return;
}
- // Get file names
+ // Get file names.
$files = file_scan_directory($dirpath, '.*');
if (!$files) {
return;
}
- // Sort
+ // Sort.
ksort($files);
- // Convert to indexed array
+ // Convert to indexed array.
foreach ($files as $file) {
$images[] = $file;
}
@@ -175,10 +175,12 @@ function mass_image_import_file($file, $type = 'image') {
$dirpath = variable_get('image_import_path', '');
$origname = $file->basename;
- // Assembly import data
+ // Assembly import data.
$file_metadata_modules = module_implements('file_metadata');
+ // Validate.
$problems = image_import_validate_file($file);
+
// Allow other modules to supply metadata about the images being imported.
// hook_file_metadata() may populate the $file properties 'title' and
// 'description'.
@@ -187,14 +189,14 @@ function mass_image_import_file($file, $type = 'image') {
$function($file);
}
- // Build form
+ // Build form.
if ($filepath = file_check_location($dirpath .'/'. $origname, $dirpath)) {
$args = array(
- 'node_type' => 'image',
- 'title' => isset($file->title) ? $file->title : basename($file->name),
- 'body' => isset($file->body) ? $file->body : basename($file->name),
- 'filepath' => $filepath,
- 'origname' => $origname,
+ 'node_type' => 'image',
+ 'title' => isset($file->title) ? $file->title : basename($file->name),
+ 'body' => isset($file->body) ? $file->body : basename($file->name),
+ 'filepath' => $filepath,
+ 'origname' => $origname,
);
}