Some code cleanup per Nikerabbit
authorVictor Vasiliev <vasilievvv@users.mediawiki.org>
Sun, 28 Sep 2008 16:28:35 +0000 (16:28 +0000)
committerVictor Vasiliev <vasilievvv@users.mediawiki.org>
Sun, 28 Sep 2008 16:28:35 +0000 (16:28 +0000)
includes/specials/SpecialListUserRestrictions.php
includes/specials/SpecialRemoveRestrictions.php
includes/specials/SpecialRestrictUser.php

index 3c986db..908bdc1 100644 (file)
@@ -25,8 +25,7 @@ class SpecialListUserRestrictionsForm {
        public function getHTML() {
                global $wgRequest, $wgScript, $wgTitle;
                $s = '';
-               $legend = wfMsgHtml( 'listuserrestrictions-legend' );
-               $s .= "<fieldset><legend>{$legend}</legend>";
+               $s .= Xml::fieldset( wfMsg( 'listuserrestrictions-legend' ) );
                $s .= "<form action=\"{$wgScript}\">";
                $s .= Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() );
                $s .= Xml::label( wfMsgHtml( 'listuserrestrictions-type' ), 'type' ) . '&nbsp;' .
@@ -40,7 +39,7 @@ class SpecialListUserRestrictionsForm {
                $s .= '&nbsp;';
                $s .= Xml::inputLabel( wfMsgHtml( 'listuserrestrictions-page' ), 'page', 'page',
                        false, $wgRequest->getVal( 'page' ) );
-               $s .= Xml::submitButton( wfMsgHtml( 'listuserrestrictions-submit' ) );
+               $s .= Xml::submitButton( wfMsg( 'listuserrestrictions-submit' ) );
                $s .= "</p></form></fieldset>";
                return $s;
        }
index 2c157ae..ded6cbe 100644 (file)
@@ -17,8 +17,6 @@ function wfSpecialRemoveRestrictions() {
                return;
        }
 
-       $legend = wfMsgHtml( 'removerestrictions-legend' );
-
        $form = array();
        $form['removerestrictions-user'] = $sk->userLink( $r->getSubjectId(), $r->getSubjectText() ) .
                $sk->userToolLinks( $r->getSubjectId(), $r->getSubjectText() );
@@ -34,7 +32,7 @@ function wfSpecialRemoveRestrictions() {
                $result = wfSpecialRemoveRestrictionsProcess( $r );
 
        $wgOut->addWikiMsg( 'removerestrictions-intro' );
-       $wgOut->addHTML( "<fieldset><legend>{$legend}</legend>" );
+       $wgOut->addHTML( Xml::fieldset( wfMsgHtml( 'removerestrictions-legend' ) ) );
        if( $result )
                $wgOut->addHTML( '<strong class="success">' . wfMsgExt( 'removerestrictions-success',
                        'parseinline', $r->getSubjectText() ) . '</strong>' );
index 8ce4b04..d79d15c 100644 (file)
@@ -40,7 +40,7 @@ class RestrictUserForm {
        public static function selectUserForm( $val = null, $error = null ) {
                global $wgScript, $wgTitle;
                $legend = wfMsgHtml( 'restrictuser-userselect' );
-               $s  = "<fieldset><legend>{$legend}</legend><form action=\"{$wgScript}\">";
+               $s  = Xml::fieldset( $legend ) . "<form action=\"{$wgScript}\">";
                if( $error )
                        $s .= '<p>' . $error . '</p>';
                $s .= Xml::hidden( 'title', $wgTitle->getPrefixedDbKey() );
@@ -53,7 +53,7 @@ class RestrictUserForm {
        public static function existingRestrictions( $restrictions ) {
                require_once( dirname( __FILE__ ) . '/SpecialListUserRestrictions.php' );
                $legend = wfMsgHtml( 'restrictuser-existing' );
-               $s  = "<fieldset><legend>{$legend}</legend><ul>";
+               $s  = Xml::fieldset( $legend ) . '<ul>';
                foreach( $restrictions as $r )
                        $s .= UserRestrictionsPager::formatRestriction( $r );
                $s .= "</ul></fieldset>";
@@ -82,7 +82,7 @@ class RestrictUserForm {
                }
                $useRequestValues = $wgRequest->getVal( 'type' ) == UserRestriction::PAGE;
                $legend = wfMsgHtml( 'restrictuser-legend-page' );
-               $wgOut->addHTML( "<fieldset><legend>{$legend}</legend>" );
+               $wgOut->addHTML( Xml::fieldset( $legend ) );
                if( $error )
                        $wgOut->addHTML( '<strong class="error">' . $error . '</strong>' );
                if( $success )
@@ -145,7 +145,7 @@ class RestrictUserForm {
                }
                $useRequestValues = $wgRequest->getVal( 'type' ) == UserRestriction::NAMESPACE;
                $legend = wfMsgHtml( 'restrictuser-legend-namespace' );
-               $wgOut->addHTML( "<fieldset><legend>{$legend}</legend>" );
+               $wgOut->addHTML( Xml::fieldset( $legend ) );
                if( $error )
                        $wgOut->addHTML( '<strong class="error">' . $error . '</strong>' );
                if( $success )