From 80083a41ce7a4ccf3132621757c333c535179dbe Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 10 Mar 2012 17:25:02 +0100 Subject: made tpl_license a bit more flexible This way there's less custom code for the footer buttons needed --- inc/template.php | 18 +++++++++++++----- 1 file 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='>'){ * @author Andreas Gohr * @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 = '
'; + $out = ''; + if($wrap) $out .= '
'; if($img){ $src = license_img($img); if($src){ + if(!$imgonly){ + $left = 'medialeft'; + }else{ + $left = ''; + } + $out .= ' '; + $out .= '>'.$lic['name'].' '; } } if(!$imgonly) { $out .= $lang['license']; - $out .= ' '; } - $out .= '
'; + if($wrap) $out .= '
'; if($return) return $out; echo $out; -- cgit v1.2.3