You are here

function _quicktabs_construct_link_options in Quick Tabs 6.3

Same name and namespace in other branches
  1. 6.2 quicktabs.module \_quicktabs_construct_link_options()
  2. 7.2 quicktabs.module \_quicktabs_construct_link_options()

Helper function to construct link options for tab links.

1 call to _quicktabs_construct_link_options()
theme_quicktabs_tabs in ./quicktabs.module
Theme function for output of the tabs. Use this to ADD extra classes. The general structure 'ul.quicktabs_tabs li a' needs to be maintained for the jQuery to work.

File

./quicktabs.module, line 394

Code

function _quicktabs_construct_link_options($quicktabs, $tabkey) {
  $qt_name = $quicktabs['machine_name'];
  $ajax = $quicktabs['ajax'];
  $tab = $quicktabs['tabs'][$tabkey];
  $id = 'quicktabs-tab-' . implode('-', array(
    $qt_name,
    $tabkey,
  ));

  // Need to construct the correct query for the tab links.
  $query = $_GET;
  unset($query['quicktabs_' . $qt_name]);
  unset($query['q']);
  unset($query['page']);
  $query['quicktabs_' . $qt_name] = $tabkey;
  if ($ajax) {
    $class = 'qt_ajax_tab';
  }
  else {
    $class = 'qt_tab';
  }
  $link_options = array(
    'attributes' => array(
      'id' => $id,
      'class' => $class,
    ),
    'query' => $query,
    'fragment' => 'quicktabs-' . $qt_name,
  );
  return $link_options;
}