Form API

Two identical forms need different handling

  1. function oneatatime_form($form_state, $translations, $node_source, $lang){
  2.  
  3.   global $user;
  4.   $form = single_string($form_state, $translations, $node_source, $lang);
  5.  
  6.          return $form;

I want something like the roles list checkbox in the user form, only with languages (almost there)

  1. function trans_languages_form(&$form) {
  2.    $sql = "SELECT language, name, native FROM {languages} order by name";
  3.    $result=  db_query($sql);
  4.    $form['trans_languages'] = array(

Fix for I want something like the roles list checkbox in the user form, only with languages

  1. function trans_languages_form(&$form) {
  2.    $sql = "SELECT language, name, native FROM {languages} order by name";
  3.    $result=  db_query($sql);
  4.    $form['trans_languages'] = array(

I want something like the roles list checkbox in the user form, only with languages

  1. function trans_languages_form(&$form) {
  2.    $sql = "SELECT language, name, native FROM {languages} order by name";
  3.    $result=  db_query($sql);
  4.    $form['trans_languages'] = array(

Broken form api + theme_table usage

  1. <?php
  2.  
  3. function brokn_menu($maycache) {
  4.  
  5.   $items = array();
  6.  
  7.   if (!$may_cache) {
  8.     $items[] = array(
  9.       'path' => 'brokn/1'

Ejemplo de select. Form API

  1. //$meses array que la key es el "valor" retornado, y el valor es el nombre mostrado, ejemplo
  2.  
  3. $meses[1]="Enero";
  4. $meses[2]="Febrero";
  5. $meses[3]="Marzo";
  6. $meses[4]="Abril";
  7. $meses[5]="Mayo";

cram.module for Drupal 6, with mutilated hook_auth into new FormAPI thingy

  1. <?php
  2. // $Id: cram.module,v 1.7 2008/02/19 05:46:07 selmanj Exp $
  3.  
  4. /**
  5.  * Implementation of hook_menu().
  6.  */
  7. function cram_menu() {
  8.   $items['admin/settings/cram'] = array(
Syndicate content