Fix for Code

  1. function imemodula_form_alter(&$form, $form_state, $form_id) {
  2.  
  3.   global $user;
  4.   // Pri ustvarjanju noda ne-adminu skrijemo menu elemente globlje od 4.
  5.   if ($form_id == $form['#node']->type . '_node_form' && $user->uid != 1) {
  6.     foreach ($form['menu']['parent']['#options'] as $k => $menu_option) {
  7.       if (substr($menu_option, 0, 5) == '-----') {
  8.         unset($form['menu']['parent']['#options'][$k]);
  9.       }
  10.     }
  11.   }
  12.    
  13. }

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.