function theme_webform_component_select in Webform 7.3
Same name and namespace in other branches
- 6.3 includes/webform.components.inc \theme_webform_component_select()
- 7.4 includes/webform.components.inc \theme_webform_component_select()
Theme the contents of a Webform component select element.
File
- includes/
webform.components.inc, line 1029 - Webform module component handling.
Code
function theme_webform_component_select($variables) {
$element = $variables['element'];
$rows = array();
$header = array();
if (!isset($element['#all_checkbox']) || $element['#all_checkbox']) {
$header = array(
array(
'class' => array(
'select-all',
),
'data' => ' ' . t('Include all components'),
),
);
}
foreach (element_children($element) as $key) {
$rows[] = array(
theme('indentation', array(
'size' => $element[$key]['#indent'],
)) . drupal_render($element[$key]),
);
}
$element['#type'] = 'fieldset';
$element['#value'] = NULL;
$element['#attributes']['class'] = array(
'webform-component-select-table',
);
if (!isset($element['#collapsible']) || $element['#collapsible']) {
$element['#attributes']['class'][] = 'collapsible';
}
if (!isset($element['#collapsed']) || $element['#collapsed']) {
$element['#attributes']['class'][] = 'collapsed';
}
if (empty($rows)) {
$element['#children'] = t('No available components.');
}
else {
$element['#children'] = '<div class="webform-component-select-wrapper">' . theme('table', array(
'header' => $header,
'rows' => $rows,
)) . '</div>';
}
return theme('fieldset', array(
'element' => $element,
));
}