Fix for Code

  1. <?php
  2. // $Id$
  3. /**
  4. *Unset non-essential elements of the form add and edit pages.
  5. * Auth: Doug Vann
  6. * http://dougvann.com
  7. * http://www.twitter.com/dougvann
  8. */
  9.  
  10. function admin_edit_form_alter(&$form, $form_state, $form_id)
  11.   {
  12. global $user; // The $user object is not in scope unless you bring it in with this line
  13. dsm($form); //I used this to be able to drill down through the $form object to identify the elements I needed to unset.
  14. If ($user->uid!=1) { // if the logged in user does NOT have a User ID of 1 then remove the non-essential elements
  15.          unset($form[revision_information]);// No more revisions
  16.          unset($form[options][promote]); //leave the publish but remove the Promote to Front Page
  17.          unset($form[options][sticky]); //.. sticky to top? GONE
  18.          unset($form[body_field][format]);//bye bye input format options!
  19.          unset($form[author]); //..later... Author Information
  20.                    }
  21.   }
  22. ?>

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.