Index: branches/unlabeled/unlabeled-1.42.2/core/kernel/startup.php =================================================================== diff -u -r4882 -r4967 --- branches/unlabeled/unlabeled-1.42.2/core/kernel/startup.php (.../startup.php) (revision 4882) +++ branches/unlabeled/unlabeled-1.42.2/core/kernel/startup.php (.../startup.php) (revision 4967) @@ -5,7 +5,7 @@ include_once(KERNEL_PATH.'/globals.php'); // non OOP functions used through kernel, e.g. print_pre $globals_end = getmicrotime(); - if( constOn('ADMIN') ) define('SPECIAL_TEMPLATES_FOLDER', '/kernel/admin_templates'); +// if( constOn('ADMIN') ) define('SPECIAL_TEMPLATES_FOLDER', '/kernel/admin_templates'); define('INPORTAL_ENV', 1); Index: branches/unlabeled/unlabeled-1.13.2/core/kernel/parser/template.php =================================================================== diff -u -r4760 -r4967 --- branches/unlabeled/unlabeled-1.13.2/core/kernel/parser/template.php (.../template.php) (revision 4760) +++ branches/unlabeled/unlabeled-1.13.2/core/kernel/parser/template.php (.../template.php) (revision 4967) @@ -75,38 +75,14 @@ var $BasePath; var $FileNames = Array(); - var $ModulesCache = Array(); - function TemplatesCache() { parent::kBase(); - $this->SetThemePath(); $this->BasePath = FULL_PATH.THEMES_PATH; $conn =& $this->Application->GetADODBConnection(); -// $this->ModulesCache = $conn->GetCol('SELECT LOWER(Name) FROM '.TABLE_PREFIX.'Modules'); } - function SetThemePath() - { - if (defined('SPECIAL_TEMPLATES_FOLDER')) { - $sub_folder = SPECIAL_TEMPLATES_FOLDER; - } - elseif ($this->Application->IsAdmin()) { - $sub_folder = '/admin/templates'; - } - else { - $theme =& $this->Application->recallObject('theme.current'); - if ($theme->isLoaded()) { - $sub_folder = '/themes/'.$theme->GetDBField('Name'); - } - else { - die('No Primary Theme Selected'); - } - } - safeDefine('THEMES_PATH', $sub_folder); - } - function LoadTemplate($filename, $title=NULL, $silent=0) { if (preg_match('#^[\/]{0,1}([^\/]*)\/(.*)#', $filename, $regs)) { @@ -118,7 +94,7 @@ $module_filename = $filename; } - if ( $this->Application->IsAdmin() && $this->Application->findModule('Name', $first_dir, null, true)) { + if ( $this->Application->IsAdmin() && $this->Application->findModule('Name', $first_dir)) { $path = MODULES_PATH.'/'.strtolower($first_dir).'/admin_templates'; } else { Index: branches/unlabeled/unlabeled-1.147.2/core/kernel/application.php =================================================================== diff -u -r4905 -r4967 --- branches/unlabeled/unlabeled-1.147.2/core/kernel/application.php (.../application.php) (revision 4905) +++ branches/unlabeled/unlabeled-1.147.2/core/kernel/application.php (.../application.php) (revision 4967) @@ -341,7 +341,10 @@ */ function VerifyThemeId() { - if ($this->Application->IsAdmin()) return; + if ($this->Application->IsAdmin()) { + safeDefine('THEMES_PATH', '/kernel/admin_templates'); + return; + } $theme_id = $this->GetVar('m_theme'); if (!$theme_id) { @@ -356,6 +359,7 @@ if (!$theme->IsLoaded() || !$theme->GetDBField('Enabled')) { if (!defined('IS_INSTALL')) die('Unknown or disabled theme'); } + safeDefine('THEMES_PATH', '/themes/'.$theme->GetDBField('Name')); } function GetDefaultLanguageId()