diff options
author | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-09-28 14:44:17 +0200 |
---|---|---|
committer | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-09-28 14:44:17 +0200 |
commit | 21d806cd5466991b4790c5e6b37a40ae35f1eecb (patch) | |
tree | cc0697b058f111f33728b76d0fe15a7b8d0683c6 /inc/template.php | |
parent | b79379f2e598abaa2febb299cdfcebe0a95d034c (diff) | |
download | rpg-21d806cd5466991b4790c5e6b37a40ae35f1eecb.tar.gz rpg-21d806cd5466991b4790c5e6b37a40ae35f1eecb.tar.bz2 |
improve some scrutinizer issues
different types
unused vars
PHPDocs
Diffstat (limited to 'inc/template.php')
-rw-r--r-- | inc/template.php | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/inc/template.php b/inc/template.php index d4357cf0e..3730495c8 100644 --- a/inc/template.php +++ b/inc/template.php @@ -456,6 +456,12 @@ function _tpl_metaheaders_action($data) { * Just builds a link. * * @author Andreas Gohr <andi@splitbrain.org> + * + * @param string $url + * @param string $name + * @param string $more + * @param bool $return if true return the link html, otherwise print + * @return bool|string html of the link, or true if printed */ function tpl_link($url, $name, $more = '', $return = false) { $out = '<a href="'.$url.'" '; @@ -472,6 +478,10 @@ function tpl_link($url, $name, $more = '', $return = false) { * Wrapper around html_wikilink * * @author Andreas Gohr <andi@splitbrain.org> + * + * @param string $id page id + * @param string|null $name link name + * @return bool true */ function tpl_pagelink($id, $name = null) { print '<bdi>'.html_wikilink($id, $name).'</bdi>'; @@ -534,6 +544,13 @@ function tpl_button($type, $return = false) { * * @author Adrian Lang <mail@adrianlang.de> * @see tpl_get_action + * + * @param string $type action name + * @param string $pre prefix of link + * @param string $suf suffix of link + * @param string $inner inner HTML for link + * @param bool $return if true it returns html, otherwise prints + * @return bool|string html of action link or false if nothing, or true if printed */ function tpl_actionlink($type, $pre = '', $suf = '', $inner = '', $return = false) { global $lang; @@ -571,7 +588,7 @@ function tpl_actionlink($type, $pre = '', $suf = '', $inner = '', $return = fals $linktarget, $pre.(($inner) ? $inner : $caption).$suf, 'class="action '.$type.'" '. $akey.$rel. - 'title="'.hsc($caption).$addTitle.'"', 1 + 'title="'.hsc($caption).$addTitle.'"', true ); } if($return) return $out; @@ -747,7 +764,6 @@ function tpl_get_action($type) { break; default: return '[unknown %s type]'; - break; } return compact('accesskey', 'type', 'id', 'method', 'params', 'nofollow', 'replacement'); } @@ -768,9 +784,9 @@ function tpl_get_action($type) { function tpl_action($type, $link = false, $wrapper = false, $return = false, $pre = '', $suf = '', $inner = '') { $out = ''; if($link) { - $out .= tpl_actionlink($type, $pre, $suf, $inner, 1); + $out .= tpl_actionlink($type, $pre, $suf, $inner, true); } else { - $out .= tpl_button($type, 1); + $out .= tpl_button($type, true); } if($out && $wrapper) $out = "<$wrapper>$out</$wrapper>"; @@ -1027,7 +1043,7 @@ function tpl_pagetitle($id = null, $ret = false) { * Only allowed in: detail.php * * @author Andreas Gohr <andi@splitbrain.org> - * @param array $tags tags to try + * @param array|string $tags tag or array of tags to try * @param string $alt alternative output if no data was found * @param null $src the image src, uses global $SRC if not given * @return string |