summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2008-06-08 13:17:36 +0200
committerAndreas Gohr <andi@splitbrain.org>2008-06-08 13:17:36 +0200
commit4b0d3916a422537378e2105801b128b99604f395 (patch)
tree2af9d9cf2559a572b6ed9a3705a6ea4098e47c0d
parent582c5bfe90443211cbd7f8f7d23932822a5783dd (diff)
downloadrpg-4b0d3916a422537378e2105801b128b99604f395.tar.gz
rpg-4b0d3916a422537378e2105801b128b99604f395.tar.bz2
let tpl_pageinfo optionally return instead of printing FS#1407
darcs-hash:20080608111736-7ad00-7dd90b1bef3e6ebfd30dba723978e07e717d353c.gz
-rw-r--r--inc/template.php42
1 files changed, 24 insertions, 18 deletions
diff --git a/inc/template.php b/inc/template.php
index 6d057463f..4ef3c0fab 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -824,7 +824,7 @@ function tpl_youarehere($sep=' &raquo; '){
$part .= $parts[$i].':';
$page = $part;
resolve_pageid('',$page,$exists);
- if ($page == $conf['start']) continue; // Skip startpage
+ if ($page == $conf['start']) continue; // Skip startpage
// output
echo $sep;
@@ -875,16 +875,16 @@ function tpl_userinfo(){
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
-function tpl_pageinfo(){
+function tpl_pageinfo($ret=false){
global $conf;
global $lang;
global $INFO;
global $REV;
global $ID;
-
+
// return if we are not allowed to view the page
- if (!auth_quickaclcheck($ID)) { return; }
-
+ if (!auth_quickaclcheck($ID)) { return false; }
+
// prepare date and path
$fn = $INFO['filepath'];
if(!$conf['fullpath']){
@@ -899,24 +899,30 @@ function tpl_pageinfo(){
// print it
if($INFO['exists']){
- print $fn;
- print ' &middot; ';
- print $lang['lastmod'];
- print ': ';
- print $date;
+ $out = '';
+ $out .= $fn;
+ $out .= ' &middot; ';
+ $out .= $lang['lastmod'];
+ $out .= ': ';
+ $out .= $date;
if($INFO['editor']){
- print ' '.$lang['by'].' ';
- print $INFO['editor'];
+ $out .= ' '.$lang['by'].' ';
+ $out .= $INFO['editor'];
}else{
- print ' ('.$lang['external_edit'].')';
+ $out .= ' ('.$lang['external_edit'].')';
}
if($INFO['locked']){
- print ' &middot; ';
- print $lang['lockedby'];
- print ': ';
- print $INFO['locked'];
+ $out .= ' &middot; ';
+ $out .= $lang['lockedby'];
+ $out .= ': ';
+ $out .= $INFO['locked'];
+ }
+ if($ret){
+ return $out;
+ }else{
+ echo $out;
+ return true;
}
- return true;
}
return false;
}