Drupal 6 Hide Revision Information
I'm trying to hide "Revision information" from my users who do not understand what that is in relation to this content type. I've read numerous posts online that suggest anything from changing a template to setting style="display: none". I'd prefer to actually remove the field from access so that injection techniques aren't still viable. I've done this by creating a
hook_form_alter
that sets $form['revision_information']['#access'] = false;
. I've verified with Firebug that the method is indeed called, yet the form elements prevail. Any thoughts? Thanks in advance! Drupal rocks!
function recipe_form_recipe_node_form_alter(&$form, $form_state){
if (isset($form['revision_information'])) {
$form['revision_information']['#access'] = FALSE;
firep(print_r($form['revision_informati开发者_高级运维on'],true));
$form_state['rebuild'] = true;
}
}
Quoting marcvangend
Note that you can also hide the revision information with the correct settings; it will only show if the "Create new revision" option is checked, or if the current user has the "administer nodes" permission
This would probably be the easiest option.
Note: wiki answer as it is not my own
/* Below code added by tejas tank , tta@openerp.com
to disable the revision block from everywhere
*/
function phptemplate_node_form($form) {
$form['revision_information']['#access'] = FALSE;
return theme_node_form($form);
}
精彩评论