From 2118aba41683b4c62d8e7cd9d6694677feed4963 Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Thu, 21 Feb 2008 09:42:50 +0000 Subject: [PATCH] Add 'template' option --- docs/NEWS | 6 ++++++ include/functions_smarty.inc.php | 7 ++++++- include/plugin_api.inc.php | 4 ++-- serendipity_config.inc.php | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index ada247b..22f2d8e 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -1,5 +1,11 @@ # $Id$ +Version 1.3 () +------------------------------------------------------------------------ + + * Add option "template" to smarty function call {serendipity_ + printSidebar} (garvinhicking) + Version 1.3-beta1 (February 19th) ------------------------------------------------------------------------ diff --git a/include/functions_smarty.inc.php b/include/functions_smarty.inc.php index 8e030c5..b6f04e5 100644 --- a/include/functions_smarty.inc.php +++ b/include/functions_smarty.inc.php @@ -592,7 +592,12 @@ function serendipity_smarty_printSidebar($params, &$smarty) { $smarty->trigger_error(__FUNCTION__ .": missing 'side' parameter"); return; } - return serendipity_plugin_api::generate_plugins($params['side']); + + if (isset($params['template'])) { + return serendipity_plugin_api::generate_plugins($params['side'], '', false, null, null, $params['template']); + } else { + return serendipity_plugin_api::generate_plugins($params['side']); + } } /** diff --git a/include/plugin_api.inc.php b/include/plugin_api.inc.php index 5350256..8b6d411 100644 --- a/include/plugin_api.inc.php +++ b/include/plugin_api.inc.php @@ -804,7 +804,7 @@ class serendipity_plugin_api * @param string Only show a plugin with this instance ID * @return string Smarty HTML output */ - function generate_plugins($side, $tag = '', $negate = false, $class = null, $id = null) + function generate_plugins($side, $tag = '', $negate = false, $class = null, $id = null, $tpl = 'sidebar.tpl') { global $serendipity; @@ -861,7 +861,7 @@ class serendipity_plugin_api $serendipity['smarty']->assign_by_ref('plugindata', $pluginData); $serendipity['smarty']->assign('pluginside', ucfirst($side)); - return serendipity_smarty_fetch('sidebar_'. $side, 'sidebar.tpl', true); + return serendipity_smarty_fetch('sidebar_'. $side, $tpl, true); } /** diff --git a/serendipity_config.inc.php b/serendipity_config.inc.php index b28a3df..49b2cbd 100644 --- a/serendipity_config.inc.php +++ b/serendipity_config.inc.php @@ -41,7 +41,7 @@ if (defined('USE_MEMSNAP')) { } // The version string -$serendipity['version'] = '1.3-beta1'; +$serendipity['version'] = '1.3-beta2'; // Setting this to 'false' will enable debugging output. All alpa/beta/cvs snapshot versions will emit debug information by default. To increase the debug level (to enable Smarty debugging), set this flag to 'debug'. $serendipity['production'] = (preg_match('@\-(alpha|beta|cvs)@', $serendipity['version']) ? false : true); -- 2.39.5