當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。