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


PHP SugarThemeRegistry::_themes方法代码示例

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


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

示例1: buildRegistry

 /**
  * Builds the theme registry
  */
 public static function buildRegistry()
 {
     self::$_themes = array();
     // check for a default themedef file
     $themedefDefault = array();
     if (SugarAutoLoader::existing("custom/themes/default/themedef.php")) {
         $themedef = array();
         require "custom/themes/default/themedef.php";
         $themedefDefault = $themedef;
     }
     foreach (SugarAutoLoader::getFilesCustom("themes", true) as $file) {
         if (SugarAutoLoader::existing("{$file}/themedef.php")) {
             $themedef = array();
             require "{$file}/themedef.php";
             $themedef = array_merge($themedef, $themedefDefault);
             $themedef['dirName'] = basename($file);
             if (self::exists($themedef['dirName'])) {
                 $existingTheme = self::get($themedef['dirName']);
                 foreach (SugarTheme::getThemeDefFields() as $field) {
                     if (!isset($themedef[$field])) {
                         $themedef[$field] = $existingTheme->{$field};
                     }
                 }
                 self::remove($themedef['dirName']);
             }
             if (isset($themedef['name'])) {
                 self::add($themedef);
             }
         }
     }
     // default to setting the default theme as the current theme
     if (!isset($GLOBALS['sugar_config']['default_theme']) || !self::set($GLOBALS['sugar_config']['default_theme'])) {
         if (count(self::availableThemes()) == 0) {
             sugar_die('No valid themes are found on this instance');
         } else {
             self::set(self::getDefaultThemeKey());
         }
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:42,代码来源:SugarTheme.php

示例2: buildRegistry

 /**
  * Builds the theme registry
  */
 public static function buildRegistry()
 {
     self::$_themes = array();
     $dirs = array("themes/", "custom/themes/");
     // check for a default themedef file
     $themedefDefault = array();
     if (sugar_is_file("custom/themes/default/themedef.php")) {
         $themedef = array();
         require "custom/themes/default/themedef.php";
         $themedefDefault = $themedef;
     }
     foreach ($dirs as $dirPath) {
         if (sugar_is_dir('./' . $dirPath) && is_readable('./' . $dirPath) && ($dir = opendir('./' . $dirPath))) {
             while (($file = readdir($dir)) !== false) {
                 if ($file == ".." || $file == "." || $file == ".svn" || $file == "CVS" || $file == "Attic" || $file == "default" || !sugar_is_dir("./{$dirPath}" . $file) || !sugar_is_file("./{$dirPath}{$file}/themedef.php")) {
                     continue;
                 }
                 $themedef = array();
                 require "./{$dirPath}{$file}/themedef.php";
                 $themedef = array_merge($themedef, $themedefDefault);
                 $themedef['dirName'] = $file;
                 // check for theme already existing in the registry
                 // if so, then it will override the current one
                 if (self::exists($themedef['dirName'])) {
                     $existingTheme = self::get($themedef['dirName']);
                     foreach (SugarTheme::getThemeDefFields() as $field) {
                         if (!isset($themedef[$field])) {
                             $themedef[$field] = $existingTheme->{$field};
                         }
                     }
                     self::remove($themedef['dirName']);
                 }
                 if (isset($themedef['name'])) {
                     self::add($themedef);
                 }
             }
             closedir($dir);
         }
     }
     // default to setting the default theme as the current theme
     if (!isset($GLOBALS['sugar_config']['default_theme']) || !self::set($GLOBALS['sugar_config']['default_theme'])) {
         if (count(self::availableThemes()) == 0) {
             sugar_die('No valid themes are found on this instance');
         } else {
             self::set(self::getDefaultThemeKey());
         }
     }
 }
开发者ID:BMLP,项目名称:memoryhole-ansible,代码行数:51,代码来源:SugarTheme.php

示例3: buildRegistry

 /**
  * Builds the theme registry
  */
 public static function buildRegistry()
 {
     self::$_themes = array();
     $dirs = array("themes/", "custom/themes/");
     foreach ($dirs as $dirPath) {
         if (sugar_is_dir('./' . $dirPath) && ($dir = opendir('./' . $dirPath))) {
             while (($file = readdir($dir)) !== false) {
                 if ($file == ".." || $file == "." || $file == ".svn" || $file == "CVS" || $file == "Attic" || !sugar_is_dir("./{$dirPath}" . $file) || !sugar_is_file("./{$dirPath}{$file}/themedef.php")) {
                     continue;
                 }
                 $themedef = array();
                 require "./{$dirPath}{$file}/themedef.php";
                 $themedef['dirName'] = $file;
                 // check for theme already existing in the registry
                 // if so, then it will override the current one
                 if (self::exists($themedef['dirName'])) {
                     $existingTheme = self::get($themedef['dirName']);
                     foreach (SugarTheme::getThemeDefFields() as $field) {
                         if (!isset($themedef[$field])) {
                             $themedef[$field] = $existingTheme->{$field};
                         }
                     }
                     self::remove($themedef['dirName']);
                 }
                 if (isset($themedef['name'])) {
                     self::add($themedef);
                 }
             }
             closedir($dir);
         }
     }
     // default to setting the default theme as the current theme
     self::set($GLOBALS['sugar_config']['default_theme']);
 }
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:37,代码来源:SugarTheme.php


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