# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: moodle/lib/outputlib.php
--- moodle/lib/outputlib.php Base (1.136)
+++ moodle/lib/outputlib.php Locally Modified (Based On 1.136)
@@ -1068,8 +1068,14 @@
 
         $layoutinfo = $this->layout_info_for_page($pagelayout);
         $layoutfile = $layoutinfo['file'];
-        $theme = $layoutinfo['theme'];
 
+        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";
 
@@ -1078,6 +1084,7 @@
                 return $path;
             }
         }
+        }
 
         debugging('Can not find layout file for: ' . $pagelayout);
         // fallback to standard normal layout
Index: moodle/theme/anomaly/config.php
--- moodle/theme/anomaly/config.php Base (1.9)
+++ moodle/theme/anomaly/config.php Locally Modified (Based On 1.9)
@@ -42,82 +42,69 @@
 $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),
@@ -126,7 +113,6 @@
     // 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),
Index: moodle/theme/base/config.php
--- moodle/theme/base/config.php Base (1.8)
+++ moodle/theme/base/config.php Locally Modified (Based On 1.8)
@@ -54,55 +54,47 @@
 $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',
@@ -110,13 +102,11 @@
     ),
     // 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),
@@ -124,21 +114,18 @@
 
     // 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),
@@ -147,7 +134,6 @@
     // 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),
Index: moodle/theme/experiment/config.php
--- moodle/theme/experiment/config.php Base (1.1)
+++ moodle/theme/experiment/config.php Locally Modified (Based On 1.1)
@@ -47,89 +47,76 @@
 $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),
@@ -138,7 +125,6 @@
     // 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),
