fixes entry preview exception - fixes #119

This commit is contained in:
Ian 2014-05-24 19:41:40 +02:00
parent 26088f8ba5
commit c46d07cde5
3 changed files with 12 additions and 4 deletions

View File

@ -928,6 +928,11 @@ function serendipity_smarty_init($vars = array()) {
#echo '<pre>';print_r($serendipity['smarty']);echo '</pre>';#exit;
#$serendipity['smarty']->testInstall();exit;
// since 2k11/admin/entries.tpl is the default fallback for preview cases, we need to register that missing modifier for templates without tpls.
if (!function_exists('serendipity_smarty_html5time')) {
function serendipity_smarty_html5time($timestamp) { return date("c", $timestamp); }
$serendipity['smarty']->registerPlugin('modifier', 'serendipity_html5time', 'serendipity_smarty_html5time');
}
/**
* ToDo: Check for possible API changes in Smarty 3.2 [smarty_modifier_foobar, --> [smarty_modifier_foobar, smarty_function_foobar, smarty_block_foobar] (in class)]
* smarty_modifier_foobar(Smarty $smarty, $string, ) vs. smarty_modifier_foobar($string, )
@ -1132,10 +1137,11 @@ function serendipity_smarty_shutdown($serendipity_directory = '') {
$serendipity['smarty']->display(serendipity_getTemplateFile($serendipity['smarty_file'], 'serendipityPath'));
}
/* Render a smarty-template
/**
* Render a smarty-template
* $template: path to the template-file
* $data: map with the variables to assign
* */
*/
function serendipity_smarty_show($template, $data = null) {
global $serendipity;

View File

@ -126,8 +126,10 @@ class Serendipity_Smarty extends Smarty
foreach($p AS $te) {
$template_dirs[] = $serendipity['serendipityPath'] . $serendipity['templatePath'] . trim($te) . '/';
}
} else {
// this is tested without need actually, but it makes the directory setter fallback chain a little more precise
$template_dirs[] = $serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['template'];
}
$template_dirs[] = $serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['defaultTemplate'];
$template_dirs[] = $serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['template_backend'];

View File

@ -1,5 +1,5 @@
{if $drawList}
<div class="has_toolbar">
<div class="has_toolbar">
<h2>{$CONST.EDIT_ENTRIES}</h2>
<form action="?" method="get">