Projet

Général

Profil

Révision 599a39cd

Ajouté par Assos Assos il y a environ 3 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/date/date.api.php
40 40
 *   - rdf_mapping: The RDF mapping array.
41 41
 *   - add_rdf: If module_exists('rdf').
42 42
 */
43
function hook_date_formatter_pre_view_alter(&$entity, &$variables) {
43
function hook_date_formatter_pre_view_alter(&$entity, array &$variables) {
44 44
  if (!empty($entity->view)) {
45 45
    $field = $variables['field'];
46 46
    $date_id = 'date_id_' . $field['field_name'];
......
68 68
 *   - item: The $item array.
69 69
 *   - display: The $display array.
70 70
 */
71
function hook_date_formatter_dates_alter(&$dates, $context) {
71
function hook_date_formatter_dates_alter(array &$dates, array $context) {
72 72
  $field = $context['field'];
73 73
  $instance = $context['instance'];
74 74
  $format = $context['format'];
......
90 90
      'date2' => $date2,
91 91
      'format' => $format,
92 92
      'entity_type' => $entity_type,
93
      'entity' => $entity));
93
      'entity' => $entity,
94
    ));
94 95
    $all_day2 = theme('date_all_day', array(
95 96
      'field' => $field,
96 97
      'instance' => $instance,
......
99 100
      'date2' => $date2,
100 101
      'format' => $format,
101 102
      'entity_type' => $entity_type,
102
      'entity' => $entity));
103
      'entity' => $entity,
104
    ));
103 105
    $dates['value']['formatted_time'] = theme('date_all_day_label');
104 106
    $dates['value2']['formatted_time'] = theme('date_all_day_label');
105 107
    $dates['value']['formatted'] = $all_day1;
......
117 119
 * @param array $input
118 120
 *   The array of input values to be validated.
119 121
 */
