r92672 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92671‎ | r92672 | r92673 >
Date:19:58, 20 July 2011
Author:robin
Status:ok (Comments)
Tags:
Comment:
fixes for r92636
Modified paths:
  • /trunk/extensions/Interwiki/Interwiki_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Interwiki/Interwiki_body.php
@@ -95,8 +95,8 @@
9696 $input = array( 'class' => 'mw-input' );
9797
9898 if( $action == 'delete' ) {
99 - $topmessage = wfMessage( 'interwiki_delquestion', $prefix )->parse();
100 - $intromessage = wfMessage( 'interwiki_deleting', $prefix )->parse();
 99+ $topmessage = wfMessage( 'interwiki_delquestion', $prefix )->text();
 100+ $intromessage = wfMessage( 'interwiki_deleting', $prefix )->text();
101101 $wpPrefix = Html::hidden( 'wpInterwikiPrefix', $prefix );
102102 $button = 'delete';
103103 $formContent = '';
@@ -112,8 +112,8 @@
113113 $trans = $row->iw_trans;
114114 $local = $row->iw_local;
115115 $wpPrefix = Html::hidden( 'wpInterwikiPrefix', $row->iw_prefix );
116 - $topmessage = wfMessage( 'interwiki_edittext' )->parse();
117 - $intromessage = wfMessage( 'interwiki_editintro' )->parse();
 116+ $topmessage = wfMessage( 'interwiki_edittext' )->text();
 117+ $intromessage = wfMessage( 'interwiki_editintro' )->text();
118118 $button = 'edit';
119119 } elseif( $action == 'add' ) {
120120 $prefix = $wgRequest->getVal( 'wpInterwikiPrefix' ) ?
@@ -123,24 +123,24 @@
124124 $local = $wgRequest->getCheck( 'wpInterwikiLocal' );
125125 $trans = $wgRequest->getCheck( 'wpInterwikiTrans' );
126126 $defaulturl = $wgRequest->getVal( 'wpInterwikiURL' ) ?
127 - $wgRequest->getVal( 'wpInterwikiURL' ) : wfMessage( 'interwiki-defaulturl' );
128 - $topmessage = wfMessage( 'interwiki_addtext' )->parse();
129 - $intromessage = wfMessage( 'interwiki_addintro' )->parse();
 127+ $wgRequest->getVal( 'wpInterwikiURL' ) : wfMessage( 'interwiki-defaulturl' )->text();
 128+ $topmessage = wfMessage( 'interwiki_addtext' )->text();
 129+ $intromessage = wfMessage( 'interwiki_addintro' )->text();
130130 $button = 'interwiki_addbutton';
131131 }
132132
133133 if( $action == 'add' || $action == 'edit' ) {
134134 $formContent = Html::rawElement( 'tr', null,
135 - Html::element( 'td', $label, wfMessage( 'interwiki-prefix-label' ) ) .
 135+ Html::element( 'td', $label, wfMessage( 'interwiki-prefix-label' )->text() ) .
136136 Html::rawElement( 'td', null, '<tt>' . $prefix . '</tt>' )
137137 ) . Html::rawElement( 'tr', null,
138 - Html::rawElement( 'td', $label, Xml::label( wfMessage( 'interwiki-local-label' ), 'mw-interwiki-local' ) ) .
 138+ Html::rawElement( 'td', $label, Xml::label( wfMessage( 'interwiki-local-label' )->text(), 'mw-interwiki-local' ) ) .
139139 Html::rawElement( 'td', $input, Xml::check( 'wpInterwikiLocal', $local, array( 'id' => 'mw-interwiki-local' ) ) )
140140 ) . Html::rawElement( 'tr', null,
141 - Html::rawElement( 'td', $label, Xml::label( wfMessage( 'interwiki-trans-label' ), 'mw-interwiki-trans' ) ) .
 141+ Html::rawElement( 'td', $label, Xml::label( wfMessage( 'interwiki-trans-label' )->text(), 'mw-interwiki-trans' ) ) .
142142 Html::rawElement( 'td', $input, Xml::check( 'wpInterwikiTrans', $trans, array( 'id' => 'mw-interwiki-trans' ) ) )
143143 ) . Html::rawElement( 'tr', null,
144 - Html::rawElement( 'td', $label, Xml::label( wfMessage( 'interwiki-url-label' ), 'mw-interwiki-url' ) ) .
 144+ Html::rawElement( 'td', $label, Xml::label( wfMessage( 'interwiki-url-label' )->text(), 'mw-interwiki-url' ) ) .
145145 Html::rawElement( 'td', $input, Xml::input( 'wpInterwikiURL', 60, $defaulturl,
146146 array( 'tabindex' => 1, 'maxlength' => 200, 'id' => 'mw-interwiki-url' ) ) )
147147 );
@@ -152,7 +152,7 @@
153153 Html::rawElement( 'p', null, $intromessage ) .
154154 Html::rawElement( 'table', array( 'id' => "mw-interwiki-{$action}" ),
155155 $formContent . Html::rawElement( 'tr', null,
156 - Html::rawElement( 'td', $label, Xml::label( wfMessage( 'interwiki_reasonfield' ),
 156+ Html::rawElement( 'td', $label, Xml::label( wfMessage( 'interwiki_reasonfield' )->text(),
157157 "mw-interwiki-{$action}reason" ) ) .
158158 Html::rawElement( 'td', $input, Xml::input( 'wpInterwikiReason', 60, '',
159159 array( 'tabindex' => 1, 'id' => "mw-interwiki-{$action}reason", 'maxlength' => 200 ) ) )

Follow-up revisions

RevisionCommit summaryAuthorDate
r92973Pass default url as parameter for wgRequest->getVal( 'wpInterwikiURL' ) per ^...robin23:42, 23 July 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r92636Use wfMessage() functions, and rewrite/clean-up showForm() using Html and Xml...robin15:29, 20 July 2011

Comments

#Comment by 😂 (talk | contribs)   23:56, 22 July 2011

With $wgRequest->getVal( 'wpInterwikiURL' ), you can pass wfMessage( 'interwiki-defaulturl' )->text() as the second parameter and skip the ternary comparison. Looks ok otherwise.

#Comment by SPQRobin (talk | contribs)   23:43, 23 July 2011

Done in r92973 (also for 'prefix' & 'wpInterwikiPrefix').

Status & tagging log