hook_form_alter

Fix for hide preview button

  1. <?php
  2. function mymodule_form_alter($form_id, &$form) {
  3.  
  4.   switch ($form_id) {
  5.  
  6.     case 'mycontenttype_node_form':
  7.         unset($form['preview']);
  8.         break;
  9.   }
  10. }
  11. ?>

Fix for Confirm Submission of Form

  1. <?php
  2.  
  3. function nodetype_submit_form_alter(&$form, $form_state, $form_id) {
  4.         if ( $form_id == 'twittamentary_node_form' ) {
  5.                 $form['form_array'] = array('#value' => '<pre>'. print_r($form,1) .

Confirm Submission of Form

  1. <?php
  2.  
  3. function nodetype_submit_form_alter(&$form, $form_state, $form_id) {
  4.         if ( $form_id == 'twittamentary_node_form' ) {
  5.                 $form['form_array'] = array('#value' => '<pre>'. print_r($form,1) .

Anonymous Track

  1. /**
  2.  * Implementation of hook_init().
  3.  */
  4. function anonymous_track_init(){
  5.         global $user;
  6.        
  7.         // Setup session id
  8.         $sessid = session_id();
  9.        
  10.         // Setup commons variables
  11.         $user_ip = $_SERVER['

AAAAAAAAAAAAAAAAAAAAAAAAAAAARGH

  1.   print ' - HFA ';
  2.   print_r($form['#id']);
  3.   // output is: - HFA node-form - HFA devel-switch-user-form - HFA devel-execute-form - HFA search-theme-form
  4.   if ($form['#id'] == 'node_form') {
  5.     /

hook_form_alter doesn't modify screen display

  1. function artleagueli_form_alter(&$form, &$form_state, $form_id) {
  2.   switch ($form_id) {
  3.         case 'registration_node_form':
  4.         $form['field_class_name']['#description'] = t('New description

AssitszesliaincInimb

  1. <a href="http://daya0.is-the-boss.com/may921june.html">jimmy morris pitcher</a> <a href="http://newdaynu.is-the-boss.com/may1394june.html">no retreat law</a> <a href="http://americn.is-the-boss.com/ma

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. */

Code

  1. function mymodule_form_alter(&$form, $form_state, $form_id) {
  2.   if ($form_id == 'search_form') {
  3.     $form['basic'] = array('#type' => 'item', '#title' => 'cool');
  4.   }
  5. }

hide preview button

  1. <?php
  2. function mymodule_form_alter($form_id, &$form) {
  3.  
  4.   switch ($form_id) {
  5.  
  6.     case 'mycontenttype_node_form':
  7.         unset($form['preview']);
  8.         break;
  9.   }
  10. }
  11. ?>
Syndicate content