';
$output .= '
'. $element['#description'] .'
';
$output .= '';
foreach (element_children($element) as $key) {
if (isset($element[$key]['#type']) && $element[$key]['#type'] == 'tabpage') {
// Ensure the tab has content before rendering it.
if (
(isset($element[$key]['#ajax_url']) && !empty($element[$key]['#ajax_url'])) ||
(isset($element[$key]['#content']) && !empty($element[$key]['#content'])) ||
(isset($element[$key]['#children']) && !empty($element[$key]['#children']))
) {
$output .= '- '. $element[$key]['#title'] .'
';
}
}
}
$output .= '
';
if (isset($element['#children'])) {
$output .= $element['#children'];
}
$output .= '';
return $output;
}
/**
* Return rendered content of a tab.
*
* @themable
*/
function theme_tabpage($element) {
$output = '';
// Ensure the tab has content before rendering it.
if (!empty($element['#ajax_url']) || !empty($element['#content']) || !empty($element['#children'])) {
$output .= '';
$output .= '
'. $element['#title'] .'
';
$output .= $element['#content'] . (!empty($element['#children']) ? $element['#children'] : '');
$output .='';
}
return $output;
}