summaryrefslogtreecommitdiff
path: root/inc/template.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2008-10-12 13:31:50 +0200
committerAndreas Gohr <andi@splitbrain.org>2008-10-12 13:31:50 +0200
commit066fee3089513b988d1beac2040e32a365921310 (patch)
treee20413f725f57ec6071c66b745fc25bea2e08b55 /inc/template.php
parent7aedde2e62651d550e6213d3852447b26255e8de (diff)
downloadrpg-066fee3089513b988d1beac2040e32a365921310.tar.gz
rpg-066fee3089513b988d1beac2040e32a365921310.tar.bz2
Make license selectable from config FS#312
darcs-hash:20081012113150-7ad00-6408da058bdb6c923159d445e03b76f54b579362.gz
Diffstat (limited to 'inc/template.php')
-rw-r--r--inc/template.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/inc/template.php b/inc/template.php
index 5db135a84..3f7badf93 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -1290,5 +1290,39 @@ function tpl_actiondropdown($empty='',$button='&gt;'){
echo '</form>';
}
+/**
+ * Print a informational line about the used license
+ *
+ * @author Andreas Gohr <andi@splitbrain.org>
+ * @param string $img - print image? (|button|badge)
+ * @param bool $return - when true don't print, but return HTML
+ */
+function tpl_license($img='badge',$return=false){
+ global $license;
+ global $conf;
+ global $lang;
+ if(!$conf['license']) return '';
+ if(!is_array($license[$conf['license']])) return '';
+ $lic = $license[$conf['license']];
+
+ $out = '<p class="license">';
+ if($img){
+ $src = license_img($img);
+ if($src){
+ $out .= '<a href="'.$lic['url'].'" rel="license"';
+ if($conf['target']['external']) $out .= ' target="'.$conf['target']['external'].'"';
+ $out .= '><img src="'.DOKU_BASE.$src.'" class="lic'.$button.'" alt="'.$lic['name'].'" align="left" /></a>';
+ }
+ }
+ $out .= $lang['license'];
+ $out .= '<a href="'.$lic['url'].'" rel="license" class="urlextern"';
+ if($conf['target']['external']) $out .= ' target="'.$conf['target']['external'].'"';
+ $out .= '> '.$lic['name'].'</a>';
+ $out .= '</p>';
+
+ if($return) return $out;
+ echo $out;
+}
+
//Setup VIM: ex: et ts=4 enc=utf-8 :