120
function hook_date_text_pre_validate_alter(&$element, &$form_state, &$input) {
122
function hook_date_text_pre_validate_alter(array &$element, array &$form_state, array &$input) {
121 123
  // Let Date module massage the format for all day values so they will pass
122 124
  // validation. The All day flag, if used, actually exists on the parent
123 125
  // element.
......
134 136
 * @param array $input
135 137
 *   The array of input values to be validated.
136 138
 */
137
function hook_date_select_pre_validate_alter(&$element, &$form_state, &$input) {
139
function hook_date_select_pre_validate_alter(array &$element, array &$form_state, array &$input) {
138 140
  // Let Date module massage the format for all day values so they will pass
139 141
  // validation. The All day flag, if used, actually exists on the parent
140 142
  // element.
......
151 153
 * @param array $input
152 154
 *   The array of input values to be validated.
153 155
 */
154
function hook_date_popup_pre_validate_alter(&$element, &$form_state, &$input) {
156
function hook_date_popup_pre_validate_alter(array &$element, array &$form_state, array &$input) {
155 157
  // Let Date module massage the format for all day values so they will pass
156 158
  // validation. The All day flag, if used, actually exists on the parent
157 159
  // element.
......
173 175
 *
174 176
 * @see date_combo_element_process()
175 177
 */
176
function hook_date_combo_pre_validate_alter(&$element, &$form_state, $context) {
178
function hook_date_combo_pre_validate_alter(array &$element, array &$form_state, array $context) {
177 179
  if (!empty($context['item']['all_day'])) {
178

  
179 180
    $field = $context['field'];
180 181

  
181 182
    // If we have an all day flag on this date and the time is empty, change the
......
200 201
 *   A keyed array containing the current state of the form.
201 202
 * @param array $context
202 203
 *   An associative array containing the following keys:
203
 *  - field: The $field array.
204
 *  - instance: The $instance array.
205
 *  - item: The $item array.
206
 *  - element: The $element array.
204
 *   - field: The $field array.
205
 *   - instance: The $instance array.
206
 *   - item: The $item array.
207
 *   - element: The $element array.
207 208
 */
208
function hook_date_combo_validate_date_start_alter(&$date, &$form_state, $context) {
209
function hook_date_combo_validate_date_start_alter(object &$date, array &$form_state, array $context) {
209 210
  // If this is an 'All day' value, set the time to midnight.
210 211
  if (!empty($context['element']['#date_is_all_day'])) {
211 212
    $date->setTime(0, 0, 0);
......
224 225
 *   A keyed array containing the current state of the form.
225 226
 * @param array $context
226 227
 *   An associative array containing the following keys:
227
 *  - field: The $field array.
228
 *  - instance: The $instance array.
229
 *  - item: The $item array.
230
 *  - element: The $element array.
228
 *   - field: The $field array.
229
 *   - instance: The $instance array.
230
 *   - item: The $item array.
231
 *   - element: The $element array.
231 232
 */
232
function hook_date_combo_validate_date_end_alter(&$date, &$form_state, $context) {
233
function hook_date_combo_validate_date_end_alter(object &$date, array &$form_state, array $context) {
233 234
  // If this is an 'All day' value, set the time to midnight.
234 235
  if (!empty($context['element']['#date_is_all_day'])) {
235 236
    $date->setTime(0, 0, 0);
......
249 250
 *
250 251
 * @see date_text_element_process()
251 252
 */
252
function hook_date_text_process_alter(&$element, &$form_state, $context) {
253
function hook_date_text_process_alter(array &$element, array &$form_state, array $context) {
253 254
  $all_day_id = !empty($element['#date_all_day_id']) ? $element['#date_all_day_id'] : '';
254 255
  if ($all_day_id != '') {
255 256
    // All Day handling on text dates works only if the user leaves the time out
......
270 271
 *
271 272
 * @see date_select_element_process()
272 273
 */
273
function hook_date_select_process_alter(&$element, &$form_state, $context) {
274
function hook_date_select_process_alter(array &$element, array &$form_state, array $context) {
274 275
  // Hide or show the element in reaction to the all_day status for the element.
275 276
  $all_day_id = !empty($element['#date_all_day_id']) ? $element['#date_all_day_id'] : '';
276 277
  if ($all_day_id != '') {
......
299 300
 *
300 301
 * @see date_popup_element_process()
301 302
 */
302
function hook_date_popup_process_alter(&$element, &$form_state, $context) {
303
function hook_date_popup_process_alter(array &$element, array &$form_state, array $context) {
303 304
  // Hide or show the element in reaction to the all_day status for the element.
304 305
  $all_day_id = !empty($element['#date_all_day_id']) ? $element['#date_all_day_id'] : '';
305 306
  if ($all_day_id != '' && array_key_exists('time', $element)) {
......
324 325
 *   - instance: The $instance array.
325 326
 *   - form: Nested array of form elements that comprise the form.
326 327
 */
327
function hook_date_combo_process_alter(&$element, &$form_state, $context) {
328
function hook_date_combo_process_alter(array &$element, array &$form_state, array $context) {
328 329
  $field = $context['field'];
329 330
  $instance = $context['instance'];
330 331
  $field_name = $element['#field_name'];
......
365 366
 *
366 367
 * @see date_timezone_element_process()
367 368
 */
368
function hook_date_timezone_process_alter(&$element, &$form_state, $context) {
369
function hook_date_timezone_process_alter(array &$element, array &$form_state, array $context) {
369 370
  // @todo.
370 371
}
371 372

  
......
382 383
 *
383 384
 * @see date_year_range_element_process()
384 385
 */
385
function hook_date_year_range_process_alter(&$element, &$form_state, $context) {
386
function hook_date_year_range_process_alter(array &$element, array &$form_state, array $context) {
386 387
  // @todo.
387 388
}
388 389

  
......
399 400
 *
400 401
 * @see hook_field_settings_form()
401 402
 */
402
function hook_date_field_settings_form_alter(&$form, $context) {
403
function hook_date_field_settings_form_alter(array &$form, array $context) {
403 404
  $field = $context['field'];
404 405
  $instance = $context['instance'];
405 406
  $has_data = $context['has_data'];
......
427 428
 *
428 429
 * @see hook_field_instance_settings_form()
429 430
 */
430
function hook_date_field_instance_settings_form_alter(&$form, $context) {
431
function hook_date_field_instance_settings_form_alter(array &$form, array $context) {
431 432
  $field = $context['field'];
432 433
  $instance = $context['instance'];
433 434
  $form['new_setting'] = array(
......
449 450
 *
450 451
 * @see hook_field_widget_settings_form()
451 452
 */
452
function hook_date_field_widget_settings_form_alter(&$form, $context) {
453
function hook_date_field_widget_settings_form_alter(array &$form, array $context) {
453 454
  $field = $context['field'];
454 455
  $instance = $context['instance'];
455 456
  $form['new_setting'] = array(
......
474 475
 *
475 476
 * @see hook_field_formatter_settings_form()
476 477
 */
477
function hook_date_field_formatter_settings_form_alter(&$form, &$form_state, $context) {
478
function hook_date_field_formatter_settings_form_alter(array &$form, array &$form_state, array $context) {
478 479
  $field = $context['field'];
479 480
  $instance = $context['instance'];
480 481
  $view_mode = $context['view_mode'];
......
486 487
      '#type' => 'select',
487 488
      '#options' => array(
488 489
        'show' => t('Show repeat rule'),
489
        'hide' => t('Hide repeat rule')),
490
        'hide' => t('Hide repeat rule'),
491
      ),
490 492
      '#default_value' => $settings['show_repeat_rule'],
491 493
      '#access' => $field['settings']['repeat'],
492 494
      '#weight' => 5,
......
508 510
 *
509 511
 * @see hook_field_formatter_settings_summary()
510 512
 */
511
function hook_date_field_formatter_settings_summary_alter(&$summary, $context) {
513
function hook_date_field_formatter_settings_summary_alter(array &$summary, array $context) {
512 514
  $field = $context['field'];
513 515
  $instance = $context['instance'];
514 516
  $view_mode = $context['view_mode'];

Formats disponibles : Unified diff