r80537 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80536‎ | r80537 | r80538 >
Date:23:57, 18 January 2011
Author:yaron
Status:deferred
Tags:
Comment:
Improved setting of HTML for minorEditInputHTML()
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormUtils.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormUtils.php
@@ -84,17 +84,26 @@
8585 global $sfgTabIndex;
8686
8787 $sfgTabIndex++;
88 - $disabled_text = ( $is_disabled ) ? " disabled" : "";
8988 if ( $label == null )
9089 $label = wfMsgExt( 'minoredit', array( 'parseinline' ) );
91 - $accesskey = wfMsg( 'accesskey-minoredit' );
9290 $tooltip = wfMsg( 'tooltip-minoredit' );
93 - $attr = Xml::expandAttributes( $attr );
94 - $text = <<<END
95 - <input tabindex="$sfgTabIndex" type="checkbox" value="" name="wpMinoredit" accesskey="$accesskey" id="wpMinoredit"$disabled_text$attr/>
96 - <label for="wpMinoredit" title="$tooltip">$label</label>
 91+ $attrs = $attr + array(
 92+ 'type' => 'checkbox',
 93+ 'value' => '',
 94+ 'name' => 'wpMinoredit'
 95+ 'id' => 'wpMinoredit',
 96+ 'accesskey' => wfMsg( 'accesskey-minoredit' ),
 97+ 'tabindex' => $sfgTabIndex,
 98+ );
 99+ if ( $is_disabled ) {
 100+ $attrs['disabled'] = 'disabled';
 101+ }
 102+ $text = "\t" . Xml::element( 'input', $attrs ) . "\n";
 103+ $text .= "\t" . Xml::element( 'input', array(
 104+ 'for' => 'wpMinoredit',
 105+ 'title' => $tooltip
 106+ ), $label ) . "\n";
97107
98 -END;
99108 return $text;
100109 }
101110
@@ -223,8 +232,9 @@
224233 global $sfgTabIndex;
225234
226235 $sfgTabIndex++;
227 - if ( $label == null )
 236+ if ( $label == null ) {
228237 $label = wfMsg( 'runquery' );
 238+ }
229239 return self::buttonHTML( $attr + array(
230240 'id' => 'wpRunQuery',
231241 'name' => 'wpRunQuery',