You are here

function _date_repeat_widget in Date 6

Same name and namespace in other branches
  1. 5.2 date/date_repeat.inc \_date_repeat_widget()
  2. 6.2 date/date_repeat.inc \_date_repeat_widget()
  3. 7 date_repeat.inc \_date_repeat_widget()

Widget processing for date repeat form element.

Create the RRULE as a top-level element rather than a delta level element, we'll compute the repeat sequence in the widget validation to create the element delta values.

1 call to _date_repeat_widget()
_date_widget in date/date_elements.inc
Private implementation of hook_widget().

File

date/date_repeat.inc, line 30
Implementation of Date Repeat API calculations for the CCK Date field.

Code

function _date_repeat_widget($element, $field, $items, $delta) {
  $element['rrule'] = array(
    '#type' => 'date_repeat_rrule',
    '#weight' => $field['widget']['weight'] + 0.3,
    '#default_value' => isset($items[0]['rrule']) ? $items[0]['rrule'] : '',
    '#date_timezone' => $element['#date_timezone'],
    '#prev_value' => $items[0]['value'],
    '#prev_value2' => $items[0]['value2'],
    '#prev_rrule' => isset($items[0]['rrule']) ? $items[0]['rrule'] : '',
  );
  return $element;
}