You are here

function _quicktabs_get_active_tab in Quick Tabs 6.3

Same name and namespace in other branches
  1. 6.2 quicktabs.module \_quicktabs_get_active_tab()
  2. 7.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 713

Code

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