You are here

function theme_ds_tabs in Display Suite 6

Same name and namespace in other branches
  1. 6.3 theme/theme.inc \theme_ds_tabs()
  2. 6.2 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');

1 theme call to theme_ds_tabs()
ds_render_content in ./ds.module
Render content for an object.

File

theme/theme.inc, line 190
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;
}