function tpl_render_menu() { global $user, $user_impersonator, $lang, $template_result; // $config, //$template_name = IN_ADMIN === true ? 'admin/menu' : 'menu'; //$template = gettemplate($template_name, true); $template = gettemplate('menu', true); $template->assign_recursive($template_result); player_load_option($user, array(PLAYER_OPTION_MENU_HIDE_SHOW_BUTTON, PLAYER_OPTION_MENU_SHOW_ON_BUTTON, PLAYER_OPTION_MENU_HIDE_ON_BUTTON, PLAYER_OPTION_MENU_HIDE_ON_LEAVE, PLAYER_OPTION_MENU_UNPIN_ABSOLUTE, PLAYER_OPTION_MENU_ITEMS_AS_BUTTONS)); $template->assign_vars(array('USER_AUTHLEVEL' => $user['authlevel'], 'USER_AUTHLEVEL_NAME' => $lang['user_level'][$user['authlevel']], 'USER_IMPERSONATOR' => is_array($user_impersonator), 'PAYMENT' => sn_module_get_active_count('payment'), 'MENU_START_HIDE' => !empty($_COOKIE[SN_COOKIE . '_menu_hidden']), 'PLAYER_OPTION_MENU_HIDE_SHOW_BUTTON' => isset($template_result['MENU_CUSTOMIZE']) ? $user['player_options'][PLAYER_OPTION_MENU_HIDE_SHOW_BUTTON] : 0, 'PLAYER_OPTION_MENU_SHOW_ON_BUTTON' => $template_result['MENU_CUSTOMIZE'] ? $user['player_options'][PLAYER_OPTION_MENU_SHOW_ON_BUTTON] : 0, 'PLAYER_OPTION_MENU_HIDE_ON_BUTTON' => $template_result['MENU_CUSTOMIZE'] ? $user['player_options'][PLAYER_OPTION_MENU_HIDE_ON_BUTTON] : 0, 'PLAYER_OPTION_MENU_HIDE_ON_LEAVE' => $template_result['MENU_CUSTOMIZE'] ? $user['player_options'][PLAYER_OPTION_MENU_HIDE_ON_LEAVE] : 0, 'PLAYER_OPTION_MENU_UNPIN_ABSOLUTE' => $template_result['MENU_CUSTOMIZE'] ? $user['player_options'][PLAYER_OPTION_MENU_UNPIN_ABSOLUTE] : 0, 'PLAYER_OPTION_MENU_ITEMS_AS_BUTTONS' => $template_result['MENU_CUSTOMIZE'] ? $user['player_options'][PLAYER_OPTION_MENU_ITEMS_AS_BUTTONS] : 0)); if (IN_ADMIN === true && $user['authlevel'] > 0) { //global $sn_version_check_class; //$template->assign_vars(array( // 'CHECK_DATE' => $config->server_updater_check_last ? date(FMT_DATE, $config->server_updater_check_last) : 0, // 'CHECK_RESULT' => $lang['adm_opt_ver_response_short'][$config->server_updater_check_result], // 'CHECK_CLASS' => $sn_version_check_class[$config->server_updater_check_result], //)); //$template = gettemplate('menu', $template); global $sn_menu_admin_extra, $sn_menu_admin; lng_include('admin'); tpl_menu_merge_extra($sn_menu_admin, $sn_menu_admin_extra); tpl_menu_assign_to_template($sn_menu_admin, $template); } else { global $sn_menu, $sn_menu_extra; tpl_menu_merge_extra($sn_menu, $sn_menu_extra); tpl_menu_assign_to_template($sn_menu, $template); } return $template; }
/** * @return template */ function tpl_render_menu() { global $user, $lang, $template_result, $sn_menu_admin_extra, $sn_menu_admin, $sn_menu, $sn_menu_extra; lng_include('admin'); $template = gettemplate('menu', true); $template->assign_recursive($template_result); $template->assign_vars(array('USER_AUTHLEVEL' => $user['authlevel'], 'USER_AUTHLEVEL_NAME' => $lang['user_level'][$user['authlevel']], 'PAYMENT' => sn_module_get_active_count('payment'), 'MENU_START_HIDE' => !empty($_COOKIE[SN_COOKIE . '_menu_hidden']) || defined('SN_GOOGLE'))); if (isset($template_result['MENU_CUSTOMIZE'])) { $template->assign_vars(array('PLAYER_OPTION_MENU_SHOW_ON_BUTTON' => classSupernova::$user_options[PLAYER_OPTION_MENU_SHOW_ON_BUTTON], 'PLAYER_OPTION_MENU_HIDE_ON_BUTTON' => classSupernova::$user_options[PLAYER_OPTION_MENU_HIDE_ON_BUTTON], 'PLAYER_OPTION_MENU_HIDE_ON_LEAVE' => classSupernova::$user_options[PLAYER_OPTION_MENU_HIDE_ON_LEAVE], 'PLAYER_OPTION_MENU_UNPIN_ABSOLUTE' => classSupernova::$user_options[PLAYER_OPTION_MENU_UNPIN_ABSOLUTE], 'PLAYER_OPTION_MENU_ITEMS_AS_BUTTONS' => classSupernova::$user_options[PLAYER_OPTION_MENU_ITEMS_AS_BUTTONS], 'PLAYER_OPTION_MENU_WHITE_TEXT' => classSupernova::$user_options[PLAYER_OPTION_MENU_WHITE_TEXT], 'PLAYER_OPTION_MENU_OLD' => classSupernova::$user_options[PLAYER_OPTION_MENU_OLD], 'PLAYER_OPTION_MENU_HIDE_SHOW_BUTTON' => empty($_COOKIE[SN_COOKIE . '_menu_hidden']) && !defined('SN_GOOGLE') ? classSupernova::$user_options[PLAYER_OPTION_MENU_HIDE_SHOW_BUTTON] : 1)); } if (defined('IN_ADMIN') && IN_ADMIN === true && !empty($user['authlevel']) && $user['authlevel'] > 0) { tpl_menu_merge_extra($sn_menu_admin, $sn_menu_admin_extra); tpl_menu_assign_to_template($sn_menu_admin, $template); } else { tpl_menu_merge_extra($sn_menu, $sn_menu_extra); tpl_menu_assign_to_template($sn_menu, $template); } return $template; }