Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 10th, 2012  |  syntax: None  |  size: 1.47 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  
  3.  
  4. function myhooks_form_alter(&$form, $form_state, $form_id)
  5. {
  6.        
  7.         switch ($form_id)
  8.         {
  9.                 case 'page_node_form':
  10.                         //dsm($form);
  11.                         $form['menu']['#access'] = TRUE;
  12.                         $form['comment_settings']['#access'] = FALSE; // Comments
  13.                         $form['options']['#access'] = FALSE; // Publishing
  14.                         $form['author']['#access'] = FALSE; // Authoring Information
  15.                         $form['revision_information']['#access'] = FALSE; // Revision Information
  16.                         $form['path']['#access'] = FALSE; // Path Alias
  17.                         break;
  18.        
  19.                 case 'news_article_node_form':
  20.                 case 'diary_event_node_form':
  21.                         //dsm($form);
  22.                         $form['menu']['#access'] = FALSE;
  23.                         $form['comment_settings']['#access'] = FALSE; // Comments
  24.                         $form['options']['#access'] = FALSE; // Publishing
  25.                         $form['author']['#access'] = FALSE; // Authoring Information
  26.                         $form['revision_information']['#access'] = FALSE; // Revision Information
  27.                         $form['path']['#access'] = FALSE; // Path Alias
  28.                         break;
  29.                
  30.                        
  31.                 case 'media_gallery_node_form':
  32.                         dsm($form);
  33.                         $form['menu']['#access'] = FALSE;
  34.                         $form['comment_settings']['#access'] = FALSE; // Comments
  35.                         $form['options']['#access'] = FALSE; // Publishing
  36.                         $form['author']['#access'] = FALSE; // Authoring Information
  37.                         $form['revision_information']['#access'] = FALSE; // Revision Information
  38.                         $form['path']['#access'] = FALSE; // Path Alias
  39.                         //$form['settings_wrapper']['#access'] = FALSE; // All Extra Settings
  40.                         $form['block']['#access'] = FALSE;
  41.                         break;
  42.         }
  43. }
  44.  
  45.  
  46.  
  47. ?>