You are here

function label_help_theme_form_element_label in Label Help 7

Replacement for core theme_form_element_label function.

Prints help text at top of field output. Because of jujitsu happening in FAPI theming/wrapping, ctools and WYSIWYG, we have to jump through some hoops to pull this off.

Parameters

Array $variables: An array containing an element.

1 string reference to 'label_help_theme_form_element_label'
label_help_theme_registry_alter in ./label_help.module
Implements hook_theme_registry_alter().

File

./label_help.module, line 123
This is the file description for the Label Help module.

Code

function label_help_theme_form_element_label($variables) {
  $desc = '';
  if (isset($variables['element']['#theme_options']['description at top']) && !empty($variables['element']['#theme_options']['description at top'])) {
    $desc = '<div class="description label-description">' . t($variables['element']['#theme_options']['description at top']) . '</div>';
  }

  // Pass element through the "real" theme hook.
  return theme('form_element_label_x', $variables) . $desc;
}