]> git.mjollnir.org Git - s9y.git/commitdiff
Include a template's "config.inc.php" at all smarty init page calls.
authorgarvinhicking <garvinhicking>
Tue, 6 Dec 2005 12:17:08 +0000 (12:17 +0000)
committergarvinhicking <garvinhicking>
Tue, 6 Dec 2005 12:17:08 +0000 (12:17 +0000)
docs/NEWS
include/functions_config.inc.php
include/functions_smarty.inc.php
include/genpage.inc.php

index 1a09bd8deef0ce1508320b86fc84bb433b023992..fdde1bfd37d1c27584703312e33a36b9850a5818 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -45,6 +45,9 @@ Version 1.0 ()
 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)
index 5634ceb643fbe6603f4870c1361b4cb0eb06eb25..0e13c627ebfe6dc107fb0fd84f80513046c7b521 100644 (file)
@@ -596,6 +596,7 @@ function serendipity_iframe(&$entry, $mode = null) {
         case 'preview':
             echo '<div style="float: left; height: 225px"></div>';
             $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);
 
index e182567db391b913d903f644b91d388f1fad2fec..224915fa3f2f1b6213223805722313bb1fab2ffe 100644 (file)
@@ -628,6 +628,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;
 }
 
index e4b141fd13d9230b9506fec16c161cbf861ef27e..da4b32a4ec7b5be5b36db48334af0987a69f8119 100644 (file)
@@ -17,10 +17,6 @@ if ((empty($uri_addData['uriargs']) || trim($uri_addData['uriargs']) == $serendi
 serendipity_plugin_api::hook_event('genpage', $uri, $uri_addData);
 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'),