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