function date_hidden_element in Date 7.2
Same name and namespace in other branches
- 8 date_api/date_api.module \date_hidden_element()
- 7.3 date_api/date_api.module \date_hidden_element()
Determines if the date element needs to be processed.
Helper function to see if date element has been hidden by FAPI to see if it needs to be processed or just pass the value through. This is needed since normal date processing explands the date element into parts and then reconstructs it, which is not needed or desirable if the field is hidden.
Parameters
array $element: The date element to check.
Return value
bool TRUE if the element is effectively hidden, FALSE otherwise.
13 calls to date_hidden_element()
- date_combo_element_process in ./
date_elements.inc - Process an individual date element.
- date_combo_validate in ./
date_elements.inc - Validate and update a combo element.
- date_popup_element_process in date_popup/
date_popup.module - Javascript popup element processing.
- date_popup_validate in date_popup/
date_popup.module - Massage the input values back into a single date.
- date_repeat_field_widget_validate in date_repeat_field/
date_repeat_field.module - Validation for date repeat form element.
File
- date_api/
date_api.module, line 1140 - This module will make the date API available to other modules.
Code
function date_hidden_element(array $element) {
// @todo What else needs to be tested to see if dates are hidden or disabled?
if (isset($element['#access']) && empty($element['#access']) || !empty($element['#programmed']) || in_array($element['#type'], array(
'hidden',
'value',
))) {
return TRUE;
}
return FALSE;
}