Add 'template' option

This commit is contained in:
Garvin Hicking 2008-02-21 09:42:50 +00:00
parent 056402151e
commit 9182557da7
4 changed files with 15 additions and 4 deletions

View File

@ -1,5 +1,11 @@
# $Id$
Version 1.3 ()
------------------------------------------------------------------------
* Add option "template" to smarty function call {serendipity_
printSidebar} (garvinhicking)
Version 1.3-beta1 (February 19th)
------------------------------------------------------------------------

View File

@ -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']);
}
}
/**

View File

@ -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);
}
/**

View File

@ -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);