/** * Renders the navigation tabs & links. */ protected function getNavigation() { global $vbulletin; $root = ''; $root_tab = $roots['vbtab_forum']; $tabs = build_navigation_menudata(); $roots = get_navigation_roots(build_navigation_list()); $request_tab = intval($_REQUEST['tabid']); $script_tab = get_navigation_tab_script(); $hook_tabid = $tabid = 0; ($hook = vBulletinHook::fetch_hook('set_navigation_tab_vbview')) ? eval($hook) : false; if ($root) { $tabid = $roots[$root]; } /* Tab setting logic, using above choices. Preference order is (low > high) root > script > hookroot > hookid > request */ $current_tab = $script_tab ? $script_tab : $root_tab; $current_tab = $tabid ? $tabid : $current_tab; $current_tab = $hook_tabid ? $hook_tabid : $current_tab; $current_tab = $request_tab ? $request_tab : $current_tab; $tabid = set_navigation_tab($current_tab, $tabs); $view = new vB_View('navbar_tabs'); $view->tabs = $tabs; $view->selected = $tabid; return $view->render(); }
/** * Renders the navbar tabs, menus & links. * * @param int tabid * * @return string Navbar tabs HTML */ function render_navigation() { $root = ''; $root_tab = $roots['vbtab_forum']; $tabs = build_navigation_menudata(); $roots = get_navigation_roots(build_navigation_list()); $request_tab = intval($_REQUEST['tabid']); $script_tab = get_navigation_tab_script(); $hook_tabid = $tabid = 0; ($hook = vBulletinHook::fetch_hook('set_navigation_tab_main')) ? eval($hook) : false; if ($root) { $tabid = $roots[$root]; } /* Tab setting logic, using above choices. Preference order is (low > high) root > script > hookroot > hookid > request */ $current_tab = $script_tab ? $script_tab : $root_tab; $current_tab = $tabid ? $tabid : $current_tab; $current_tab = $hook_tabid ? $hook_tabid : $current_tab; $current_tab = $request_tab ? $request_tab : $current_tab; $tabid = set_navigation_tab($current_tab, $tabs); $templater = vB_Template::create('navbar_tabs'); $templater->register('tabs', $tabs); $templater->register('selected', $tabid); return $templater->render(); }