]> 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:12 +0000 (12:17 +0000)
committergarvinhicking <garvinhicking>
Tue, 6 Dec 2005 12:17:12 +0000 (12:17 +0000)
docs/NEWS
include/functions_config.inc.php
include/functions_smarty.inc.php
include/genpage.inc.php

index 2c6da8b5b0eb97a40de30add4aac2154d017b0da..e2eba8ae8da0f81c4964537114cfd62086af9db0 100644 (file)
--- 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)
index 7d763aa8918fcc813e9d09f38b25695ffeec3103..8b20855c77f4716013fa3864164c6a985e592584 100644 (file)
@@ -396,6 +396,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 8e2321387528444206be763707bdbbdadd181049..5eefdf7e09c501a4ae06f43e1e59cde9f1f7188a 100644 (file)
@@ -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;
 }
 
index c71f88b2a59b6185720e27eefd607860c6dafa8c..9f1dc994b30cc98b71c658c118d91699823669fc 100644 (file)
@@ -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'),