function query_module_access_list(&$user) { require_once 'modules/MySettings/TabController.php'; $controller = new TabController(); $tabArray = $controller->get_tabs($user); return $tabArray[0]; }
$controller = new TabController(); echo "<script>SUGAR.tabChooser.freezeOptions('display_tabs', 'hide_tabs', 'Home');</script>"; if (is_admin($current_user)) { $chooser->display_hide_tabs = true; $chooser->display_third_tabs = true; $chooser->args['third_name'] = 'remove_tabs'; $chooser->args['third_label'] = $mod_strings['LBL_REMOVED_TABS']; //$xtpl->parse("main.tabchooser"); } if (is_admin($current_user) || $controller->get_users_can_edit()) { $chooser->display_hide_tabs = true; } else { $chooser->display_hide_tabs = false; } $chooser->args['id'] = 'edit_tabs'; $chooser->args['values_array'] = $controller->get_tabs($focus); foreach ($chooser->args['values_array'][0] as $key => $value) { $chooser->args['values_array'][0][$key] = $app_list_strings['moduleList'][$key]; } foreach ($chooser->args['values_array'][1] as $key => $value) { $chooser->args['values_array'][1][$key] = $app_list_strings['moduleList'][$key]; } foreach ($chooser->args['values_array'][2] as $key => $value) { $chooser->args['values_array'][2][$key] = $app_list_strings['moduleList'][$key]; } $chooser->args['left_name'] = 'display_tabs'; $chooser->args['right_name'] = 'hide_tabs'; $chooser->args['left_label'] = $mod_strings['LBL_DISPLAY_TABS']; $chooser->args['right_label'] = $mod_strings['LBL_HIDE_TABS']; $chooser->args['title'] = $mod_strings['LBL_EDIT_TABS']; $xtpl->assign('TAB_CHOOSER', $chooser->display());
/** * Gets display module list per user defined tabs * * @return array The list of module names */ public function getUserModuleList() { // Loading a standard module list require_once "modules/MySettings/TabController.php"; $controller = new TabController(); $tabs = $controller->get_tabs($this->getCurrentUser()); $moduleList = array_keys($tabs[0]); $moduleList = $this->addHomeToModuleList($moduleList); return $moduleList; }
protected function setupAdvancedTabNavSettings() { global $app_list_strings; /* Module Tab Chooser */ require_once 'include/templates/TemplateGroupChooser.php'; require_once 'modules/MySettings/TabController.php'; $chooser = new TemplateGroupChooser(); $controller = new TabController(); if ($this->is_current_admin || $controller->get_users_can_edit()) { $chooser->display_hide_tabs = true; } else { $chooser->display_hide_tabs = false; } $chooser->args['id'] = 'edit_tabs'; $chooser->args['values_array'] = $controller->get_tabs($this->bean); //Remove 'Home' module from tab configuration UI (we add it back in at top of display tabs on save) if (isset($chooser->args['values_array'][0]['Home'])) { unset($chooser->args['values_array'][0]['Home']); } if (isset($chooser->args['values_array'][1]['Home'])) { unset($chooser->args['values_array'][1]['Home']); } if (isset($chooser->args['values_array'][2]['Home'])) { unset($chooser->args['values_array'][2]['Home']); } foreach ($chooser->args['values_array'][0] as $key => $value) { $chooser->args['values_array'][0][$key] = $app_list_strings['moduleList'][$key]; } foreach ($chooser->args['values_array'][1] as $key => $value) { $chooser->args['values_array'][1][$key] = $app_list_strings['moduleList'][$key]; } foreach ($chooser->args['values_array'][2] as $key => $value) { $chooser->args['values_array'][2][$key] = $app_list_strings['moduleList'][$key]; } $chooser->args['left_name'] = 'display_tabs'; $chooser->args['right_name'] = 'hide_tabs'; $chooser->args['left_label'] = translate('LBL_DISPLAY_TABS', 'Users'); $chooser->args['right_label'] = translate('LBL_HIDE_TABS', 'Users'); require_once 'include/SugarSmarty/plugins/function.sugar_help.php'; $chooser->args['title'] = translate('LBL_EDIT_TABS', 'Users') . smarty_function_sugar_help(array("text" => translate('LBL_CHOOSE_WHICH', 'Users')), $ss); $this->ss->assign('TAB_CHOOSER', $chooser->display()); $this->ss->assign('CHOOSER_SCRIPT', 'set_chooser();'); $this->ss->assign('CHOOSE_WHICH', translate('LBL_CHOOSE_WHICH', 'Users')); }
protected function setupAdvancedTabNavSettings() { global $app_list_strings; // Grouped tabs? $useGroupTabs = $this->bean->getPreference('navigation_paradigm'); if (!isset($useGroupTabs)) { if (!isset($GLOBALS['sugar_config']['default_navigation_paradigm'])) { $GLOBALS['sugar_config']['default_navigation_paradigm'] = 'gm'; } $useGroupTabs = $GLOBALS['sugar_config']['default_navigation_paradigm']; } $this->ss->assign("USE_GROUP_TABS", $useGroupTabs == 'gm' ? 'checked' : ''); $user_subpanel_tabs = $this->bean->getPreference('subpanel_tabs'); if (isset($user_subpanel_tabs)) { $this->ss->assign("SUBPANEL_TABS", $user_subpanel_tabs ? 'checked' : ''); } else { $this->ss->assign("SUBPANEL_TABS", $GLOBALS['sugar_config']['default_subpanel_tabs'] ? 'checked' : ''); } /* Module Tab Chooser */ require_once 'include/templates/TemplateGroupChooser.php'; require_once 'modules/MySettings/TabController.php'; $chooser = new TemplateGroupChooser(); $controller = new TabController(); if ($this->is_current_admin || $controller->get_users_can_edit()) { $chooser->display_hide_tabs = true; } else { $chooser->display_hide_tabs = false; } $chooser->args['id'] = 'edit_tabs'; $chooser->args['values_array'] = $controller->get_tabs($this->bean); foreach ($chooser->args['values_array'][0] as $key => $value) { $chooser->args['values_array'][0][$key] = $app_list_strings['moduleList'][$key]; } foreach ($chooser->args['values_array'][1] as $key => $value) { $chooser->args['values_array'][1][$key] = $app_list_strings['moduleList'][$key]; } foreach ($chooser->args['values_array'][2] as $key => $value) { $chooser->args['values_array'][2][$key] = $app_list_strings['moduleList'][$key]; } $chooser->args['left_name'] = 'display_tabs'; $chooser->args['right_name'] = 'hide_tabs'; $chooser->args['left_label'] = translate('LBL_DISPLAY_TABS', 'Users'); $chooser->args['right_label'] = translate('LBL_HIDE_TABS', 'Users'); require_once 'include/Smarty/plugins/function.sugar_help.php'; $chooser->args['title'] = translate('LBL_EDIT_TABS', 'Users') . smarty_function_sugar_help(array("text" => translate('LBL_CHOOSE_WHICH', 'Users')), $ss); $this->ss->assign('TAB_CHOOSER', $chooser->display()); $this->ss->assign('CHOOSER_SCRIPT', 'set_chooser();'); $this->ss->assign('CHOOSE_WHICH', translate('LBL_CHOOSE_WHICH', 'Users')); }
protected function setupAdvancedTabNavSettings() { global $app_list_strings; // Grouped tabs? $useGroupTabs = $this->bean->getPreference('navigation_paradigm'); if (!isset($useGroupTabs)) { if (!isset($GLOBALS['sugar_config']['default_navigation_paradigm'])) { $GLOBALS['sugar_config']['default_navigation_paradigm'] = 'gm'; } $useGroupTabs = $GLOBALS['sugar_config']['default_navigation_paradigm']; } $this->ss->assign("USE_GROUP_TABS", $useGroupTabs == 'gm' ? 'checked' : ''); $user_max_tabs = $this->bean->getPreference('max_tabs'); if (isset($user_max_tabs) && $user_max_tabs > 0) { $this->ss->assign("MAX_TAB", $user_max_tabs); } elseif (SugarThemeRegistry::current()->maxTabs > 0) { $this->ss->assign("MAX_TAB", SugarThemeRegistry::current()->maxTabs); } else { $this->ss->assign("MAX_TAB", $GLOBALS['sugar_config']['default_max_tabs']); } $this->ss->assign("MAX_TAB_OPTIONS", range(1, !empty($GLOBALS['sugar_config']['default_max_tabs']) && $GLOBALS['sugar_config']['default_max_tabs'] > 10 ? $GLOBALS['sugar_config']['default_max_tabs'] : 10)); $user_subpanel_tabs = $this->bean->getPreference('subpanel_tabs'); if (isset($user_subpanel_tabs)) { $this->ss->assign("SUBPANEL_TABS", $user_subpanel_tabs ? 'checked' : ''); } else { $this->ss->assign("SUBPANEL_TABS", $GLOBALS['sugar_config']['default_subpanel_tabs'] ? 'checked' : ''); } /* Module Tab Chooser */ require_once 'include/templates/TemplateGroupChooser.php'; require_once 'modules/MySettings/TabController.php'; $chooser = new TemplateGroupChooser(); $controller = new TabController(); if ($this->is_current_admin || $controller->get_users_can_edit()) { $chooser->display_hide_tabs = true; } else { $chooser->display_hide_tabs = false; } $chooser->args['id'] = 'edit_tabs'; $chooser->args['values_array'] = $controller->get_tabs($this->bean); foreach ($chooser->args['values_array'][0] as $key => $value) { $chooser->args['values_array'][0][$key] = $app_list_strings['moduleList'][$key]; } foreach ($chooser->args['values_array'][1] as $key => $value) { $chooser->args['values_array'][1][$key] = $app_list_strings['moduleList'][$key]; } foreach ($chooser->args['values_array'][2] as $key => $value) { $chooser->args['values_array'][2][$key] = $app_list_strings['moduleList'][$key]; } $chooser->args['left_name'] = 'display_tabs'; $chooser->args['right_name'] = 'hide_tabs'; $chooser->args['left_label'] = translate('LBL_DISPLAY_TABS', 'Users'); $chooser->args['right_label'] = translate('LBL_HIDE_TABS', 'Users'); $chooser->args['title'] = translate('LBL_EDIT_TABS', 'Users') . ' <!--not_in_theme!--><img border="0" src="themes/default/images/helpInline.gif" onmouseover="return overlib(\'Choose which tabs are displayed.\', FGCLASS, \'olFgClass\', CGCLASS, \'olCgClass\', BGCLASS, \'olBgClass\', TEXTFONTCLASS, \'olFontClass\', CAPTIONFONTCLASS, \'olCapFontClass\', CLOSEFONTCLASS, \'olCloseFontClass\', WIDTH, -1, NOFOLLOW, \'ol_nofollow\' );" onmouseout="return nd();"/>'; $this->ss->assign('TAB_CHOOSER', $chooser->display()); $this->ss->assign('CHOOSER_SCRIPT', 'set_chooser();'); $this->ss->assign('CHOOSE_WHICH', translate('LBL_CHOOSE_WHICH', 'Users')); }
} if (isset($_POST['user_theme'])) { $focus->setPreference('user_theme', $_POST['user_theme'], 0, 'global'); $_SESSION['authenticated_user_theme'] = $_POST['user_theme']; } if (isset($_POST['user_module_favicon'])) { $focus->setPreference('module_favicon', $_POST['user_module_favicon'], 0, 'global'); } else { $focus->setPreference('module_favicon', '', 0, 'global'); } // BR-237 Force a reauth for user metadata changes so that these changes // are picked up by clients immediately $refreshMetadata = false; $tabs = new TabController(); // Get the current display tabs to see if any of them are different $curTabs = $tabs->get_tabs($current_user); $curDisplay = array_keys($curTabs[0]); if (isset($DISPLAY_ARR['display_tabs'])) { //Put home back in. It needs to be first display module in Sugar 7 array_unshift($DISPLAY_ARR['display_tabs'], 'Home'); // Order is relevant on display modules, use identical (===) comparison // If DISPLAY_ARR changed, so did HIDE_ARR // Save tabs only if there are changes if (array_values($DISPLAY_ARR['display_tabs']) !== array_values($curDisplay)) { $refreshMetadata = true; $tabs->set_user_tabs($DISPLAY_ARR['display_tabs'], $focus, 'display'); } } if (isset($HIDE_ARR['hide_tabs'])) { $tabs->set_user_tabs($HIDE_ARR['hide_tabs'], $focus, 'hide'); } else {