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


PHP SugarThemeRegistry::set方法代码示例

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


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

示例1: sugar_cached

if (!class_exists('SugarThemeRegistry')) {
    require_once 'include/SugarTheme/SugarTheme.php';
}
$themeObject = SugarThemeRegistry::current();
$styleJSFilePath = sugar_cached($themeObject->getJSPath() . DIRECTORY_SEPARATOR . 'style-min.js');
if (file_exists($styleJSFilePath)) {
    logThis("Rebuilding style js file: {$styleJSFilePath}");
    unlink($styleJSFilePath);
    SugarThemeRegistry::current()->clearJSCache();
    SugarThemeRegistry::current()->getJS();
}
SugarThemeRegistry::buildRegistry();
SugarThemeRegistry::clearAllCaches();
//Clean out the language files
logThis("Rebuilding language cache");
sugar_cache_reset_full();
LanguageManager::clearLanguageCache();
//pause tracking again so as to not call newly copied tracker code which may contain calls to new methods not currently loaded
$trackerManager = TrackerManager::getInstance();
$trackerManager->pause();
$trackerManager->unsetMonitors();
// re-minify the JS source files
$_REQUEST['root_directory'] = getcwd();
$_REQUEST['js_rebuild_concat'] = 'rebuild';
require_once 'jssource/minify.php';
//The buld registry call above will reload the default theme for what was written to the config file during flav conversions
//which we don't want to happen until after this request as we have already started rendering with a specific theme.
$themeName = (string) $themeObject;
if ($themeName != $GLOBALS['sugar_config']['default_theme']) {
    SugarThemeRegistry::set($themeName);
}
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:31,代码来源:commit.php

示例2: elseif

 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not
 * reasonably feasible for  technical reasons, the Appropriate Legal Notices must
 * display the words  "Powered by SugarCRM" and "Supercharged by SuiteCRM".
 ********************************************************************************/
