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


PHP theme_config::find_theme_location方法代码示例

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


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

示例1: find_theme_config

 /**
  * Loads the theme config from config.php file.
  *
  * @param string $themename
  * @param stdClass $settings from config_plugins table
  * @param boolean $parentscheck true to also check the parents.    .
  * @return stdClass The theme configuration
  */
 private static function find_theme_config($themename, $settings, $parentscheck = true)
 {
     // We have to use the variable name $THEME (upper case) because that
     // is what is used in theme config.php files.
     if (!($dir = theme_config::find_theme_location($themename))) {
         return null;
     }
     $THEME = new stdClass();
     $THEME->name = $themename;
     $THEME->dir = $dir;
     $THEME->settings = $settings;
     global $CFG;
     // just in case somebody tries to use $CFG in theme config
     include "{$THEME->dir}/config.php";
     // verify the theme configuration is OK
     if (!is_array($THEME->parents)) {
         // parents option is mandatory now
         return null;
     } else {
         // We use $parentscheck to only check the direct parents (avoid infinite loop).
         if ($parentscheck) {
             // Find all parent theme configs.
             foreach ($THEME->parents as $parent) {
                 $parentconfig = theme_config::find_theme_config($parent, $settings, false);
                 if (empty($parentconfig)) {
                     return null;
                 }
             }
         }
     }
     return $THEME;
 }
开发者ID:MoodleMetaData,项目名称:MoodleMetaData,代码行数:40,代码来源:outputlib.php

示例2: find_theme_config

 /**
  * Loads the theme config from config.php file.
  *
  * @param string $themename
  * @param stdClass $settings from config_plugins table
  * @return stdClass The theme configuration
  */
 private static function find_theme_config($themename, $settings)
 {
     // We have to use the variable name $THEME (upper case) because that
     // is what is used in theme config.php files.
     if (!($dir = theme_config::find_theme_location($themename))) {
         return null;
     }
     $THEME = new stdClass();
     $THEME->name = $themename;
     $THEME->dir = $dir;
     $THEME->settings = $settings;
     global $CFG;
     // just in case somebody tries to use $CFG in theme config
     include "{$THEME->dir}/config.php";
     // verify the theme configuration is OK
     if (!is_array($THEME->parents)) {
         // parents option is mandatory now
         return null;
     }
     return $THEME;
 }
开发者ID:nicusX,项目名称:moodle,代码行数:28,代码来源:outputlib.php


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