/** * 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(); }
print_form_header('navigation', 'dodefault'); print_table_header(construct_phrase($vbphrase['nav_default_change'])); construct_hidden_code('oldid', $current['navid']); print_label_row($vbphrase['nav_default_old'], $current['text']); if ($vbulletin->debug) { print_select_row($vbphrase['nav_default_new'], 'newid', $choices, $navelement['navid']); } else { construct_hidden_code('newid', $navelement['navid']); print_label_row($vbphrase['nav_default_new'], $navelement['text'], '', 'top', null, 40); } print_yes_no_row($vbphrase['nav_default_set'], 'confirm', 1); ($hook = vBulletinHook::fetch_hook('navigation_admin_default')) ? eval($hook) : false; print_submit_row($vbphrase['save']); } if ($_REQUEST['do'] == 'dodefault') { $roots = get_navigation_roots($navlist); $vbulletin->input->clean_array_gpc('r', array('oldid' => TYPE_INT, 'newid' => TYPE_INT, 'confirm' => TYPE_INT)); $existing = get_navigation_default($navlist, false); $current = $navlist[$vbulletin->GPC['oldid']]; $proposed = $navlist[$vbulletin->GPC['newid']]; expand_navigation_state($current); expand_navigation_state($proposed); if ($vbulletin->GPC['confirm']) { if ($current['navid'] != $existing) { print_stop_message('invalid_current_default'); } if ($current['navid'] != $vbulletin->GPC['oldid']) { print_stop_message('invalid_current_default'); } if ($proposed['navid'] != $vbulletin->GPC['newid']) { print_stop_message('invalid_new_default');
/** * 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(); }