function node_admin_nodes_submit

Form submission handler for node_admin_nodes().

Executes the chosen 'Update option' on the selected nodes.

See also

node_admin_nodes()

node_admin_nodes_validate()

node_filter_form()

node_filter_form_submit()

node_multiple_delete_confirm()

node_multiple_delete_confirm_submit()

1 string reference to 'node_admin_nodes_submit'
node_admin_nodes in drupal/core/modules/node/node.admin.inc
Returns the admin form object to node_admin_content().

File

drupal/core/modules/node/node.admin.inc, line 651
Content administration and module settings user interface.

Code

function node_admin_nodes_submit($form, &$form_state) {
  $operations = module_invoke_all('node_operations');
  $operation = $operations[$form_state['values']['operation']];

  // Filter out unchecked nodes
  $nodes = array_filter($form_state['values']['nodes']);
  if ($function = $operation['callback']) {

    // Add in callback arguments if present.
    if (isset($operation['callback arguments'])) {
      $args = array_merge(array(
        $nodes,
      ), $operation['callback arguments']);
    }
    else {
      $args = array(
        $nodes,
      );
    }
    call_user_func_array($function, $args);
    cache_invalidate_tags(array(
      'content' => TRUE,
    ));
  }
  else {

    // We need to rebuild the form to go to a second step. For example, to
    // show the confirmation form for the deletion of nodes.
    $form_state['rebuild'] = TRUE;
  }
}