r46806 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46805‎ | r46806 | r46807 >
Date:18:23, 4 February 2009
Author:aaron
Status:deferred
Tags:
Comment:
(bug 17352) Improve review UI with regards to blocks
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/flaggedrevs.js (modified) (history)
  • /trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -1320,6 +1320,15 @@
13211321 }
13221322
13231323 /**
 1324+ * If user is blocked, return the ID for the block
 1325+ * @return \int Block ID
 1326+ */
 1327+ function getBlockId() {
 1328+ $this->getBlockedStatus();
 1329+ return ($this->mBlock ? $this->mBlock->mId : false);
 1330+ }
 1331+
 1332+ /**
13241333 * Check if user is blocked on all wikis.
13251334 * Do not use for actual edit permission checks!
13261335 * This is intented for quick UI checks.
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -256,7 +256,7 @@
257257 #########
258258
259259 # Bump this number every time you change flaggedrevs.css/flaggedrevs.js
260 -$wgFlaggedRevStyleVersion = 52;
 260+$wgFlaggedRevStyleVersion = 53;
261261
262262 $wgExtensionFunctions[] = 'efLoadFlaggedRevs';
263263
Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php
@@ -62,6 +62,7 @@
6363 New [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} changes] may have been made.',
6464 'revreview-basic-same' => 'This is the latest [[{{MediaWiki:Validationpage}}|sighted]] revision ([{{fullurl:Special:Stableversions|page={{FULLPAGENAMEE}}}} list all]), [{{fullurl:Special:Log|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>.',
6565 'revreview-basic-source' => 'A [{{fullurl:{{FULLPAGENAMEE}}|stableid=$1}} sighted version] of this page, [{{fullurl:Special:Log|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>, was based off this revision.',
 66+ 'revreview-blocked' => 'You cannot review this revision because your account is currently blocked ([$1 details])',
6667 'revreview-changed' => '\'\'\'The requested action could not be performed on this revision of [[:$1|$1]].\'\'\'
6768
6869 A template or image may have been requested when no specific version was specified.
Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php
@@ -154,7 +154,11 @@
155155 // Basic permission check
156156 if( $wgUser->isAllowed( 'review' ) ) {
157157 if( $wgUser->isBlocked() ) {
158 - return '<err#>';
 158+ wfLoadExtensionMessages( 'FlaggedRevs' );
 159+ $blocklist = SpecialPage::getTitleFor( 'Ipblocklist' );
 160+ $blocklog = $blocklist->getFullUrl( 'ip=' . urlencode('#'.$wgUser->getBlockId()) );
 161+ return '<err#><h2>'.wfMsgHtml('blockedtitle').'</h2>'.
 162+ wfMsgExt('revreview-blocked','parseinline',$blocklog);
159163 }
160164 } else {
161165 return '<err#>';
Index: trunk/extensions/FlaggedRevs/flaggedrevs.js
@@ -342,7 +342,9 @@
343343 if( submit ) {
344344 submit.value = wgAjaxReview.sentMsg;
345345 }
346 - wgAjaxReview.unlockForm();
 346+ if( response.indexOf('<suc#>') == 0 ) {
 347+ wgAjaxReview.unlockForm();
 348+ }
347349 document.title = wgAjaxReview.actioncomplete;
348350 };
349351

Status & tagging log