You are here

public function QuickSet::getActiveTab in Quick Tabs 7.3

Returns the active tab for a given Quicktabs instance. This could be coming from the URL or just from the settings for this instance. If neither, it defaults to 0.

1 call to QuickSet::getActiveTab()
QuickSet::prepareContents in ./quicktabs.classes.inc
This method does some initial set-up of the tab contents, such as hiding tabs with no content if the hide_empty_tabs option is set. It also makes sure that prerendered contents are never attempted to be loaded via ajax.

File

./quicktabs.classes.inc, line 257

Class

QuickSet
A QuickSet object is an unrendered Quicktabs instance, essentially just a container of content items, as defined by its configuration settings and the array of content items it contains.

Code

public function getActiveTab() {
  $active_tab = isset($this->settings['default_tab']) ? $this->settings['default_tab'] : key($this->contents);
  $active_tab = isset($_GET['qt-' . $this->name]) ? $_GET['qt-' . $this->name] : $active_tab;
  $active_tab = isset($active_tab) && isset($this->contents[$active_tab]) ? $active_tab : QUICKTABS_DELTA_NONE;
  return $active_tab;
}