function custom_pub_forms in Custom Publishing Options 7
Same name and namespace in other branches
- 6 custom_pub.module \custom_pub_forms()
Implements hook_forms().
File
- ./
custom_pub.module, line 96 - Adds the ability to add Custom publishing options to the node Add/Edit forms.
Code
function custom_pub_forms($form_id, $args) {
//We need to use this hook because on the admin page there is the possibility of multiple forms for the edit form. See http://drupal.org/node/354519
$types = variable_get('custom_pub_types', array());
foreach ($types as $type) {
if ($form_id == 'custom_pub_edit_' . $type['type']) {
$forms[$form_id] = array(
'callback' => 'custom_pub_edit',
);
return $forms;
}
}
if ($form_id == 'node_admin_content') {
module_load_include('inc', 'node', 'node.admin');
$forms['node_admin_content'] = array(
'callback' => 'custom_pub_node_admin_content',
);
return $forms;
}
}