Index: trunk/core/kernel/parser/template.php =================================================================== diff -u -N -r4567 -r4758 --- trunk/core/kernel/parser/template.php (.../template.php) (revision 4567) +++ trunk/core/kernel/parser/template.php (.../template.php) (revision 4758) @@ -44,10 +44,11 @@ trigger_error("Template file size is 0: $filename", ($silent ? E_USER_NOTICE : E_USER_ERROR) ); } - $handle = fopen ($filename, "r"); + $this->SetBody(file_get_contents($filename)); + /*$handle = fopen ($filename, "r"); $contents = fread ($handle, filesize ($filename)); $this->SetBody($contents); - fclose ($handle); + fclose ($handle);*/ return true; } else { @@ -83,7 +84,7 @@ $this->BasePath = FULL_PATH.THEMES_PATH; $conn =& $this->Application->GetADODBConnection(); - $this->ModulesCache = $conn->GetCol('SELECT LOWER(Name) FROM '.TABLE_PREFIX.'Modules'); +// $this->ModulesCache = $conn->GetCol('SELECT LOWER(Name) FROM '.TABLE_PREFIX.'Modules'); } function SetThemePath() @@ -117,7 +118,7 @@ $module_filename = $filename; } - if ( $this->Application->IsAdmin() && in_array(strtolower($first_dir), $this->ModulesCache)) { + if ( $this->Application->IsAdmin() && $this->Application->findModule('Name', $first_dir, null, true)) { $path = MODULES_PATH.'/'.strtolower($first_dir).'/admin_templates'; } else { @@ -140,7 +141,7 @@ $module_filename = $filename; } - if ( $this->Application->IsAdmin() && in_array(strtolower($first_dir), $this->ModulesCache)) { + if ( $this->Application->IsAdmin() && $this->Application->findModule('Name', $first_dir, null, true)) { $path = MODULES_PATH.'/'.strtolower($first_dir).'/admin_templates'; } else {