You are here

function node_gallery_manage_form in Node Gallery 6.2

File

./node_gallery.pages.inc, line 640
Node gallery pages.

Code

function node_gallery_manage_form($form_state, $gallery) {
  if (empty($gallery->images)) {
    return t('This gallery has no images presently, please upload some.');
  }
  $form['#theme'] = array(
    '#theme' => 'gallery_manage_images_form',
    '#cache' => TRUE,
  );
  $form['#id'] = 'manage-images-form';
  $form['#gallery'] = $gallery;
  $config = $gallery->config;
  $form['images'] = array();
  foreach ($gallery->images as $image) {
    $subform['image' . $image->nid] = array(
      '#prefix' => '<div class="manage-image-' . $image->nid . '">',
      '#suffix' => '</div>',
    );
    $subform['image' . $image->nid]['check'] = array(
      '#type' => 'checkbox',
    );
    $subform['image' . $image->nid]['thumb'] = array(
      '#value' => theme('image_view', $config['image_size']['thumbnail'], $image),
    );
    $form['images'] = array_merge(array(), $subform);
  }
  return $form;
}