summaryrefslogtreecommitdiff
path: root/inc/template.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2012-03-10 17:25:02 +0100
committerAndreas Gohr <andi@splitbrain.org>2012-03-10 17:27:35 +0100
commit80083a41ce7a4ccf3132621757c333c535179dbe (patch)
tree15019215546b0e43994efa0eeab5df6ad9266237 /inc/template.php
parent1cbac89c9507d874eec8bd832f6ac734b3140471 (diff)
downloadrpg-80083a41ce7a4ccf3132621757c333c535179dbe.tar.gz
rpg-80083a41ce7a4ccf3132621757c333c535179dbe.tar.bz2
made tpl_license a bit more flexible
This way there's less custom code for the footer buttons needed
Diffstat (limited to 'inc/template.php')
-rw-r--r--inc/template.php18
1 files changed, 13 insertions, 5 deletions
diff --git a/inc/template.php b/inc/template.php
index c23fd14c1..02e039b2d 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -1350,8 +1350,9 @@ function tpl_actiondropdown($empty='',$button='&gt;'){
* @author Andreas Gohr <andi@splitbrain.org>
* @param string $img - print image? (|button|badge)
* @param bool $return - when true don't print, but return HTML
+ * @param bool $wrap - wrap in div with class="license"?
*/
-function tpl_license($img='badge',$imgonly=false,$return=false){
+function tpl_license($img='badge',$imgonly=false,$return=false,$wrap=true){
global $license;
global $conf;
global $lang;
@@ -1359,22 +1360,29 @@ function tpl_license($img='badge',$imgonly=false,$return=false){
if(!is_array($license[$conf['license']])) return '';
$lic = $license[$conf['license']];
- $out = '<div class="license">';
+ $out = '';
+ if($wrap) $out .= '<div class="license">';
if($img){
$src = license_img($img);
if($src){
+ if(!$imgonly){
+ $left = 'medialeft';
+ }else{
+ $left = '';
+ }
+
$out .= '<a href="'.$lic['url'].'" rel="license"';
if($conf['target']['extern']) $out .= ' target="'.$conf['target']['extern'].'"';
- $out .= '><img src="'.DOKU_BASE.$src.'" class="medialeft lic'.$img.'" alt="'.$lic['name'].'" /></a> ';
+ $out .= '><img src="'.DOKU_BASE.$src.'" class="'.$left.' lic'.$img.'" alt="'.$lic['name'].'" /></a> ';
}
}
if(!$imgonly) {
$out .= $lang['license'];
- $out .= ' <a href="'.$lic['url'].'" rel="license" class="urlextern"';
+ $out .= '<a href="'.$lic['url'].'" rel="license" class="urlextern"';
if($conf['target']['extern']) $out .= ' target="'.$conf['target']['extern'].'"';
$out .= '>'.$lic['name'].'</a>';
}
- $out .= '</div>';
+ if($wrap) $out .= '</div>';
if($return) return $out;
echo $out;