You are here

function theme_hierarchical_select_select in Hierarchical Select 5.3

Same name and namespace in other branches
  1. 6.3 includes/theme.inc \theme_hierarchical_select_select()
  2. 7.3 includes/theme.inc \theme_hierarchical_select_select()

Format a select in the .hierarchial-select div: prevent it from being wrapped in a div. This simplifies the CSS and JS code.

Parameters

$element: An associative array containing the properties of the element.

Return value

A themed HTML string representing the form element.

2 theme calls to theme_hierarchical_select_select()
_hierarchical_select_process_render_flat_select in ./hierarchical_select.module
Render a flat select version of a hierarchical_select form element. This is necessary for backwards compatibility (together with some Javascript code) in case of GET forms.
_hierarchical_select_process_render_hs_selects in ./hierarchical_select.module
Render the selects in the hierarchical select.

File

./hierarchical_select.module, line 2298
This module defines the "hierarchical_select" form element, which is a greatly enhanced way for letting the user select items in a hierarchy.

Code

function theme_hierarchical_select_select($element) {
  $select = '';
  $size = $element['#size'] ? ' size="' . $element['#size'] . '"' : '';
  $class = array(
    'form-select',
  );
  if (form_get_error($element) === '') {
    $class = array_merge($class, array(
      'error',
    ));
  }
  _form_set_class($element, $class);
  $multiple = isset($element['#multiple']) && $element['#multiple'];
  return '<select name="' . $element['#name'] . '' . ($multiple ? '[]' : '') . '"' . ($multiple ? ' multiple="multiple" ' : '') . drupal_attributes($element['#attributes']) . ' id="' . $element['#id'] . '" ' . $size . '>' . _hierarchical_select_options($element) . '</select>';
}