You are here

function _quicktabs_get_active_tab in Quick Tabs 7.2

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

Helper function to determine active tab from the url.

1 call to _quicktabs_get_active_tab()
quicktabs_render in ./quicktabs.module
Render quicktabs.

File

./quicktabs.module, line 628

Code

function _quicktabs_get_active_tab($quicktab) {
  $active_tab = isset($quicktab->default_tab) ? $quicktab->default_tab : key($quicktab->tabs);
  $active_tab = isset($_GET['quicktabs_' . $quicktab->machine_name]) ? $_GET['quicktabs_' . $quicktab->machine_name] : $active_tab;
  if (isset($active_tab) && isset($quicktab->tabs[$active_tab])) {
    return $active_tab;
  }
  return NULL;
}