diff options
author | Anika Henke <anika@selfthinker.org> | 2015-07-12 19:05:43 +0100 |
---|---|---|
committer | Anika Henke <anika@selfthinker.org> | 2015-07-12 19:05:43 +0100 |
commit | ae614416a5d7f5cab6c5b82a0c45f587d7fa9c01 (patch) | |
tree | ccf67b3af75257730c1b38d01d91a3d36b92376e /inc | |
parent | 619a02f57dbe49efa287f054aee381edaf3e0397 (diff) | |
download | rpg-ae614416a5d7f5cab6c5b82a0c45f587d7fa9c01.tar.gz rpg-ae614416a5d7f5cab6c5b82a0c45f587d7fa9c01.tar.bz2 |
changed all input type=submit buttons to button type=submit button for better stylability
Diffstat (limited to 'inc')
-rw-r--r-- | inc/form.php | 6 | ||||
-rw-r--r-- | inc/html.php | 18 | ||||
-rw-r--r-- | inc/template.php | 4 |
3 files changed, 17 insertions, 11 deletions
diff --git a/inc/form.php b/inc/form.php index 748983281..91a171555 100644 --- a/inc/form.php +++ b/inc/form.php @@ -400,7 +400,7 @@ function form_makeWikiText($text, $attrs=array()) { function form_makeButton($type, $act, $value='', $attrs=array()) { if ($value == '') $value = $act; $elem = array('_elem'=>'button', 'type'=>$type, '_action'=>$act, - 'value'=>$value, 'class'=>'button'); + 'value'=>$value); if (!empty($attrs['accesskey']) && empty($attrs['title'])) { $attrs['title'] = $value . ' ['.strtoupper($attrs['accesskey']).']'; } @@ -761,7 +761,9 @@ function form_wikitext($attrs) { */ function form_button($attrs) { $p = (!empty($attrs['_action'])) ? 'name="do['.$attrs['_action'].']" ' : ''; - return '<input '.$p.buildAttributes($attrs,true).' />'; + $value = $attrs['value']; + unset($attrs['value']); + return '<button '.$p.buildAttributes($attrs,true).'>'.$value.'</button>'; } /** diff --git a/inc/html.php b/inc/html.php index 2f10e3c08..1ccc056de 100644 --- a/inc/html.php +++ b/inc/html.php @@ -183,7 +183,7 @@ function html_topbtn(){ * @param bool|string $label label text, false: lookup btn_$name in localization * @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){ global $conf; global $lang; @@ -221,13 +221,15 @@ function html_btn($name,$id,$akey,$params,$method='get',$tooltip='',$label=false $tip = htmlspecialchars($label); } - $ret .= '<input type="submit" value="'.hsc($label).'" class="button" '; + $ret .= '<button type="submit" '; if($akey){ $tip .= ' ['.strtoupper($akey).']'; $ret .= 'accesskey="'.$akey.'" '; } $ret .= 'title="'.$tip.'" '; $ret .= '/>'; + $ret .= hsc($label); + $ret .= '</button>'; $ret .= '</div></form>'; return $ret; @@ -856,26 +858,28 @@ function html_recent($first=0, $show_changes='both'){ $first -= $conf['recent']; if ($first < 0) $first = 0; $form->addElement(form_makeOpenTag('div', array('class' => 'pagenav-prev'))); - $form->addElement(form_makeTag('input', array( + $form->addElement(form_makeOpenTag('button', array( 'type' => 'submit', 'name' => 'first['.$first.']', - 'value' => $lang['btn_newer'], 'accesskey' => 'n', 'title' => $lang['btn_newer'].' [N]', 'class' => 'button show' ))); + $form->addElement($lang['btn_newer']); + $form->addElement(form_makeCloseTag('button')); $form->addElement(form_makeCloseTag('div')); } if ($hasNext) { $form->addElement(form_makeOpenTag('div', array('class' => 'pagenav-next'))); - $form->addElement(form_makeTag('input', array( + $form->addElement(form_makeOpenTag('button', array( 'type' => 'submit', 'name' => 'first['.$last.']', - 'value' => $lang['btn_older'], 'accesskey' => 'p', 'title' => $lang['btn_older'].' [P]', 'class' => 'button show' ))); + $form->addElement($lang['btn_older']); + $form->addElement(form_makeCloseTag('button')); $form->addElement(form_makeCloseTag('div')); } $form->addElement(form_makeCloseTag('div')); @@ -1005,7 +1009,7 @@ function html_li_default($item){ * @param callable $func callback to print an list item * @param callable $lifunc callback to the opening li tag * @param bool $forcewrapper Trigger building a wrapper ul if the first level is - 0 (we have a root object) or 1 (just the root content) + * 0 (we have a root object) or 1 (just the root content) * @return string html of an unordered list */ function html_buildlist($data,$class,$func,$lifunc='html_li_default',$forcewrapper=false){ diff --git a/inc/template.php b/inc/template.php index 95dc52deb..86f41d0ad 100644 --- a/inc/template.php +++ b/inc/template.php @@ -834,7 +834,7 @@ function tpl_searchform($ajax = true, $autocomplete = true) { print 'placeholder="'.$lang['btn_search'].'" '; if(!$autocomplete) print 'autocomplete="off" '; print 'id="qsearch__in" accesskey="f" name="id" class="edit" title="[F]" />'; - print '<input type="submit" value="'.$lang['btn_search'].'" class="button" title="'.$lang['btn_search'].'" />'; + print '<button type="submit" title="'.$lang['btn_search'].'">'.$lang['btn_search'].'</button>'; if($ajax) print '<div id="qsearch__out" class="ajax_qsearch JSpopup"></div>'; print '</div></form>'; return true; @@ -1667,7 +1667,7 @@ function tpl_actiondropdown($empty = '', $button = '>') { echo '</optgroup>'; echo '</select>'; - echo '<input type="submit" value="'.$button.'" />'; + echo '<button type="submit">'.$button.'</button>'; echo '</div>'; echo '</form>'; } |