form

Hook_form_alter

  1. function ganchos_form_alter(&$form, &$form_state, $form_id) {
  2.    $form['author']['#type'] = 'hidden';
  3.     $form['options']['#type'] = 'hidden';
  4.     $form['comment_settings']['#type'] = 'hidden';

Fix for form that does not call hook_submit

  1. <?php
  2. // $Id: $
  3.  
  4. /**
  5.  * Implementation of hook_menu
  6.  *
  7.  */
  8.  
  9. function aspen_people_search_menu () {
  10.         $items = array ();
  11.         $items ['aspen_people_search'] = array (
  12.                 'title' => t('Aspen People

Fix for Fix for form that doesnt call hook_submit

  1. /**
  2.  * Creating the actual form itself happens here
  3.  * Docs @
  4.  * http://api.drupal.org/api/file/developer/topics/forms_api.html/6
  5.  * http://api.drupal.org/api/file/developer/topics/forms_api_refer

Ejemplo de tabla con formulario con filtros

  1. /*
  2.  * Implementation of hook_menu().
  3.  */
  4. function admin_menu() {
  5.   $menu['search'] = array(
  6.     'title' => t('Search Database'),
  7.     'description' => t('Search in the report database.'),
  8.     'a

Fix for Custom Company Info for Theming

  1. <?php
  2. // $Id:
  3.  
  4. function system_custom_menu() {
  5.        
  6.         $items = array();
  7.        
  8.         $items['admin/settings/site-additional-info'] = array(
  9.                 'title' => t('Additional Site Information'),
  10.                 'page callback'

Fix for Custom Company Info for Theming

  1. <?php
  2. // $Id:
  3.  
  4. function system_custom_menu() {
  5.        
  6.         $items = array();
  7.        
  8.         $items['admin/settings/site-additional-info'] = array(
  9.                 'title' => t('Additional Site Information'),
  10.                 'page callback'

Custom Company Info for Theming

  1. <?php
  2. // $Id:
  3.  
  4. function system_custom_menu() {
  5.        
  6.         $items = array();
  7.        
  8.         $items['admin/settings/site-additional-info'] = array(
  9.                 'title' => t('Additional Site Information'),
  10.                 'page callback'

Change <form> action

  1. function MYMODULE_form_alter(&$form, $form_state) {
  2.   $form['#action'] = 'http://www.example.com/path/to/submit';
  3. }

How to clone a CCK-heavy node form

  1. function myzipmodule_form_massupload(&$form_state = array()) {
  2.   $content_type = 'picture';
  3.   $form_id = $content_type .

theme node form

  1. function bewplatt_theme($existing, $type, $theme, $path) {
  2.   return array(
  3.     'bewertung_node_form' => array(
  4.       'arguments' => array('form' => NULL),
  5.       'template' => 'bewertung-node-form'
Syndicate content