function _publishcontent_configure_publish_checkbox in Publish Content 7
Configure the node form to include the publish checkbox.
1 call to _publishcontent_configure_publish_checkbox()
- publishcontent_form_node_form_alter in ./
publishcontent.module - Implements hook_form_FORM_ID_alter().
File
- ./
publishcontent.module, line 434 - Add link to publish or unpublish a node, with access control based on the node type
Code
function _publishcontent_configure_publish_checkbox(&$form, &$form_state) {
$form['options']['status']['#access'] = TRUE;
if (!empty($form['options']['#access'])) {
return;
}
else {
$form['options']['#access'] = TRUE;
}
foreach (element_children($form['options']) as $key) {
// If another form has afforded access to a particular option, do not
// override that access. Otherwise, disable it.
$form['options'][$key]['#access'] = isset($form['options'][$key]['#access']) ? $form['options'][$key]['#access'] : FALSE;
}
}