tweak to support multiple engine: in info.txt of templates

This commit is contained in:
Garvin Hicking 2010-08-23 19:06:17 +00:00
parent 859b56a3e1
commit 2b6eb5954b
2 changed files with 11 additions and 6 deletions

View File

@ -268,7 +268,10 @@ function serendipity_getTemplateFile($file, $key = 'serendipityHTTPPath') {
$directories[] = isset($serendipity['template']) ? $serendipity['template'] . '/' : '';
if (isset($serendipity['template_engine']) && (stristr($file, 'admin/') === false || $serendipity['template_engine'] != 'default')) {
$directories[] = $serendipity['template_engine'] . '/';
$p = explode(',', $serendipity['template_engine']);
foreach($p AS $te) {
$directories[] = trim($te) . '/';
}
}
$directories[] = $serendipity['defaultTemplate'] .'/';

View File

@ -880,11 +880,13 @@ function serendipity_smarty_init($vars = array()) {
$serendipity['smarty']->debugging = true;
}
$serendipity['smarty']->template_dir = array(
$template_dir,
$serendipity['serendipityPath'] . $serendipity['templatePath'] . 'default',
$serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['template_engine']
);
$serendipity['smarty']->template_dir = array($template_dir);
$p = explode(',', $serendipity['template_engine']);
foreach($p AS $te) {
$serendipity['smarty']->template_dir[] = $serendipity['serendipityPath'] . $serendipity['templatePath'] . $te;
}
$serendipity['smarty']->template_dir[] = $serendipity['serendipityPath'] . $serendipity['templatePath'] . 'default';
$serendipity['smarty']->compile_dir = $serendipity['serendipityPath'] . PATH_SMARTY_COMPILE;
if (!is_dir($serendipity['smarty']->compile_dir) || !is_writable($serendipity['smarty']->compile_dir)) {