From 79c9a8e8b7df654079fbe093eaf184a8d2963a25 Mon Sep 17 00:00:00 2001 From: Silvio Date: Wed, 13 Oct 2010 11:06:44 -0300 Subject: Sorting functions --- mass_image_import.module | 66 ++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/mass_image_import.module b/mass_image_import.module index dfc2f48..5fe82e5 100644 --- a/mass_image_import.module +++ b/mass_image_import.module @@ -133,6 +133,27 @@ function mass_image_import_batch($type, &$context) { } } +/** + * Callback for image import. + */ +function mass_image_import_batch_finished($success, $results, $operations) { + if ($success) { + if (count($results) > 0) { + $message = format_plural(count($results), t('One image processed.'), t('@count images processed.')); + } + else { + $message = t('No images to import.'); + } + } + else { + $message = t('Finished with an error.'); + } + + // Log. + watchdog('image', 'Finished mass image import.'); + drupal_set_message($message); +} + /** * Make a list of image files. * @@ -219,24 +240,20 @@ function mass_image_import_file($file, $type = 'image') { } /** - * Callback for image import. + * Get the first filefield from a content type. + * + * @param $fields + * Content type fields. + * + * @return + * Field name. */ -function mass_image_import_batch_finished($success, $results, $operations) { - if ($success) { - if (count($results) > 0) { - $message = format_plural(count($results), t('One image processed.'), t('@count images processed.')); - } - else { - $message = t('No images to import.'); +function mass_image_import_field($fields) { + foreach ($fields as $field) { + if ($field['type'] == 'filefield') { + return $field['field_name']; } - } - else { - $message = t('Finished with an error.'); - } - - // Log. - watchdog('image', 'Finished mass image import.'); - drupal_set_message($message); + } } /** @@ -289,20 +306,3 @@ function mass_image_import_create_node_from($filepath, $title, $body, $type) { drupal_execute($type .'_node_form', $form_state, $node); return $node; } - -/** - * Get the first filefield from a content type. - * - * @param $fields - * Content type fields. - * - * @return - * Field name. - */ -function mass_image_import_field($fields) { - foreach ($fields as $field) { - if ($field['type'] == 'filefield') { - return $field['field_name']; - } - } -} -- cgit v1.2.3