diff options
| author | Silvio <silvio@devlet.com.br> | 2010-10-13 11:06:44 -0300 | 
|---|---|---|
| committer | Silvio <silvio@devlet.com.br> | 2010-10-13 11:06:44 -0300 | 
| commit | 79c9a8e8b7df654079fbe093eaf184a8d2963a25 (patch) | |
| tree | 4edc774a2f5f6a97cb29e36efacd3c10d7d954d4 | |
| parent | 7592053b042630a199be63ed23d7a4bf4c16a7e0 (diff) | |
| download | mass_image_import-79c9a8e8b7df654079fbe093eaf184a8d2963a25.tar.gz mass_image_import-79c9a8e8b7df654079fbe093eaf184a8d2963a25.tar.bz2 | |
Sorting functions
| -rw-r--r-- | mass_image_import.module | 66 | 
1 files 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 @@ -134,6 +134,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.   *   * @return @@ -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']; -    } -  }   -} | 
