You are here

function theme_gallery_sort_images_form in Node Gallery 6.2

1 theme call to theme_gallery_sort_images_form()
node_gallery_sort_images_form in ./node_gallery.pages.inc
This is exactly like the edit images form except it removes the ability to edit the image content and removes pagination

File

theme/theme.inc, line 149
theme/theme.inc Node gallery theme functions

Code

function theme_gallery_sort_images_form($form) {
  drupal_add_tabledrag('upload-attachments', 'order', 'sibling', 'upload-weight');
  $thumb_imagecache = $form['#thumb_imagecache'];
  $header = array(
    '↑↓',
    t('Delete'),
    t('Thumbnail'),
    t('Weight'),
    t('Cover'),
  );
  foreach (element_children($form['files']) as $key) {

    // Add class to group weight fields for drag and drop.
    $form['files'][$key]['weight']['#attributes']['class'] = 'upload-weight';
    $row = array(
      '',
    );
    $row[] = drupal_render($form['files'][$key]['remove']);
    $row[] = '<span class="gallery-upload-thumb">' . theme('imagecache', $thumb_imagecache, $form['files'][$key]['filepath']['#value'], $form['files'][$key]['filename']['#value'], $form['files'][$key]['filename']['#value']) . '</span>';

    //$row[] = drupal_render($form['files'][$key]['edit_form']) . drupal_render($form['files'][$key]['gid']);
    $row[] = drupal_render($form['files'][$key]['weight']);
    if ($form['is_cover']) {
      $row[] = drupal_render($form['is_cover'][$key]);
    }
    $rows[] = array(
      'data' => $row,
      'class' => 'draggable',
    );
  }
  $output = theme('table', $header, $rows, array(
    'id' => 'upload-attachments',
  ));
  $output .= drupal_render($form);
  return $output;
}