You are here

function theme_ds_tabs in Display Suite 6.2

Same name and namespace in other branches
  1. 6.3 theme/theme.inc \theme_ds_tabs()
  2. 6 theme/theme.inc \theme_ds_tabs()

Theme tabs. This is based on the theme_tabset() function from the tabs module. We use our own theming function because otherwhise we need to loop through our fields to build the right array before we an send it to theme('tabset');

Parameters

$field:

Return value

string

File

theme/theme.inc, line 560
Theming functions for ds.

Code

function theme_ds_tabs($field) {
  tabs_load();
  static $i = 1;
  $fields = $field['fields'];
  ksort($fields);
  $tab_navigation = variable_get('tabs_navigation', 0) ? ' tabs-navigation' : '';
  $tabs_content = '';
  $output = '<div id="tabs-' . $field['name'] . '" class="drupal-tabs js-hide' . $tab_navigation . '" style="display:block;">';
  $tabs = '<ul class="clear-block ui-tabs-nav tabs">';
  foreach ($fields as $weight => $data) {
    $tabs .= '<li class="tabset-tab-' . $i . '">
    <a href="#tabset-tab-' . $i . '"><span class="tab">' . $data['title'] . '</span></a></li>';
    $tabs_content .= '<div id="tabset-tab-' . $i . '" class="tabs-' . $field['name'] . ' ui-tabs-panel ' . $data['class'] . '">' . $data['content'] . '</div>';
    $i++;
  }
  $tabs .= '</ul>';
  $output .= $tabs;
  $output .= $tabs_content;
  $output .= '</div>';
  return $output;
}