function theme_hierarchical_select_render_selects in Hierarchical Select 5.2
Render the selects.
Parameters
$hsid: A hierarchical select id.
$hierarchy: A hierarchy object.
Return value
The rendered HTML.
2 theme calls to theme_hierarchical_select_render_selects()
- hierarchical_select_json in ./
hierarchical_select.module - Menu callback; JSON callback: generates and outputs the appropriate HTML.
- theme_hierarchical_select_render_initial_html in ./
hierarchical_select.module - Render the initial hierarchical select.
File
- ./
hierarchical_select.module, line 812 - This module defines the "hierarchical_select" form element, which is a greatly enhanced way for letting the user select an option in a hierarchy.
Code
function theme_hierarchical_select_render_selects($hsid, $hierarchy) {
$output = '';
$level_labels_style = variable_get('hierarchical_select_level_labels_style', 'none');
for ($depth = 0; $depth < count($hierarchy->lineage); $depth++) {
$output .= '<select id="hierarchical-select-' . $hsid . '-select-level-' . $depth . '" class="form-select hierarchical-select-select hierarchical-select-' . $hsid . '-select">';
foreach ($hierarchy->levels[$depth] as $value => $label) {
$output .= '<option';
if (preg_match('/^label_\\d+$/', $value) && $level_labels_style != 'none') {
$output .= ' class="hierarchical-select-level-label-' . $level_labels_style . '"';
}
if ($value == $hierarchy->lineage[$depth]) {
$output .= ' selected="selected" value="' . check_plain($value) . '"><strong>' . check_plain($label) . '</strong></option>';
}
else {
$output .= ' value="' . check_plain($value) . '">' . check_plain($label) . '</option>';
}
}
$output .= '</select>';
}
return $output;
}