You are here

function theme_quicktabs_views_render in Quick Tabs 6.3

Same name and namespace in other branches
  1. 6.2 includes/quicktabs.views.inc \theme_quicktabs_views_render()
1 theme call to theme_quicktabs_views_render()
quicktabs_style_plugin::render in includes/quicktabs_style_plugin.inc

File

includes/quicktabs.views.inc, line 30
Add Views module hooks to Quicktabs.

Code

function theme_quicktabs_views_render($view, $tabs, $machine_name) {
  foreach ($tabs as $index => $tab) {
    if (is_array($tab['content'])) {
      $text = '';
      foreach ($tabs[$index]['content'] as $content) {
        $text .= '<div class="quicktabs-views-group">' . $content . '</div>';
      }
      $tabs[$index]['text'] = $text;
    }
    else {
      $tabs[$index]['text'] = $tabs[$index]['content'];
    }
    $tabs[$index]['type'] = 'freetext';
    unset($tabs[$index]['content']);
  }
  $quicktabs = array(
    'machine_name' => $machine_name,
    'ajax' => '0',
    // TODO: Support AJAX, set this to $view->use_ajax.
    'hide_empty_tabs' => '0',
    'default_tab' => '0',
    'style' => $view->style_options['tab_style'],
    'tabs' => $tabs,
  );
  return theme('quicktabs', $quicktabs);
}