function publishcontent_form_alter in Publish Content 5.2
Same name and namespace in other branches
- 6 publishcontent.module \publishcontent_form_alter()
Implementation of hook_form_alter()
allow to use the 'Publishing options' on the edit/add page
File
- ./
publishcontent.module, line 170 - Add button to publish or unpublish a node, with access control based on the node type
Code
function publishcontent_form_alter($form_id, &$form) {
if (!user_access('administer nodes') && $form['type']['#value'] . '_node_form' == $form_id && (_publishcontent_unpublish_access($form['#node']) || _publishcontent_publish_access($form['#node']))) {
$form['options']['#access'] = TRUE;
unset($form['options']['promote']);
unset($form['options']['sticky']);
unset($form['options']['revision']);
}
}