diff options
author | Michael Große <grosse@cosmocode.de> | 2018-01-18 19:43:45 +0100 |
---|---|---|
committer | Michael Große <grosse@cosmocode.de> | 2018-01-18 19:45:07 +0100 |
commit | 679dba01b427ea0357528be367261c2d30a26b22 (patch) | |
tree | 01cbc5871b62253638347588f2426ac8b4b55566 /inc/html.php | |
parent | 296321122f34c3170c5ac7a59548b61c91131ed7 (diff) | |
download | dokuwiki-679dba01b427ea0357528be367261c2d30a26b22.tar.gz dokuwiki-679dba01b427ea0357528be367261c2d30a26b22.zip |
feat: add optionally an SVG to html_btn
Diffstat (limited to 'inc/html.php')
-rw-r--r-- | inc/html.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/inc/html.php b/inc/html.php index b8465a641..cebff851e 100644 --- a/inc/html.php +++ b/inc/html.php @@ -188,9 +188,10 @@ function html_topbtn(){ * @param string $method * @param string $tooltip * @param bool|string $label label text, false: lookup btn_$name in localization + * @param string $inlineSVG (optional) inlineSVG code, inserted into the button * @return string */ -function html_btn($name, $id, $akey, $params, $method='get', $tooltip='', $label=false){ +function html_btn($name, $id, $akey, $params, $method='get', $tooltip='', $label=false, $inlineSVG=null){ global $conf; global $lang; @@ -233,7 +234,12 @@ function html_btn($name, $id, $akey, $params, $method='get', $tooltip='', $label $ret .= 'accesskey="'.$akey.'" '; } $ret .= 'title="'.$tip.'">'; - $ret .= hsc($label); + if ($inlineSVG) { + $ret .= '<span>' . hsc($label) . '</span>'; + $ret .= $inlineSVG; + } else { + $ret .= hsc($label); + } $ret .= '</button>'; $ret .= '</div></form>'; @@ -2314,4 +2320,4 @@ function html_sizechange($sizechange, Doku_Form $form) { $form->addElement($value); $form->addElement(form_makeCloseTag('span')); } -}
\ No newline at end of file +} |