Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.84 KB | None | 0 0
  1. <?php
  2. // $Id$
  3.  
  4. /**
  5.  * @file
  6.  * Drupal Module: form_corrections
  7.  * Adds custom code specific to this Drupal 6 site.
  8.  */
  9.  
  10. /**
  11.  * Implementation of hook_form_alter().
  12.  */
  13. function form_corrections_form_alter(&$form, &$form_state, $form_id) {
  14.   print $form_id;
  15.   switch ($form_id) {
  16.     //case 'story_node_form':
  17.     //  $form['menu']['#access'] = 0;
  18.     //break;  
  19.     case 'alert_node_form':
  20.       // remove some unwanted node editing fields
  21.       $form['revision_information']['#access'] = 0;
  22.       $form['menu']['#access'] = 0;
  23.       $form['author']['#access'] = 0;
  24.       // override node options permissions defined by 'administer nodes'
  25.       $form['options']['#access'] = 1;
  26.       $form['options']['status']['#access'] = 1;
  27.       $form['options']['promote']['#access'] = 0;
  28.       $form['options']['sticky']['#access'] = 0;
  29.       // Taxonomy Term Changes
  30.       $form['taxonomy']['16']['#required'] = TRUE;
  31.       $form['taxonomy']['16']['#multiple'] = TRUE;
  32.       $form['taxonomy']['16']['#description'] = t("Please select the type(s) of Alert that you wish to post. You may select more than one type if they apply to your post ('ctrl'+'select').");
  33.       $form['taxonomy']['16']['#title'] = t('Alert Type');
  34.       // Unsetting options in the forum select box (taxonomy term select) that aren't applicable to the 'Alert' content type
  35.       unset($form['taxonomy']['16']['#options']['']);
  36.       unset($form['taxonomy']['16']['#options']['0']);
  37.       unset($form['taxonomy']['16']['#options']['7']);
  38.       unset($form['taxonomy']['16']['#options']['8']);
  39.       unset($form['taxonomy']['16']['#options']['9']);
  40.       //
  41.       // $form['taxonomy']['16']['#options']['1']['option']['139'] = t('Buy It Now');
  42.  
  43.     break;
  44.   }
  45.   $form['form_array'] = array(
  46.     '#value' => '<pre>'. print_r($form, 1) .'</pre>',
  47.     '#weight' => '99',
  48.   );
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement