[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

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

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


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7