[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/webform/includes/ -> webform.options.inc (source)

   1  <?php
   2  // $Id: webform.options.inc,v 1.1.2.2 2010/03/29 03:19:49 quicksketch Exp $
   3  
   4  /**
   5   * @file
   6   * A collection of built-in select list options for Webform.
   7   */
   8  
   9  /**
  10   * Private implementation of hook_webform_select_options_info().
  11   *
  12   * @see webform_webform_select_options_info().
  13   */
  14  function _webform_options_info() {
  15    $items = array();
  16  
  17    $items['days'] = array(
  18      'title' => t('Days of the week'),
  19      'options callback' => 'webform_options_days',
  20      'file' => 'includes/webform.options.inc',
  21    );
  22  
  23    if (function_exists('countries_api_get_array')) {
  24      $items['countries'] = array(
  25        'title' => t('Countries'),
  26        'options callback' => 'webform_options_countries',
  27        'file' => 'includes/webform.options.inc',
  28      );
  29    }
  30  
  31    $items['united_states'] = array(
  32      'title' => t('US states'),
  33      'options callback' => 'webform_options_united_states',
  34      'file' => 'includes/webform.options.inc',
  35    );
  36  
  37    return $items;
  38  }
  39  
  40  /**
  41   * Option list containing the days of the week.
  42   */
  43  function webform_options_days() {
  44    $days = array(
  45      'sunday' => t('Sunday'),
  46      'monday' => t('Monday'),
  47      'tuesday' => t('Tuesday'),
  48      'wednesday' => t('Wednesday'),
  49      'thursday' => t('Thursday'),
  50      'friday' => t('Friday'),
  51      'saturday' => t('Saturday'),
  52    );
  53  
  54    // Order according to site settings for first day.
  55    if ($first_day = variable_get('date_first_day', 0)) {
  56      $week = array_splice($days, $first_day);
  57      $days = array_merge($week, $days);
  58    }
  59  
  60    return $days;
  61  }
  62  
  63  /**
  64   * Options list containing country names.
  65   */
  66  function webform_options_countries() {
  67    return countries_api_get_array();
  68  }
  69  
  70  /**
  71   * Options list containing United States states and territories.
  72   */
  73  function webform_options_united_states() {
  74    return array(
  75      'AL' => t('Alabama'),
  76      'AK' => t('Alaska'),
  77      'AS' => t('American Samoa'),
  78      'AZ' => t('Arizona'),
  79      'AR' => t('Arkansas'),
  80      'CA' => t('California'),
  81      'CO' => t('Colorado'),
  82      'CT' => t('Connecticut'),
  83      'DE' => t('Delaware'),
  84      'DC' => t('District of Columbia'),
  85      'FL' => t('Florida'),
  86      'GA' => t('Georgia'),
  87      'GU' => t('Guam'),
  88      'HI' => t('Hawaii'),
  89      'ID' => t('Idaho'),
  90      'IL' => t('Illinois'),
  91      'IN' => t('Indiana'),
  92      'IA' => t('Iowa'),
  93      'KS' => t('Kansas'),
  94      'KY' => t('Kentucky'),
  95      'LA' => t('Louisiana'),
  96      'ME' => t('Maine'),
  97      'MH' => t('Marshall Islands'),
  98      'MD' => t('Maryland'),
  99      'MA' => t('Massachusetts'),
 100      'MI' => t('Michigan'),
 101      'MN' => t('Minnesota'),
 102      'MS' => t('Mississippi'),
 103      'MO' => t('Missouri'),
 104      'MT' => t('Montana'),
 105      'NE' => t('Nebraska'),
 106      'NV' => t('Nevada'),
 107      'NH' => t('New Hampshire'),
 108      'NJ' => t('New Jersey'),
 109      'NM' => t('New Mexico'),
 110      'NY' => t('New York'),
 111      'NC' => t('North Carolina'),
 112      'ND' => t('North Dakota'),
 113      'MP' => t('Northern Marianas Islands'),
 114      'OH' => t('Ohio'),
 115      'OK' => t('Oklahoma'),
 116      'OR' => t('Oregon'),
 117      'PW' => t('Palau'),
 118      'PA' => t('Pennsylvania'),
 119      'PR' => t('Puerto Rico'),
 120      'RI' => t('Rhode Island'),
 121      'SC' => t('South Carolina'),
 122      'SD' => t('South Dakota'),
 123      'TN' => t('Tennessee'),
 124      'TX' => t('Texas'),
 125      'UT' => t('Utah'),
 126      'VT' => t('Vermont'),
 127      'VI' => t('Virgin Islands'),
 128      'VA' => t('Virginia'),
 129      'WA' => t('Washington'),
 130      'WV' => t('West Virginia'),
 131      'WI' => t('Wisconsin'),
 132      'WY' => t('Wyoming'),
 133    );
 134  }


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7