Disable extra fields in CCK for Drupal
Posted by Helmut Granda | Filed under Articles, Drupal
There are times when you want to allow the Super Admin to edit those extra fields but not the editors/contributors of your site so this is one way to do it:
- < ?php
/**
* Change the node form
*/
function phptemplate_node_form($form) {
// echo "<div style='direction:ltr;'>"; dprint_r ($form); echo '';
// Hide 'Log message' text area
$form['log']['#access'] = FALSE;
// Hide the author collapsable box
$form['author']['#access'] = FALSE;
// Hide the publishing options collapsable box
$form['options']['#access'] = FALSE;
// Open the file attachments collapsible block in a full state
$form['attachments']['#collapsed'] = FALSE;
return drupal_render($form);
}
?>