r41353 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41352‎ | r41353 | r41354 >
Date:16:28, 28 September 2008
Author:vasilievvv
Status:old (Comments)
Tags:
Comment:
Some code cleanup per Nikerabbit
Modified paths:
  • /trunk/phase3/includes/specials/SpecialListUserRestrictions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRemoveRestrictions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRestrictUser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialRestrictUser.php
@@ -40,7 +40,7 @@
4141 public static function selectUserForm( $val = null, $error = null ) {
4242 global $wgScript, $wgTitle;
4343 $legend = wfMsgHtml( 'restrictuser-userselect' );
44 - $s = "<fieldset><legend>{$legend}</legend><form action=\"{$wgScript}\">";
 44+ $s = Xml::fieldset( $legend ) . "<form action=\"{$wgScript}\">";
4545 if( $error )
4646 $s .= '<p>' . $error . '</p>';
4747 $s .= Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() );
@@ -53,7 +53,7 @@
5454 public static function existingRestrictions( $restrictions ) {
5555 require_once( dirname( __FILE__ ) . '/SpecialListUserRestrictions.php' );
5656 $legend = wfMsgHtml( 'restrictuser-existing' );
57 - $s = "<fieldset><legend>{$legend}</legend><ul>";
 57+ $s = Xml::fieldset( $legend ) . '<ul>';
5858 foreach( $restrictions as $r )
5959 $s .= UserRestrictionsPager::formatRestriction( $r );
6060 $s .= "</ul></fieldset>";
@@ -82,7 +82,7 @@
8383 }
8484 $useRequestValues = $wgRequest->getVal( 'type' ) == UserRestriction::PAGE;
8585 $legend = wfMsgHtml( 'restrictuser-legend-page' );
86 - $wgOut->addHTML( "<fieldset><legend>{$legend}</legend>" );
 86+ $wgOut->addHTML( Xml::fieldset( $legend ) );
8787 if( $error )
8888 $wgOut->addHTML( '<strong class="error">' . $error . '</strong>' );
8989 if( $success )
@@ -145,7 +145,7 @@
146146 }
147147 $useRequestValues = $wgRequest->getVal( 'type' ) == UserRestriction::NAMESPACE;
148148 $legend = wfMsgHtml( 'restrictuser-legend-namespace' );
149 - $wgOut->addHTML( "<fieldset><legend>{$legend}</legend>" );
 149+ $wgOut->addHTML( Xml::fieldset( $legend ) );
150150 if( $error )
151151 $wgOut->addHTML( '<strong class="error">' . $error . '</strong>' );
152152 if( $success )
Index: trunk/phase3/includes/specials/SpecialRemoveRestrictions.php
@@ -17,8 +17,6 @@
1818 return;
1919 }
2020
21 - $legend = wfMsgHtml( 'removerestrictions-legend' );
22 -
2321 $form = array();
2422 $form['removerestrictions-user'] = $sk->userLink( $r->getSubjectId(), $r->getSubjectText() ) .
2523 $sk->userToolLinks( $r->getSubjectId(), $r->getSubjectText() );
@@ -34,7 +32,7 @@
3533 $result = wfSpecialRemoveRestrictionsProcess( $r );
3634
3735 $wgOut->addWikiMsg( 'removerestrictions-intro' );
38 - $wgOut->addHTML( "<fieldset><legend>{$legend}</legend>" );
 36+ $wgOut->addHTML( Xml::fieldset( wfMsgHtml( 'removerestrictions-legend' ) ) );
3937 if( $result )
4038 $wgOut->addHTML( '<strong class="success">' . wfMsgExt( 'removerestrictions-success',
4139 'parseinline', $r->getSubjectText() ) . '</strong>' );
Index: trunk/phase3/includes/specials/SpecialListUserRestrictions.php
@@ -25,8 +25,7 @@
2626 public function getHTML() {
2727 global $wgRequest, $wgScript, $wgTitle;
2828 $s = '';
29 - $legend = wfMsgHtml( 'listuserrestrictions-legend' );
30 - $s .= "<fieldset><legend>{$legend}</legend>";
 29+ $s .= Xml::fieldset( wfMsg( 'listuserrestrictions-legend' ) );
3130 $s .= "<form action=\"{$wgScript}\">";
3231 $s .= Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() );
3332 $s .= Xml::label( wfMsgHtml( 'listuserrestrictions-type' ), 'type' ) . '&nbsp;' .
@@ -40,7 +39,7 @@
4140 $s .= '&nbsp;';
4241 $s .= Xml::inputLabel( wfMsgHtml( 'listuserrestrictions-page' ), 'page', 'page',
4342 false, $wgRequest->getVal( 'page' ) );
44 - $s .= Xml::submitButton( wfMsgHtml( 'listuserrestrictions-submit' ) );
 43+ $s .= Xml::submitButton( wfMsg( 'listuserrestrictions-submit' ) );
4544 $s .= "</p></form></fieldset>";
4645 return $s;
4746 }

Comments

#Comment by Brion VIBBER (talk | contribs)   20:40, 30 September 2008

Backed out in r41405: unauthorized schema changes break parser tests, etc

Status & tagging log