r98999 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98998‎ | r98999 | r99000 >
Date:13:43, 5 October 2011
Author:reedy
Status:ok
Tags:
Comment:
Add/update documentation
Modified paths:
  • /trunk/extensions/GlobalBlocking/SpecialGlobalBlock.php (modified) (history)
  • /trunk/extensions/OpenSearchXml/OpenSearchXml.php (modified) (history)
  • /trunk/extensions/Translate/TranslateEditAddons.php (modified) (history)
  • /trunk/extensions/Translate/scripts/sync-group.php (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -75,6 +75,10 @@
7676 $this->mPage = $this->newPage( $title );
7777 }
7878
 79+ /**
 80+ * @param $title Title
 81+ * @return WikiPage
 82+ */
7983 protected function newPage( Title $title ) {
8084 return new WikiPage( $title );
8185 }
Index: trunk/extensions/GlobalBlocking/SpecialGlobalBlock.php
@@ -63,10 +63,10 @@
6464 if (is_array($errors) && count($errors)>0) {
6565 $errorstr = $this->formatErrors( $errors );
6666 }
67 -
 67+
6868 $this->form( $errorstr );
6969 }
70 -
 70+
7171 function formatErrors( $errors ) {
7272 $errorstr = '';
7373 foreach ( $errors as $error ) {
@@ -77,22 +77,22 @@
7878 $error = array();
7979 }
8080 $errorstr .= Xml::tags( 'li', null, wfMsgExt( $msg, array( 'parseinline' ), $error ) );
81 -
 81+
8282 // Special case
8383 if ($msg == 'globalblocking-block-alreadyblocked') {
8484 $this->mModifyForm = true;
8585 }
8686 }
87 -
 87+
8888 $errorstr = Xml::tags( 'ul', null, $errorstr );
8989 $header = wfMsgExt( 'globalblocking-block-errors',
9090 'parse',
9191 array(count( $errors ))
9292 );
9393 $errorstr = "$header\n$errorstr";
94 -
 94+
9595 $errorstr = Xml::tags( 'div', array( 'class' => 'error' ), $errorstr );
96 -
 96+
9797 return $errorstr;
9898 }
9999
@@ -101,7 +101,7 @@
102102 $this->mAddress = trim( $wgRequest->getText( 'wpAddress' ) );
103103 if (!$this->mAddress)
104104 $this->mAddress = $par;
105 -
 105+
106106 $this->mReason = $wgRequest->getText( 'wpReason' );
107107 $this->mReasonList = $wgRequest->getText( 'wpBlockReasonList' );
108108 $this->mExpiry = $this->mExpirySelection = $wgRequest->getText( 'wpExpiry' );
@@ -117,12 +117,12 @@
118118 global $wgOut, $wgUser;
119119 $options = array();
120120 $skin = $wgUser->getSkin();
121 -
 121+
122122 if ($this->mAnonOnly)
123123 $options[] = 'anon-only';
124124 if ($this->mModify)
125125 $options[] = 'modify';
126 -
 126+
127127 $reasonstr = $this->mReasonList;
128128 if( $reasonstr != 'other' && $this->mReason != '' ) {
129129 // Entry from drop down menu + additional comment
@@ -132,11 +132,11 @@
133133 }
134134
135135 $errors = GlobalBlocking::block( $this->mAddress, $reasonstr, $this->mExpiry, $options );
136 -
 136+
137137 if ( count($errors) ) {
138138 return $errors;
139139 }
140 -
 140+
141141 if ($this->mModify) {
142142 $textMessage = 'globalblocking-modify-success';
143143 $subMessage = 'globalblocking-modify-successsub';
@@ -144,14 +144,14 @@
145145 $textMessage = 'globalblocking-block-success';
146146 $subMessage = 'globalblocking-block-successsub';
147147 }
148 -
 148+
149149 $wgOut->addWikitext( wfMsg($textMessage, $this->mAddress ) );
150150 $wgOut->setSubtitle( wfMsg( $subMessage ) );
151 -
 151+
152152 $link = $skin->link( SpecialPage::getTitleFor( 'GlobalBlockList' ),
153153 wfMsg( 'globalblocking-return' ) );
154154 $wgOut->addHTML( $link );
155 -
 155+
156156 return array();
157157 }
158158
@@ -178,7 +178,7 @@
179179 'id' => 'mw-globalblock-form' ) );
180180 $form .= Html::hidden( 'title', SpecialPage::getTitleFor('GlobalBlock')->getPrefixedText() );
181181
182 - $fields = array ();
 182+ $fields = array();
183183
184184 // Who to block
185185 $fields['ipaddress'] =
@@ -187,7 +187,7 @@
188188 $this->mAddress,
189189 array('id' => 'mw-globalblock-address' )
190190 );
191 -
 191+
192192 // How long to block them for
193193 $dropdown = wfMsgForContentNoTrans( 'globalblocking-expiry-options' );
194194 if ( $dropdown === '' || $dropdown == '-' ) {
@@ -199,8 +199,8 @@
200200 $dropdown = false;
201201 }
202202 }
203 -
204 - if ($dropdown == false ) {
 203+
 204+ if ( $dropdown == false ) {
205205 $fields['globalblocking-block-expiry'] =
206206 Xml::input(
207207 'wpExpiry',
@@ -224,7 +224,7 @@
225225 array( 'id' => 'mw-globalblock-expiry-selector-other' )
226226 );
227227 }
228 -
 228+
229229 // Why to block them
230230 $fields['globalblocking-block-reason'] =
231231 Xml::listDropDown(
@@ -266,7 +266,7 @@
267267
268268 #FIXME: make this actually use HTMLForm, instead of just its JavaScript
269269 $wgOut->addModules( 'mediawiki.htmlform' );
270 -
 270+
271271 $wgOut->addHTML( $form );
272272
273273 // Show loglist of previous blocks
Index: trunk/extensions/Translate/scripts/sync-group.php
@@ -385,7 +385,7 @@
386386
387387 /**
388388 * Does the actual edit.
389 - * @param $title \Title
 389+ * @param $title Title
390390 * @param $translation \string
391391 * @param $comment \string Edit summary.
392392 */
Index: trunk/extensions/Translate/TranslateEditAddons.php
@@ -414,7 +414,7 @@
415415 * when updating a translation.
416416 * Hook: Translate:newTranslation
417417 * @param $handle MessageHandle
418 - * @param $revision Revision
 418+ * @param $revision int
419419 * @param $text string
420420 * @param $user User
421421 * @return bool
Index: trunk/extensions/OpenSearchXml/OpenSearchXml.php
@@ -39,6 +39,10 @@
4040
4141 $wgOpenSearchAdvertiseXml = true;
4242
 43+/**
 44+ * @param $urls array
 45+ * @return bool
 46+ */
4347 function efOpenSearchXmlUrls( &$urls ) {
4448 global $wgEnableAPI, $wgOpenSearchAdvertiseXml;
4549 if( $wgEnableAPI && $wgOpenSearchAdvertiseXml ) {
@@ -51,6 +55,9 @@
5256 return true;
5357 }
5458
 59+/**
 60+ * @return string
 61+ */
5562 function efOpenSearchXmlTemplate() {
5663 global $wgCanonicalServer, $wgScriptPath;
5764 $ns = implode( '|', SearchEngine::defaultNamespaces() );

Status & tagging log