You are here

function date_hidden_element in Date 8

Same name and namespace in other branches
  1. 7.3 date_api/date_api.module \date_hidden_element()
  2. 7.2 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.

7 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. Don't try this if there were errors before reaching this point.
date_repeat_field_widget_validate in date_repeat_field/date_repeat_field.module
Validation for date repeat form element.
date_repeat_rrule_validate in date_repeat/date_repeat_form.inc
Build a RRULE out of the form values.
date_timezone_element_process in date_api/date_api_elements.inc
Creates a timezone form element.

... See full list

File

date_api/date_api.module, line 178
This module will make the date API available to other modules. Designed to provide a light but flexible assortment of functions and constants, with more functionality in additional files that are not loaded unless other modules specifically include them.

Code

function date_hidden_element($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;
}