You are here

function image_upload_process in Node Gallery 6.2

We can't put this function to node_gallery.pages.inc because the batch was started after reboot.

Parameters

unknown_type $file:

unknown_type $fid:

unknown_type $num:

unknown_type $context:

1 string reference to 'image_upload_process'
node_gallery_images_edit_submit in ./node_gallery.pages.inc

File

./node_gallery.module, line 448
Node gallery module file

Code

function image_upload_process($images, $is_upload, &$context) {
  if (!isset($context['sandbox']['progress'])) {
    $context['sandbox']['progress'] = 0;
    $context['sandbox']['total'] = count($images);
    $context['results'][] = $is_upload ? t('You uploaded !num.', array(
      '!num' => format_plural(count($images), '1 image', '@count images'),
    )) : t('You edited !num.', array(
      '!num' => format_plural(count($images), '1 image', '@count images'),
    ));
  }
  foreach ($images as $fid => $image) {
    node_gallery_image_save($image);
    $context['sandbox']['progress']++;
  }
  node_gallery_set_cover($image->gid);
  $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['total'];
}