Index: kernel/common/eztemplatedesignresource.php
===================================================================
--- kernel/common/eztemplatedesignresource.php	(Revision 1115)
+++ kernel/common/eztemplatedesignresource.php	(Arbeitskopie)
@@ -676,9 +676,10 @@
                 $GLOBALS['eZTemplateDesignResourceSiteAccessBases'] = array();
             }
 
-            $ini = eZINI::instance( 'site.ini', 'settings', null, null, true );
+            // AB: Modified to be able to use eZTemplateDesignResource::overrideArray( 'not_current_siteaccess' )
+            $ini = eZINI::instance( 'site.ini', 'settings', null, false, true );
             $ini->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess' );
-            eZExtension::prependExtensionSiteAccesses( $siteAccess, $ini, false, 'siteaccess' );
+            eZExtension::activateExtensions( false, $siteAccess, $ini );
             $ini->loadCache();
 
             $standardDesign = $ini->variable( "DesignSettings", "StandardDesign" );
@@ -776,10 +777,16 @@
         // fetch the override array from a specific siteacces
         if ( $siteAccess )
         {
-            $overrideINI = eZINI::instance( 'override.ini', 'settings', null, null, true );
+            // AB: Modified to be able to use eZTemplateDesignResource::overrideArray( 'not_current_siteaccess' )
+            $overrideINI = eZINI::instance( 'override.ini', 'settings', null, false, true );
+            $overrideINI->LocalOverrideDirArray = null;
+            $overrideINI->reset();
             $overrideINI->prependOverrideDir( "siteaccess/$siteAccess", false, 'siteaccess' );
-            eZExtension::prependExtensionSiteAccesses( $siteAccess, $overrideINI, false, 'siteaccess', false );
-            $overrideINI->loadCache();
+            eZExtension::activateExtensions( false, $siteAccess, $overrideINI );
+            $inputFiles = array();
+            $dummyIni = false;
+            $overrideINI->findInputFiles( $inputFiles, $dummyIni, false );
+            $overrideINI->parse( $inputFiles, true );
         }
         else
         {
Index: lib/ezutils/classes/ezextension.php
===================================================================
--- lib/ezutils/classes/ezextension.php	(Revision 1115)
+++ lib/ezutils/classes/ezextension.php	(Arbeitskopie)
@@ -68,9 +68,19 @@
      Default extensions are those who are loaded before a siteaccess are determined while access extensions
      are loaded after siteaccess is set.
     */
-    static function activeExtensions( $extensionType = false )
+    static function activeExtensions( $extensionType = false, $accessName = false ) // AB: Added to be able to use eZTemplateDesignResource::overrideArray( 'not_current_siteaccess' )
     {
-        $ini = eZINI::instance();
+        // AB: Added to be able to use eZTemplateDesignResource::overrideArray( 'not_current_siteaccess' )
+        if ( $accessName === false )
+        {
+            $ini = eZINI::instance();
+        }
+        else
+        {
+            $ini = eZINI::instance( 'site.ini', 'settings', null, false, true );
+            $ini->prependOverrideDir( 'siteaccess/' . $accessName, false, 'siteaccess' );
+            $ini->loadCache();
+        }
         $activeExtensions = array();
         if ( !$extensionType or
              $extensionType == 'default' )
@@ -95,12 +105,16 @@
      Will make sure that all extensions that has settings directories
      are added to the eZINI override list.
     */
-    static function activateExtensions( $extensionType = false )
+    static function activateExtensions( $extensionType = false, $accessName = false, $ini = false ) // AB: Added to be able to use eZTemplateDesignResource::overrideArray( 'not_current_siteaccess' )
     {
         $extensionDirectory = eZExtension::baseDirectory();
-        $activeExtensions = eZExtension::activeExtensions( $extensionType );
+        $activeExtensions = eZExtension::activeExtensions( $extensionType, $accessName );  // AB: Changed to be able to use eZTemplateDesignResource::overrideArray( 'not_current_siteaccess' )
         $hasExtensions = false;
-        $ini = eZINI::instance();
+        // AB: Added to be able to use eZTemplateDesignResource::overrideArray( 'not_current_siteaccess' )
+        if ( $ini === false )
+        {
+            $ini = eZINI::instance();
+        }
         foreach ( $activeExtensions as $activeExtension )
         {
             if ( !file_exists( $extensionDirectory . '/' . $activeExtension ) )
@@ -112,6 +126,12 @@
             {
                 $ini->prependOverrideDir( $extensionSettingsPath, true );
 
+                // AB: Added to be able to use eZTemplateDesignResource::overrideArray( 'not_current_siteaccess' )
+                if ( $accessName !== false )
+                {
+                    eZExtension::prependSiteAccess( $activeExtension, $accessName, $ini );
+                }
+                else
                 if ( isset( $GLOBALS['eZCurrentAccess'] ) )
                 {
                     eZExtension::prependSiteAccess( $activeExtension );
@@ -119,7 +139,7 @@
                 $hasExtensions = true;
             }
         }
-        if ( $hasExtensions )
+        if ( $hasExtensions && $accessName === false ) // AB: Added to be able to use eZTemplateDesignResource::overrideArray( 'not_current_siteaccess' )
             $ini->loadCache();
     }
 
@@ -132,7 +152,7 @@
     */
     static function prependExtensionSiteAccesses( $accessName = false, $ini = false, $globalDir = true, $identifier = false, $order = true )
     {
-        $extensionList = eZExtension::activeExtensions();
+        $extensionList = eZExtension::activeExtensions( false, $accessName ); // AB: Added to be able to use eZTemplateDesignResource::overrideArray( 'not_current_siteaccess' )
 
         if ( !$order )
         {
Index: lib/ezutils/classes/ezini.php
===================================================================
--- lib/ezutils/classes/ezini.php	(Revision 1115)
+++ lib/ezutils/classes/ezini.php	(Arbeitskopie)
@@ -279,7 +279,7 @@
      The result is a list with expanded paths to the files.
      \return the expanded file list.
     */
-    function findInputFiles( &$inputFiles, &$iniFile )
+    function findInputFiles( &$inputFiles, &$iniFile, $useOverridePrepend = true ) // AB: Added to be able to use eZTemplateDesignResource::overrideArray( 'not_current_siteaccess' )
     {
         if ( $this->RootDir !== false )
             $iniFile = eZDir::path( array( $this->RootDir, $this->FileName ) );
@@ -288,7 +288,8 @@
 
         $inputFiles = array();
 
-        if ( $this->FileName == 'override.ini' )
+         // AB: Modified to be able to use eZTemplateDesignResource::overrideArray( 'not_current_siteaccess' )
+        if ( $useOverridePrepend && $this->FileName == 'override.ini' )
         {
             eZExtension::prependExtensionSiteAccesses( false, $this, true, false, false );
         }
