You are here

function theme_bootstrap_tabs_tabset in Bootstrap Quick Tabs 7

Theme function to output tablinks for Foundation style tabs.

1 theme call to theme_bootstrap_tabs_tabset()
BootstrapQuickTabs::render in ./BootstrapQuickTabs.inc
Build render array.

File

./bootstrap_quicktabs.module, line 56
Provides Bootstrap's tab styles to the Quicktabs module. Adapted from the re_quicktabs_foundation module.

Code

function theme_bootstrap_tabs_tabset($settings) {

  // Empty set of tabs:
  $variables = array(
    'items' => array(),
    'title' => '',
    'type' => 'ul',
    'attributes' => array(),
  );
  foreach (element_children($settings['tabset']['tablinks']) as $key) {
    if (is_array($settings['tabset']['tablinks'])) {
      $tab = array();
      if ($key == $settings['tabset']['#options']['active']) {
        $tab['class'] = array(
          'active',
        );
      }
      $tab['data'] = drupal_render($settings['tabset']['tablinks'][$key]);
      $tab['role'] = 'presentation';
      $variables['items'][] = $tab;
    }
  }
  $classes = array(
    'nav',
    'nav-' . $settings['tabset']['#options']['style'],
  );
  if ($settings['tabset']['#options']['position'] == 'justified' || $settings['tabset']['#options']['position'] == 'stacked') {
    $classes[] = ' nav-' . $settings['tabset']['#options']['position'];
  }
  $variables['attributes']['class'] = $classes;
  return theme('item_list', $variables);
}