You are here

function node_gallery_image_item_edit_form in Node Gallery 6.2

Same name and namespace in other branches
  1. 6.3 node_gallery.pages.inc \node_gallery_image_item_edit_form()
  2. 6 node_gallery.pages.inc \node_gallery_image_item_edit_form()
2 calls to node_gallery_image_item_edit_form()
node_gallery_edit_images_form in ./node_gallery.pages.inc
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

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

Code

function node_gallery_image_item_edit_form($form_values, $image, $config) {
  module_load_include('inc', 'node', 'node.pages');
  $form_state = array(
    'values' => $form_values,
  );
  $display_fields = $config['display_fields'];
  $form = drupal_retrieve_form($image->type . '_node_form', $form_state, $image);
  drupal_prepare_form($image->type . "_node_form", $form, $form_state);
  $item_form = array();
  $display_fields['#field_info'] = '#field_info';

  //this should be merged with parent form to optionwidget to work
  foreach (array_values($display_fields) as $field_name) {
    if (!empty($field_name)) {

      //$item_form[$field_name] = (array)get_image_form_item_recursive($form, $field_name);
      $item_form[$field_name] = $form[$field_name];
    }
  }
  $item_form += (array) get_image_form_value_items($form);
  set_image_form_default_values($item_form, $image, $config);
  return $item_form;
}