function theme_hierarchical_select_common_config_form_level_labels in Hierarchical Select 7.3
Same name and namespace in other branches
- 5.3 includes/common.inc \theme_hierarchical_select_common_config_form_level_labels()
- 6.3 includes/theme.inc \theme_hierarchical_select_common_config_form_level_labels()
@todo Please document this function.
See also
File
- includes/
theme.inc, line 228 - All theme functions for the Hierarchical Select module.
Code
function theme_hierarchical_select_common_config_form_level_labels($variables) {
$form = $variables['form'];
// Recover the stored strings.
$strings = $form['#strings'];
$output = '';
$header = array(
t('Level'),
t('Label'),
);
$rows = array();
$output .= drupal_render($form['status']);
$output .= '<div class="level-labels-settings">';
if (isset($form['labels']) && count(element_children($form['labels']))) {
foreach (element_children($form['labels']) as $depth) {
$row = array();
$row[]['data'] = $depth == 0 ? t('Root level') : t('Sublevel !depth', array(
'!depth' => $depth,
));
$row[]['data'] = drupal_render($form['labels'][$depth]);
$rows[] = $row;
}
// Render the table.
$output .= theme('table', array(
'header' => $header,
'rows' => $rows,
'attributes' => array(
'style' => 'width: auto;',
),
));
}
else {
// No levels exist yet in the hierarchy!
$output .= '<p><strong>';
$output .= t('There are no levels yet in this !hierarchy!', array(
'!hierarchy' => $strings['hierarchy'],
));
$output .= '</strong></p>';
}
$output .= '</div>';
// Render the remaining form items.
$output .= drupal_render_children($form);
return $output;
}