You are here

function theme_gallery_edit_images_form in Node Gallery 6

Same name and namespace in other branches
  1. 6.2 theme/theme.inc \theme_gallery_edit_images_form()
1 theme call to theme_gallery_edit_images_form()
node_gallery_edit_images_form in ./node_gallery.pages.inc

File

./node_gallery.themes.inc, line 110
Node gallery themes.

Code

function theme_gallery_edit_images_form(&$form) {
  drupal_add_tabledrag('upload-attachments', 'order', 'sibling', 'upload-weight');
  $header = array(
    '',
    t('Delete'),
    t('Thumbnail'),
    t('Edit'),
    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[] = theme('imagecache', $form['#config']->image_size['thumbnail'], $form['files'][$key]['filepath']['#value'], $form['files'][$key]['filename']['#value'], $form['files'][$key]['filename']['#value']);
    $row[] = drupal_render($form['files'][$key]['edit_form']);
    $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;
}