当前位置: 首页>>代码示例>>PHP>>正文


PHP TabController::getAllPortalTabs方法代码示例

本文整理汇总了PHP中TabController::getAllPortalTabs方法的典型用法代码示例。如果您正苦于以下问题:PHP TabController::getAllPortalTabs方法的具体用法?PHP TabController::getAllPortalTabs怎么用?PHP TabController::getAllPortalTabs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TabController的用法示例。


在下文中一共展示了TabController::getAllPortalTabs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: display

 /**
  * This function loads portal config vars from db and sets them for the view
  * @see SugarView::display() for more info
  */
 function display()
 {
     $portalFields = array('appStatus' => 'offline', 'logoURL' => '', 'maxQueryResult' => '20', 'maxSearchQueryResult' => '5', 'defaultUser' => '');
     $userList = get_user_array();
     $userList[''] = '';
     require_once "modules/MySettings/TabController.php";
     $controller = new TabController();
     $disabledModulesFlag = false;
     $disabledModules = array_diff($controller->getAllPortalTabs(), $controller->getPortalTabs());
     if (!empty($disabledModules)) {
         $disabledModulesFlag = true;
         array_walk($disabledModules, function (&$item) {
             $item = translate($item);
         });
     }
     $admin = Administration::getSettings();
     $portalConfig = $admin->getConfigForModule('portal', 'support', true);
     $portalConfig['appStatus'] = !empty($portalConfig['on']) ? 'online' : 'offline';
     $smarty = new Sugar_Smarty();
     $smarty->assign('disabledDisplayModulesList', $disabledModules);
     $smarty->assign('disabledDisplayModules', $disabledModulesFlag);
     foreach ($portalFields as $fieldName => $fieldDefault) {
         if (isset($portalConfig[$fieldName])) {
             $smarty->assign($fieldName, html_entity_decode($portalConfig[$fieldName]));
         } else {
             $smarty->assign($fieldName, $fieldDefault);
         }
     }
     $smarty->assign('userList', $userList);
     $smarty->assign('welcome', $GLOBALS['mod_strings']['LBL_SYNCP_WELCOME']);
     $smarty->assign('mod', $GLOBALS['mod_strings']);
     $smarty->assign('siteURL', $GLOBALS['sugar_config']['site_url']);
     if (isset($_REQUEST['label'])) {
         $smarty->assign('label', $_REQUEST['label']);
     }
     $options = !empty($GLOBALS['system_config']->settings['system_portal_url']) ? $GLOBALS['system_config']->settings['system_portal_url'] : 'https://';
     $smarty->assign('options', $options);
     $ajax = new AjaxCompose();
     $ajax->addCrumb(translate('LBL_SUGARPORTAL', 'ModuleBuilder'), 'ModuleBuilder.main("sugarportal")');
     $ajax->addCrumb(ucwords(translate('LBL_PORTAL_CONFIGURE')), '');
     $ajax->addSection('center', translate('LBL_SUGARPORTAL', 'ModuleBuilder'), $smarty->fetch('modules/ModuleBuilder/tpls/portalconfig.tpl'));
     $GLOBALS['log']->debug($smarty->fetch('modules/ModuleBuilder/tpls/portalconfig.tpl'));
     echo $ajax->getJavascript();
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:48,代码来源:view.portalconfig.php

示例2: action_savetabs

 public function action_savetabs()
 {
     require_once 'include/SubPanel/SubPanelDefinitions.php';
     require_once 'modules/MySettings/TabController.php';
     global $current_user, $app_strings, $modInvisList;
     if (!is_admin($current_user)) {
         sugar_die($app_strings['ERR_NOT_ADMIN']);
     }
     // handle the tabs listing
     $toDecode = html_entity_decode($_REQUEST['enabled_tabs'], ENT_QUOTES);
     $enabled_tabs = json_decode($toDecode);
     // Add Home back in so that it always appears first in Sugar 7
     array_unshift($enabled_tabs, 'Home');
     $tabs = new TabController();
     $tabs->set_system_tabs($enabled_tabs);
     $tabs->setPortalTabs(array_values(array_intersect($enabled_tabs, $tabs->getAllPortalTabs())));
     $tabs->set_users_can_edit(isset($_REQUEST['user_edit_tabs']) && $_REQUEST['user_edit_tabs'] == 1);
     // handle the subpanels
     if (isset($_REQUEST['disabled_tabs'])) {
         $disabledTabs = json_decode(html_entity_decode($_REQUEST['disabled_tabs'], ENT_QUOTES));
         $disabledTabsKeyArray = TabController::get_key_array($disabledTabs);
         //Never show Project subpanels if Project module is hidden
         if (!in_array('project', $disabledTabsKeyArray) && in_array('Project', $modInvisList)) {
             $disabledTabsKeyArray[] = 'project';
         }
         // if RLI is hidden, always hide the RLI subpanel.
         if (!in_array('revenuelineitems', $disabledTabsKeyArray) && in_array('RevenueLineItems', $modInvisList)) {
             $disabledTabsKeyArray[] = 'revenuelineitems';
         }
         SubPanelDefinitions::set_hidden_subpanels($disabledTabsKeyArray);
     }
     // Only rebuild the relevent metadata sections.
     MetaDataManager::refreshSectionCache(MetaDataManager::MM_MODULESINFO, array('base'));
     MetaDataManager::refreshSectionCache(MetaDataManager::MM_HIDDENSUBPANELS, array('base'));
     if (!headers_sent()) {
         header("Location: index.php?module=Administration&action=ConfigureTabs");
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:38,代码来源:controller.php


注:本文中的TabController::getAllPortalTabs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。