function date_all_day_date_popup_process_alter in Date 7.3
Same name and namespace in other branches
- 8 date_all_day/date_all_day.module \date_all_day_date_popup_process_alter()
- 7.2 date_all_day/date_all_day.module \date_all_day_date_popup_process_alter()
Implements hook_date_popup_process_alter().
File
- date_all_day/
date_all_day.module, line 231 - Adds All Day functionality to the Date field.
Code
function date_all_day_date_popup_process_alter(&$element, &$form_state, $context) {
// This hook lets us make changes to the date_popup element. Hide or show
// this element in reaction to the all_day status for this element.
$all_day_id = !empty($element['#date_all_day_id']) ? $element['#date_all_day_id'] : '';
if ($all_day_id != '' && array_key_exists('time', $element)) {
$element['time']['#states'] = array(
'visible' => array(
'input[name="' . $all_day_id . '"]' => array(
'checked' => FALSE,
),
),
);
}
}