Archived
fixes entry preview exception - fixes #119
This commit is contained in:
@@ -928,6 +928,11 @@ function serendipity_smarty_init($vars = array()) {
|
|||||||
#echo '<pre>';print_r($serendipity['smarty']);echo '</pre>';#exit;
|
#echo '<pre>';print_r($serendipity['smarty']);echo '</pre>';#exit;
|
||||||
#$serendipity['smarty']->testInstall();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)]
|
* 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, …)
|
* 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'));
|
$serendipity['smarty']->display(serendipity_getTemplateFile($serendipity['smarty_file'], 'serendipityPath'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Render a smarty-template
|
/**
|
||||||
|
* Render a smarty-template
|
||||||
* $template: path to the template-file
|
* $template: path to the template-file
|
||||||
* $data: map with the variables to assign
|
* $data: map with the variables to assign
|
||||||
* */
|
*/
|
||||||
function serendipity_smarty_show($template, $data = null) {
|
function serendipity_smarty_show($template, $data = null) {
|
||||||
global $serendipity;
|
global $serendipity;
|
||||||
|
|
||||||
|
|||||||
@@ -126,8 +126,10 @@ class Serendipity_Smarty extends Smarty
|
|||||||
foreach($p AS $te) {
|
foreach($p AS $te) {
|
||||||
$template_dirs[] = $serendipity['serendipityPath'] . $serendipity['templatePath'] . trim($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['defaultTemplate'];
|
||||||
$template_dirs[] = $serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['template_backend'];
|
$template_dirs[] = $serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['template_backend'];
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{if $drawList}
|
{if $drawList}
|
||||||
<div class="has_toolbar">
|
<div class="has_toolbar">
|
||||||
<h2>{$CONST.EDIT_ENTRIES}</h2>
|
<h2>{$CONST.EDIT_ENTRIES}</h2>
|
||||||
|
|
||||||
<form action="?" method="get">
|
<form action="?" method="get">
|
||||||
|
|||||||
Reference in New Issue
Block a user