summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorBen Coburn <btcoburn@silicodon.net>2006-04-11 01:43:11 +0200
committerBen Coburn <btcoburn@silicodon.net>2006-04-11 01:43:11 +0200
commita6598f23d132cda74f6901383f0d3da7da2efc9c (patch)
tree49c2377be2113be35d0f1b6e3aad7b3cccbc7299 /inc
parentbfd68419cf89a52facf2a029d191673643c3cf70 (diff)
downloadrpg-a6598f23d132cda74f6901383f0d3da7da2efc9c.tar.gz
rpg-a6598f23d132cda74f6901383f0d3da7da2efc9c.tar.bz2
pagetitle as template pagename
Uses the first heading as the page name in the default template if $conf['useheading'] is set. Updates tpl_pagetitle() so that it can return this value. darcs-hash:20060410234311-05dcb-b4636f7c0d8f98658a6097ea9ee4dff1ee2de8b4.gz
Diffstat (limited to 'inc')
-rw-r--r--inc/template.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/inc/template.php b/inc/template.php
index c1848dd79..64c87d583 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -815,14 +815,14 @@ function tpl_mediauploadform(){
}
/**
- * Prints the name of the given page (current one if none given).
+ * Prints or returns the name of the given page (current one if none given).
*
* If useheading is enabled this will use the first headline else
- * the given ID is printed.
+ * the given ID is used.
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
-function tpl_pagetitle($id=null){
+function tpl_pagetitle($id=null, $ret=false){
global $conf;
if(is_null($id)){
global $ID;
@@ -834,7 +834,12 @@ function tpl_pagetitle($id=null){
$title = p_get_first_heading($id);
if ($title) $name = $title;
}
- print hsc($name);
+
+ if ($ret) {
+ return hsc($name);
+ } else {
+ print hsc($name);
+ }
}
/**