Révision b720ea3e
Ajouté par Assos Assos il y a plus de 8 ans
drupal7/sites/all/modules/date/date_admin.inc | ||
---|---|---|
74 | 74 |
'#description' => t('Identify specific start and/or end dates in the format YYYY-MM-DDTHH:MM:SS, or leave blank for all available dates.'), |
75 | 75 |
); |
76 | 76 |
|
77 |
$form['show_remaining_days'] = array( |
|
78 |
'#title' => t('Show remaining days'), |
|
79 |
'#type' => 'checkbox', |
|
80 |
'#default_value' => $settings['show_remaining_days'], |
|
81 |
'#weight' => 0, |
|
82 |
); |
|
77 | 83 |
return $form; |
78 | 84 |
} |
79 | 85 |
|
... | ... | |
127 | 133 |
case 'date_plain': |
128 | 134 |
$format = t('Plain'); |
129 | 135 |
break; |
136 |
|
|
130 | 137 |
case 'format_interval': |
131 | 138 |
$format = t('Interval'); |
132 | 139 |
break; |
140 |
|
|
133 | 141 |
default: |
134 | 142 |
if (!empty($format_types[$settings['format_type']])) { |
135 | 143 |
$format = $format_types[$settings['format_type']]; |
... | ... | |
148 | 156 |
'value' => t('Display Start date only'), |
149 | 157 |
'value2' => t('Display End date only'), |
150 | 158 |
); |
151 |
$summary[] = $options[$settings['fromto']]; |
|
159 |
if (isset($options[$settings['fromto']])) { |
|
160 |
$summary[] = $options[$settings['fromto']]; |
|
161 |
} |
|
152 | 162 |
} |
153 | 163 |
|
154 | 164 |
if (array_key_exists('multiple_number', $settings) && !empty($field['cardinality'])) { |
... | ... | |
159 | 169 |
)); |
160 | 170 |
} |
161 | 171 |
|
172 |
if (array_key_exists('show_remaining_days', $settings)) { |
|
173 |
$summary[] = t('Show remaining days: @value', array('@value' => ($settings['show_remaining_days'] ? 'yes' : 'no'))); |
|
174 |
} |
|
175 |
|
|
162 | 176 |
return $summary; |
163 | 177 |
} |
164 | 178 |
|
... | ... | |
191 | 205 |
'#type' => 'select', |
192 | 206 |
'#title' => t('Default date'), |
193 | 207 |
'#default_value' => $settings['default_value'], |
194 |
'#options' => array('blank' => t('No default value'), 'now' => t('Now'), 'strtotime' => t('Relative')), |
|
208 |
'#options' => array( |
|
209 |
'blank' => t('No default value'), |
|
210 |
'now' => t('Now'), |
|
211 |
'strtotime' => t('Relative'), |
|
212 |
), |
|
195 | 213 |
'#weight' => 1, |
196 | 214 |
'#fieldset' => 'default_values', |
197 | 215 |
); |
... | ... | |
204 | 222 |
'#default_value' => $settings['default_value_code'], |
205 | 223 |
'#states' => array( |
206 | 224 |
'visible' => array( |
207 |
':input[name="instance[settings][default_value]"]' => array('value' => 'strtotime')), |
|
225 |
':input[name="instance[settings][default_value]"]' => array( |
|
226 |
'value' => 'strtotime', |
|
227 |
), |
|
208 | 228 |
), |
229 |
), |
|
209 | 230 |
'#weight' => 1.1, |
210 | 231 |
'#fieldset' => 'default_values', |
211 | 232 |
); |
... | ... | |
213 | 234 |
'#type' => !empty($field['settings']['todate']) ? 'select' : 'hidden', |
214 | 235 |
'#title' => t('Default end date'), |
215 | 236 |
'#default_value' => $settings['default_value2'], |
216 |
'#options' => array('same' => t('Same as Default date'), 'blank' => t('No default value'), 'now' => t('Now'), 'strtotime' => t('Relative')), |
|
237 |
'#options' => array( |
|
238 |
'same' => t('Same as Default date'), |
|
239 |
'blank' => t('No default value'), |
|
240 |
'now' => t('Now'), |
|
241 |
'strtotime' => t('Relative'), |
|
242 |
), |
|
217 | 243 |
'#weight' => 2, |
218 | 244 |
'#fieldset' => 'default_values', |
219 | 245 |
); |
... | ... | |
224 | 250 |
'#default_value' => $settings['default_value_code2'], |
225 | 251 |
'#states' => array( |
226 | 252 |
'visible' => array( |
227 |
':input[name="instance[settings][default_value2]"]' => array('value' => 'strtotime')), |
|
253 |
':input[name="instance[settings][default_value2]"]' => array( |
|
254 |
'value' => 'strtotime', |
|
255 |
), |
|
228 | 256 |
), |
257 |
), |
|
229 | 258 |
'#weight' => 2.1, |
230 | 259 |
'#fieldset' => 'default_values', |
231 | 260 |
); |
... | ... | |
284 | 313 |
$formats = drupal_map_assoc($formats); |
285 | 314 |
} |
286 | 315 |
$now = date_example_date(); |
316 |
$options['site-wide'] = t('Short date format: @date', array('@date' => date_format_date($now, 'short'))); |
|
287 | 317 |
foreach ($formats as $f) { |
288 | 318 |
$options[$f] = date_format_date($now, 'custom', $f); |
289 | 319 |
} |
... | ... | |
369 | 399 |
'#weight' => 9, |
370 | 400 |
); |
371 | 401 |
if (in_array($widget['type'], array('date_select'))) { |
372 |
$options = array('above' => t('Above'), 'within' => t('Within'), 'none' => t('None')); |
|
402 |
$options = array( |
|
403 |
'above' => t('Above'), |
|
404 |
'within' => t('Within'), |
|
405 |
'none' => t('None'), |
|
406 |
); |
|
373 | 407 |
$description = t("The location of date part labels, like 'Year', 'Month', or 'Day' . 'Above' displays the label as titles above each date part. 'Within' inserts the label as the first option in the select list and in blank textfields. 'None' doesn't visually label any of the date parts. Theme functions like 'date_part_label_year' and 'date_part_label_month' control label text."); |
374 | 408 |
} |
375 | 409 |
else { |
376 |
$options = array('above' => t('Above'), 'none' => t('None')); |
|
410 |
$options = array( |
|
411 |
'above' => t('Above'), |
|
412 |
'none' => t('None'), |
|
413 |
); |
|
377 | 414 |
$description = t("The location of date part labels, like 'Year', 'Month', or 'Day' . 'Above' displays the label as titles above each date part. 'None' doesn't visually label any of the date parts. Theme functions like 'date_part_label_year' and 'date_part_label_month' control label text."); |
378 | 415 |
} |
379 | 416 |
$form['advanced']['label_position'] = array( |
... | ... | |
403 | 440 |
} |
404 | 441 |
} |
405 | 442 |
|
443 |
$form['advanced']['no_fieldset'] = array( |
|
444 |
'#type' => 'checkbox', |
|
445 |
'#title' => t('Render as a regular field'), |
|
446 |
'#default_value' => !empty($settings['no_fieldset']), |
|
447 |
'#description' => t('Whether to render this field as a regular field instead of a fieldset. The date field elements are wrapped in a fieldset by default, and may not display well without it.'), |
|
448 |
); |
|
449 |
|
|
406 | 450 |
$context = array( |
407 | 451 |
'field' => $field, |
408 | 452 |
'instance' => $instance, |
... | ... | |
470 | 514 |
'#title' => t('Date attributes to collect'), |
471 | 515 |
'#default_value' => $granularity, |
472 | 516 |
'#options' => $options, |
473 |
'#attributes' => array('class' => array('container-inline')), |
|
517 |
'#attributes' => array( |
|
518 |
'class' => array('container-inline'), |
|
519 |
), |
|
474 | 520 |
'#description' => $description, |
475 | 521 |
'year' => $checkbox_year, |
476 | 522 |
); |
... | ... | |
528 | 574 |
'#weight' => 11, |
529 | 575 |
'#states' => array( |
530 | 576 |
'visible' => array( |
531 |
'input[name="field[settings][cache_enabled]"]' => array('checked' => TRUE), |
|
577 |
'input[name="field[settings][cache_enabled]"]' => array( |
|
578 |
'checked' => TRUE, |
|
579 |
), |
|
532 | 580 |
), |
533 | 581 |
), |
534 | 582 |
); |
... | ... | |
600 | 648 |
'site' => t("Site's time zone"), |
601 | 649 |
'date' => t("Date's time zone"), |
602 | 650 |
'user' => t("User's time zone"), |
603 |
'utc' => 'UTC', |
|
651 |
'utc' => 'UTC',
|
|
604 | 652 |
'none' => t('No time zone conversion'), |
605 | 653 |
); |
606 | 654 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules