From 835dfcaefaa402c6f7c46b222b94da30a33571bf Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sat, 6 Oct 2012 13:42:03 +0100 Subject: Removed tpl_sidebar() to avoid fatal errors in other templates Replaced it by the old tpl_include_page() and made it more flexible by adding a boolean $propagate parameter. (It's false by default for backwards compatibility reasons. Should it rather be true? That would probably be what most users want.) --- inc/template.php | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index 9f17d5e32..d0b1d3e85 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1465,14 +1465,17 @@ function tpl_license($img = 'badge', $imgonly = false, $return = false, $wrap = } /** - * Includes the rendered XHTML of a given page + * Includes the rendered HTML of a given page * * This function is useful to populate sidebars or similar features in a * template */ -function tpl_include_page($pageid, $print = true) { +function tpl_include_page($pageid, $print = true, $propagate = false) { global $ID; global $TOC; + + if ($propagate) $pageid = page_findnearest($pageid); + $oldid = $ID; $oldtoc = $TOC; $html = p_wiki_xhtml($pageid, '', false); @@ -1484,17 +1487,6 @@ function tpl_include_page($pageid, $print = true) { return $html; } -/** - * Include the sidebar, will check current namespaces first - */ -function tpl_sidebar($print = true) { - global $conf; - - $sidebar = page_findnearest($conf['sidebar']); - if($sidebar) return tpl_include_page($sidebar, $print); - return ''; -} - /** * Display the subscribe form * -- cgit v1.2.3