summaryrefslogtreecommitdiff
path: root/inc/template.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2012-07-01 11:41:22 +0200
committerAndreas Gohr <andi@splitbrain.org>2012-07-01 14:35:51 +0200
commite66d3e6dfa7ba6f0cf55b58f0b00b66b52c98321 (patch)
tree9904e4a6e8c6d7c9017626e5195e3291388101b3 /inc/template.php
parent65ee48a57f42826189844ad1039c37a8a675dbab (diff)
downloadrpg-e66d3e6dfa7ba6f0cf55b58f0b00b66b52c98321.tar.gz
rpg-e66d3e6dfa7ba6f0cf55b58f0b00b66b52c98321.tar.bz2
Improved sidebar inclusion
Template authors now can use tpl_sidebar() to include the sidebar. Sidebars can be defined in subnamespaces as well
Diffstat (limited to 'inc/template.php')
-rw-r--r--inc/template.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/inc/template.php b/inc/template.php
index a18d7151f..c9e899034 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -1394,6 +1394,18 @@ function tpl_include_page($pageid,$print=true){
if(!$print) return $html;
echo $html;
+ 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 '';
}
/**