function cmf_admin_nodes_form_submit in Content Management Filter 5
Same name and namespace in other branches
- 6.2 node.inc \cmf_admin_nodes_form_submit()
- 6 node.inc \cmf_admin_nodes_form_submit()
- 7 node.inc \cmf_admin_nodes_form_submit()
Handle post-validation form submission. \n Execute the chosen 'Update option' on the selected nodes, such as publishing, unpublishing, promotion and stickness status or deleting.
Parameters
the ID of the passed form:
array with the form properties values:
See also
cmf_admin_nodes_form_validate()
File
- ./
node.inc, line 127 - Content management filter module file
Code
function cmf_admin_nodes_form_submit($form_id, $form_values) {
$operations = module_invoke_all('node_operations');
$operation = $operations[$form_values['operation']];
// Filter out unchecked nodes
$nodes = array_filter($form_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_clear_all();
drupal_set_message(t('The update has been performed.'));
if (arg(0) == 'user' && is_numeric(arg(1)) && arg(1) > 0) {
return 'user/' . arg(1) . '/user-content';
}
else {
return 'admin/content/filter';
}
}
}