Same name and namespace in other branches
  1. 8.x-1.x src/QuickSet.php \Drupal\quicktabs\QuickSet::getActiveTab() 1 commentaire

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 dans ./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.

Fichier

./quicktabs.classes.inc, line 257

Classe

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;
}