Index: branches/RC/core/kernel/nparser/compiler.php =================================================================== diff -u -r10098 -r11214 --- branches/RC/core/kernel/nparser/compiler.php (.../compiler.php) (revision 10098) +++ branches/RC/core/kernel/nparser/compiler.php (.../compiler.php) (revision 11214) @@ -26,12 +26,13 @@ $save_handler = $this->Application->errorHandlers[0]; $this->Application->errorHandlers[0] = array(&$this, 'SaveError'); - safeDefine('DBG_NPARSER_FORCE_COMPILE',1); + safeDefine('DBG_NPARSER_FORCE_COMPILE', 1); $i = $current; $this->Application->InitParser(); while ($i < $total && $i < ($current + 20)) { $a_template = $templates[$i]; - $this->Application->Parser->CheckTemplate($a_template['module'].'/'.$a_template['path']); + + $this->Application->Parser->CheckTemplate($a_template['module'] . '/' . $a_template['path']); $i++; } @@ -57,10 +58,35 @@ function FindTemplates() { - $this->Templates = array(); - foreach ($this->Application->ModuleInfo as $module=>$options) { - $this->FindTemplateFiles('/'.$options['Path'].'admin_templates', $options); + $this->Templates = Array (); + + // find admin templates + foreach ($this->Application->ModuleInfo as $module => $options) { + if ($module == 'In-Portal') { + // don't check In-Portal admin templates, because it doesn't have them + continue; + } + + $template_path = '/' . $options['Path'] . 'admin_templates'; + $options['Path'] = $template_path; + + $this->FindTemplateFiles($template_path, $options); } + + // find Front-End templates + $sql = 'SELECT Name + FROM ' . $this->Application->getUnitOption('theme', 'TableName'); + $themes = $this->Conn->GetCol($sql); + + $options = Array (); + foreach ($themes as $theme_name) { + $template_path = '/themes/' . $theme_name; + $options['Name'] = 'theme:' . $theme_name; + $options['Path'] = $template_path; + + $this->FindTemplateFiles($template_path, $options); + } + return $this->Templates; } @@ -80,7 +106,7 @@ else { $info = pathinfo($full_path); if (isset($info['extension']) && $info['extension'] == 'tpl') { - $this->Templates[] = array('module' => mb_strtolower($options['Name']), 'path' => str_replace(FULL_PATH.'/'.$options['Path'].'admin_templates/', '', preg_replace('/\.tpl$/', '', $full_path))); + $this->Templates[] = array('module' => mb_strtolower($options['Name']), 'path' => str_replace(FULL_PATH . $options['Path'] . '/', '', preg_replace('/\.tpl$/', '', $full_path))); } } }