You are here

function node_gallery_change_image_weight_action_submit in Node Gallery 6.3

Submit handler for the weight change form.

_state

Parameters

$form:

File

./node_gallery.actions.inc, line 139
Contains all actions for node gallery.

Code

function node_gallery_change_image_weight_action_submit($form, $form_state) {

  // We're setting all nodes to the same weight
  if (is_numeric($form_state['values']['node_gallery_change_image_weight_action'])) {
    $weight = $form_state['values']['node_gallery_change_image_weight_action'];
  }
  else {
    foreach ($form_state['values']['node_gallery_change_image_weight_action'] as $nid => $val) {
      $weight[$nid] = $val['weight'];
    }
  }
  return array(
    'imageweight' => $weight,
  );
}