You are here

function theme_tabset in Tabs (jQuery UI tabs) 6

Return rendered tabset.

@themable

File

./tabs.theme.inc, line 13
Theme functions for tabs.

Code

function theme_tabset($element) {
  $output = '<div id="tabs-' . $element['#tabset_name'] . '"' . drupal_attributes($element['#attributes']) . '>';
  $output .= '<div class="description">' . $element['#description'] . '</div>';
  $output .= '<ul class="clear-block">';
  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 .= '<li' . drupal_attributes($element[$key]['#attributes']) . '><a href="' . $element[$key]['#url'] . '"><span class="tab">' . $element[$key]['#title'] . '</span></a></li>';
      }
    }
  }
  $output .= '</ul>';
  if (isset($element['#children'])) {
    $output .= $element['#children'];
  }
  $output .= '</div>';
  return $output;
}