// may contain core and plugin renderers and renderer factory
include_once($rendererfile);
}
-
+
// cascade all layouts properly
foreach ($baseconfig->layouts as $layout=>$value) {
if (!isset($this->layouts[$layout])) {
$layoutinfo = $this->layout_info_for_page($pagelayout);
$layoutfile = $layoutinfo['file'];
- $theme = $layoutinfo['theme'];
-
- if ($dir = $this->find_theme_location($theme)) {
- $path = "$dir/layout/$layoutfile";
- // Check the template exists, return general base theme template if not.
- if (is_readable($path)) {
- return $path;
+ if (array_key_exists('theme', $layoutinfo)) {
+ $themes = array($layoutinfo['theme']);
+ } else {
+ $themes = array_merge(array($this->name),$this->parents);
+ }
+
+ foreach ($themes as $theme) {
+ if ($dir = $this->find_theme_location($theme)) {
+ $path = "$dir/layout/$layoutfile";
+
+ // Check the template exists, return general base theme template if not.
+ if (is_readable($path)) {
+ return $path;
+ }
}
}
$THEME->layouts = array(
// Most pages - if we encounter an unknown or a missing page type, this one is used.
'base' => array(
- 'theme' => 'anomaly',
'file' => 'general.php',
'regions' => array()
),
'standard' => array(
- 'theme' => 'anomaly',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post'
),
// Course page
'course' => array(
- 'theme' => 'anomaly',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post'
),
// Course page
'coursecategory' => array(
- 'theme' => 'anomaly',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post'
),
'incourse' => array(
- 'theme' => 'anomaly',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post'
),
'frontpage' => array(
- 'theme' => 'anomaly',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post'
),
'admin' => array(
- 'theme' => 'anomaly',
'file' => 'general.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre'
),
'mydashboard' => array(
- 'theme' => 'anomaly',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post'
),
'mypublic' => array(
- 'theme' => 'anomaly',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post'
),
'login' => array(
- 'theme' => 'anomaly',
'file' => 'general.php',
'regions' => array()
),
// Pages that appear in pop-up windows - no navigation, no blocks, no header.
'popup' => array(
- 'theme' => 'anomaly',
'file' => 'general.php',
'regions' => array(),
'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>true),
),
// No blocks and minimal footer - used for legacy frame layouts only!
'frametop' => array(
- 'theme' => 'anomaly',
'file' => 'general.php',
'regions' => array(),
'options' => array('nofooter', 'noblocks'=>true),
),
// Embeded pages, like iframe embeded in moodleform
'embedded' => array(
- 'theme' => 'anomaly',
'file' => 'general.php',
'regions' => array(),
'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>true),
// This must not have any blocks, and it is good idea if it does not have links to
// other places - for example there should not be a home link in the footer...
'maintenance' => array(
- 'theme' => 'anomaly',
'file' => 'general.php',
'regions' => array(),
'options' => array('nofooter'=>true, 'nonavbar'=>true, 'noblocks'=>true),
$THEME->layouts = array(
// Most backwards compatible layout without the blocks - this is the layout used by default
'base' => array(
- 'theme' => 'base',
'file' => 'general.php',
'regions' => array(),
),
// Standard layout with blocks, this is recommended for most pages with general information
'standard' => array(
- 'theme' => 'base',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post',
),
// Main course page
'course' => array(
- 'theme' => 'base',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post',
'options' => array('langmenu'=>true),
),
'coursecategory' => array(
- 'theme' => 'base',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post',
),
// part of course, typical for modules - default page layout if $cm specified in require_login()
'incourse' => array(
- 'theme' => 'base',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post',
),
// The site home page.
'frontpage' => array(
- 'theme' => 'base',
'file' => 'frontpage.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post',
),
// Server administration scripts.
'admin' => array(
- 'theme' => 'base',
'file' => 'general.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
),
// My dashboard page
'mydashboard' => array(
- 'theme' => 'base',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post',
),
// My public page
'mypublic' => array(
- 'theme' => 'base',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post',
),
'login' => array(
- 'theme' => 'base',
'file' => 'general.php',
'regions' => array(),
'options' => array('langmenu'=>true),
// Pages that appear in pop-up windows - no navigation, no blocks, no header.
'popup' => array(
- 'theme' => 'base',
'file' => 'general.php',
'regions' => array(),
'options' => array('nofooter'=>true),
),
// No blocks and minimal footer - used for legacy frame layouts only!
'frametop' => array(
- 'theme' => 'base',
'file' => 'general.php',
'regions' => array(),
'options' => array('nofooter'=>true),
),
// Embeded pages, like iframe/object embeded in moodleform - it needs as much space as possible
'embedded' => array(
- 'theme' => 'base',
'file' => 'embedded.php',
'regions' => array(),
'options' => array('nofooter'=>true, 'nonavbar'=>true),
// This must not have any blocks, and it is good idea if it does not have links to
// other places - for example there should not be a home link in the footer...
'maintenance' => array(
- 'theme' => 'base',
'file' => 'general.php',
'regions' => array(),
'options' => array('nofooter'=>true, 'nonavbar'=>true),
$THEME->layouts = array(
// Most backwards compatible layout without the blocks - this is the layout used by default
'base' => array(
- 'theme' => 'experiment',
'file' => 'general.php',
'regions' => array(),
),
// Standard layout with blocks, this is recommended for most pages with general information
'standard' => array(
- 'theme' => 'experiment',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post',
),
// Main course page
'course' => array(
- 'theme' => 'experiment',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post',
'options' => array('langmenu'=>true),
),
'coursecategory' => array(
- 'theme' => 'experiment',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post',
),
// part of course, typical for modules - default page layout if $cm specified in require_login()
'incourse' => array(
- 'theme' => 'experiment',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post',
),
// The site home page.
'frontpage' => array(
- 'theme' => 'experiment',
'file' => 'frontpage.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post',
),
// Server administration scripts.
'admin' => array(
- 'theme' => 'experiment',
'file' => 'general.php',
'regions' => array('side-pre'),
'defaultregion' => 'side-pre',
),
// My dashboard page
'mydashboard' => array(
- 'theme' => 'experiment',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post',
),
// My public page
'mypublic' => array(
- 'theme' => 'experiment',
'file' => 'general.php',
'regions' => array('side-pre', 'side-post'),
'defaultregion' => 'side-post',
),
'login' => array(
- 'theme' => 'experiment',
'file' => 'general.php',
'regions' => array(),
'options' => array('langmenu'=>true),
),
// Pages that appear in pop-up windows - no navigation, no blocks, no header.
'popup' => array(
- 'theme' => 'experiment',
'file' => 'general.php',
'regions' => array(),
'options' => array('nofooter'=>true),
),
// No blocks and minimal footer - used for legacy frame layouts only!
'frametop' => array(
- 'theme' => 'experiment',
'file' => 'general.php',
'regions' => array(),
'options' => array('nofooter'=>true),
),
// Embeded pages, like iframe/object embeded in moodleform - it needs as much space as possible
'embedded' => array(
- 'theme' => 'experiment',
'file' => 'embedded.php',
'regions' => array(),
'options' => array('nofooter'=>true, 'nonavbar'=>true),
// This must not have any blocks, and it is good idea if it does not have links to
// other places - for example there should not be a home link in the footer...
'maintenance' => array(
- 'theme' => 'experiment',
'file' => 'general.php',
'regions' => array(),
'options' => array('nofooter'=>true, 'nonavbar'=>true),