aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2010-10-13 11:05:39 -0300
committerSilvio <silvio@devlet.com.br>2010-10-13 11:05:39 -0300
commit7592053b042630a199be63ed23d7a4bf4c16a7e0 (patch)
tree887df74a0cb6f356eb6abeb976add24f4b0758c8
parentdd0ce4f6c3dd51790567f912e529ef0d66cf1144 (diff)
downloadmass_image_import-7592053b042630a199be63ed23d7a4bf4c16a7e0.tar.gz
mass_image_import-7592053b042630a199be63ed23d7a4bf4c16a7e0.tar.bz2
Coding style
-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,
);
}