You are here

function popup_descriptions_preprocess_form_element in Popup 8

Same name and namespace in other branches
  1. 7 modules/popup_descriptions/popup_descriptions.module \popup_descriptions_preprocess_form_element()
  2. 7.x modules/popup_descriptions/popup_descriptions.module \popup_descriptions_preprocess_form_element()

Implementation of hook_preprocess_form_element

File

modules/popup_descriptions/popup_descriptions.module, line 59

Code

function popup_descriptions_preprocess_form_element(&$variables) {
  static $exclusions = false;
  if (!$exclusions) {
    $exclusions = module_invoke_all('popup_description_exclusions');
  }
  $element =& $variables['element'];
  $included = !(isset($element['#id']) && in_array($element['#id'], $exclusions));
  if ($included && isset($element['#description']) && strlen(trim($element['#description']))) {
    module_load_include('inc', 'popup_descriptions', 'includes/popup_descriptions.util');
    module_load_include('inc', 'popup', 'includes/popup.api');
    _popup_descriptions_apply_popup_description($element);
    _popup_descriptions_apply_popup_admin($element);
  }
}