From: garvinhicking Date: Tue, 6 Dec 2005 12:17:12 +0000 (+0000) Subject: Include a template's "config.inc.php" at all smarty init page calls. X-Git-Tag: 0.9.1~13 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=818fd12d7fd7b6e143b6a2f8312b97d64cda8274;p=s9y.git Include a template's "config.inc.php" at all smarty init page calls. --- diff --git a/docs/NEWS b/docs/NEWS index 2c6da8b..e2eba8a 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,9 @@ Version 0.9.2 () ------------------------------------------------------------------------ + * Include a template's "config.inc.php" also when previewing an entry, + so that custom functions can be called (garvinhicking) + * Media uploader remembers last used upload directory (garvinhicking) * Add "Precedence: Bulk" headers to sent mails (garvinhicking) diff --git a/include/functions_config.inc.php b/include/functions_config.inc.php index 7d763aa..8b20855 100644 --- a/include/functions_config.inc.php +++ b/include/functions_config.inc.php @@ -396,6 +396,7 @@ function serendipity_iframe(&$entry, $mode = null) { case 'preview': echo '
'; $serendipity['smarty_raw_mode'] = true; // Force output of Smarty stuff in the backend + $serendipity['smarty_preview'] = true; serendipity_smarty_init(); $serendipity['smarty']->assign('is_preview', true); diff --git a/include/functions_smarty.inc.php b/include/functions_smarty.inc.php index 8e23213..5eefdf7 100644 --- a/include/functions_smarty.inc.php +++ b/include/functions_smarty.inc.php @@ -262,6 +262,10 @@ function serendipity_smarty_init() { ) ); + // For advanced usage, we allow template authors to create a file 'config.inc.php' where they can + // setup custom smarty variables, modifiers etc. to use in their templates. + @include_once $serendipity['smarty']->config_dir . '/config.inc.php'; + return true; } diff --git a/include/genpage.inc.php b/include/genpage.inc.php index c71f88b..9f1dc99 100644 --- a/include/genpage.inc.php +++ b/include/genpage.inc.php @@ -9,10 +9,6 @@ include_once(S9Y_INCLUDE_PATH . 'include/plugin_internal.inc.php'); serendipity_plugin_api::hook_event('genpage', $uri); serendipity_smarty_init(); -// For advanced usage, we allow template authors to create a file 'config.inc.php' where they can -// setup custom smarty variables, modifiers etc. to use in their templates. -@include_once $serendipity['smarty']->config_dir . '/config.inc.php'; - $serendipity['smarty']->assign( array( 'leftSidebarElements' => serendipity_plugin_api::count_plugins('left'),