// Bug 57062 ///////////////////////////////
if (!empty($_REQUEST['spriteNamespace']) && substr_count($_REQUEST['spriteNamespace'], '..') > 0 || !empty($_REQUEST['imageName']) && substr_count($_REQUEST['imageName'], '..') > 0) {
    die;
}
// End Bug 57062 ///////////////////////////////
// try to use the user's theme if we can figure it out
if (isset($_REQUEST['themeName']) && SugarThemeRegistry::current()->name != $_REQUEST['themeName']) {
    SugarThemeRegistry::set($_REQUEST['themeName']);
} elseif (isset($_SESSION['authenticated_user_theme'])) {
    SugarThemeRegistry::set($_SESSION['authenticated_user_theme']);
}
while (substr_count($_REQUEST['imageName'], '..') > 0) {
    $_REQUEST['imageName'] = str_replace('..', '.', $_REQUEST['imageName']);
}
if (isset($_REQUEST['spriteNamespace'])) {
    $filename = "cache/sprites/{$_REQUEST['spriteNamespace']}/{$_REQUEST['imageName']}";
    if (!file_exists($filename)) {
        header($_SERVER["SERVER_PROTOCOL"] . ' 404 Not Found');
        die;
    }
} else {
    $filename = SugarThemeRegistry::current()->getImageURL($_REQUEST['imageName']);
    if (empty($filename)) {
        header($_SERVER["SERVER_PROTOCOL"] . ' 404 Not Found');
        die;
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:31,代码来源:getImage.php

示例3: loadDisplaySettings

 /**
  * Load the themes/images.
  */
 function loadDisplaySettings()
 {
     global $theme;
     $theme = $GLOBALS['current_user']->getBWCTheme();
     SugarThemeRegistry::set($theme);
     require_once 'include/utils/layout_utils.php';
     $GLOBALS['image_path'] = SugarThemeRegistry::current()->getImagePath() . '/';
     if (defined('TEMPLATE_URL')) {
         $GLOBALS['image_path'] = TEMPLATE_URL . '/' . $GLOBALS['image_path'];
     }
     if (isset($GLOBALS['current_user'])) {
         $GLOBALS['gridline'] = (int) ($GLOBALS['current_user']->getPreference('gridline') == 'on');
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:17,代码来源:SugarApplication.php

示例4: loadDisplaySettings

 /**
  * Load the themes/images.
  */
 function loadDisplaySettings()
 {
     global $theme;
     // load the user's default theme
     $theme = $GLOBALS['current_user']->getPreference('user_theme');
     if (is_null($theme)) {
         $theme = $GLOBALS['sugar_config']['default_theme'];
         if (!empty($_SESSION['authenticated_user_theme'])) {
             $theme = $_SESSION['authenticated_user_theme'];
         } else {
             if (!empty($_COOKIE['sugar_user_theme'])) {
                 $theme = $_COOKIE['sugar_user_theme'];
             }
         }
         if (isset($_SESSION['authenticated_user_theme']) && $_SESSION['authenticated_user_theme'] != '') {
             $_SESSION['theme_changed'] = false;
         }
     }
     $available_themes = SugarThemeRegistry::availableThemes();
     if (!isset($available_themes[$theme])) {
         $theme = $GLOBALS['sugar_config']['default_theme'];
     }
     if (!is_null($theme) && !headers_sent()) {
         setcookie('sugar_user_theme', $theme, time() + 31536000, null, null, false, true);
         // expires in a year
     }
     SugarThemeRegistry::set($theme);
     require_once 'include/utils/layout_utils.php';
     $GLOBALS['image_path'] = SugarThemeRegistry::current()->getImagePath() . '/';
     if (defined('TEMPLATE_URL')) {
         $GLOBALS['image_path'] = TEMPLATE_URL . '/' . $GLOBALS['image_path'];
     }
     if (isset($GLOBALS['current_user'])) {
         $GLOBALS['gridline'] = (int) ($GLOBALS['current_user']->getPreference('gridline') == 'on');
         $GLOBALS['current_user']->setPreference('user_theme', $theme, 0, 'global');
     }
 }
开发者ID:switcode,项目名称:SuiteCRM,代码行数:40,代码来源:SugarApplication.php

示例5: testSetCurrentTheme

 public function testSetCurrentTheme()
 {
     SugarThemeRegistry::set($this->_themeName);
     $this->assertInstanceOf('SugarTheme', SugarThemeRegistry::current());
     $this->assertEquals(SugarThemeRegistry::current()->__toString(), $this->_themeName);
 }
开发者ID:thsonvt,项目名称:sugarcrm_dev,代码行数:6,代码来源:SugarThemeRegistryTest.php

示例6: tearDown

 /**
  * Clean up all registered variables and restore $initVars and $systemVars
  * @static
  * @return bool status of tearDown
  */
 public static function tearDown()
 {
     self::init();
     foreach (self::$registeredVars as $varName => $isCalled) {
         if ($isCalled) {
             unset(self::$registeredVars[$varName]);
             if (method_exists(__CLASS__, 'tearDown_' . $varName)) {
                 call_user_func(__CLASS__ . '::tearDown_' . $varName, array());
             } elseif (isset($GLOBALS[$varName])) {
                 unset($GLOBALS[$varName]);
             }
         }
     }
     // Restoring of system variables
     foreach (self::$initVars as $scope => $vars) {
         foreach ($vars as $name => $value) {
             $GLOBALS[$scope][$name] = $value;
         }
     }
     // Restoring of theme
     SugarThemeRegistry::set(self::$systemVars['SugarThemeRegistry']->dirName);
     SugarCache::$isCacheReset = false;
     return true;
 }
开发者ID:sunmo,项目名称:snowlotus,代码行数:29,代码来源:SugarTestHelper.php

示例7: loadDisplaySettings

 /**
  * Load the themes/images.
  */
 function loadDisplaySettings()
 {
     global $theme;
     if (isset($_REQUEST['usertheme'])) {
         $theme = clean_string($_REQUEST['usertheme']);
         if (!isset($_REQUEST['noThemeSave'])) {
             $_SESSION['theme_changed'] = true;
             $_SESSION['authenticated_user_theme'] = $theme;
         }
     } else {
         $theme = !empty($_SESSION['authenticated_user_theme']) ? $_SESSION['authenticated_user_theme'] : $GLOBALS['sugar_config']['default_theme'];
         if (isset($_SESSION['authenticated_user_theme']) && $_SESSION['authenticated_user_theme'] != '') {
             $_SESSION['theme_changed'] = false;
         }
     }
     if (isset($_REQUEST['usercolor'])) {
         $_SESSION['authenticated_user_theme_color'] = clean_string($_REQUEST['usercolor']);
     }
     if (isset($_REQUEST['userfont'])) {
         $_SESSION['authenticated_user_theme_font'] = clean_string($_REQUEST['userfont']);
     }
     SugarThemeRegistry::set($theme);
     require_once 'include/utils/layout_utils.php';
     $GLOBALS['image_path'] = SugarThemeRegistry::current()->getImagePath() . '/';
     if (defined('TEMPLATE_URL')) {
         $GLOBALS['image_path'] = TEMPLATE_URL . '/' . $GLOBALS['image_path'];
     }
     if (isset($GLOBALS['current_user'])) {
         $GLOBALS['gridline'] = (int) ($GLOBALS['current_user']->getPreference('gridline') == 'on');
     }
 }
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:34,代码来源:SugarApplication.php

示例8: testGetBreadCrumbSymbolForRTLTheme

 public function testGetBreadCrumbSymbolForRTLTheme()
 {
     $theme = SugarTestThemeUtilities::createAnonymousRTLTheme();
     SugarThemeRegistry::set($theme);
     $this->assertEquals("<span class='pointer'>&laquo;</span>", $this->_view->getBreadCrumbSymbol());
 }
开发者ID:nickpro,项目名称:sugarcrm_dev,代码行数:6,代码来源:SugarViewTest.php

示例9: loadDisplaySettings

 /**
  * Load the themes/images.
  */
 function loadDisplaySettings()
 {
     global $theme;
     if (isset($_REQUEST['usertheme'])) {
         $theme = clean_string($_REQUEST['usertheme']);
         if (!isset($_REQUEST['noThemeSave'])) {
             $_SESSION['theme_changed'] = true;
             $_SESSION['authenticated_user_theme'] = $theme;
         }
     } else {
         $theme = !empty($_SESSION['authenticated_user_theme']) ? $_SESSION['authenticated_user_theme'] : $GLOBALS['sugar_config']['default_theme'];
         if (isset($_SESSION['authenticated_user_theme']) && $_SESSION['authenticated_user_theme'] != '') {
             $_SESSION['theme_changed'] = false;
         }
     }
     if (!empty($_REQUEST['usercolor'])) {
         $_SESSION['authenticated_user_theme_color'] = clean_string($_REQUEST['usercolor']);
         self::setCookie('ck_login_theme_color_20', $_REQUEST['usercolor'], time() + 86400 * 90);
     } elseif (!empty($_COOKIE['ck_login_theme_color_20'])) {
         $_SESSION['authenticated_user_theme_color'] = clean_string($_COOKIE['ck_login_theme_color_20']);
     }
     if (!empty($_REQUEST['userfont'])) {
         $_SESSION['authenticated_user_theme_font'] = clean_string($_REQUEST['userfont']);
         self::setCookie('ck_login_theme_font_20', $_REQUEST['userfont'], time() + 86400 * 90);
     } elseif (!empty($_COOKIE['ck_login_theme_font_20'])) {
         $_SESSION['authenticated_user_theme_font'] = clean_string($_COOKIE['ck_login_theme_font_20']);
     }
     if (isset($GLOBALS['current_user']) && $GLOBALS['current_user'] instanceof User) {
         if (isset($_REQUEST['userthemegrouptabs'])) {
             $GLOBALS['current_user']->setPreference('navigation_paradigm', $_REQUEST['userthemegrouptabs'], 0, 'global', $GLOBALS['current_user']);
         }
     }
     SugarThemeRegistry::set($theme);
     require_once 'include/utils/layout_utils.php';
     $GLOBALS['image_path'] = SugarThemeRegistry::current()->getImagePath() . '/';
     if (defined('TEMPLATE_URL')) {
         $GLOBALS['image_path'] = TEMPLATE_URL . '/' . $GLOBALS['image_path'];
     }
     if (isset($GLOBALS['current_user'])) {
         $GLOBALS['gridline'] = (int) ($GLOBALS['current_user']->getPreference('gridline') == 'on');
     }
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:45,代码来源:SugarApplication.php


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