r51202 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51201‎ | r51202 | r51203 >
Date:17:57, 30 May 2009
Author:siebrand
Status:deferred
Tags:
Comment:
* Make more efficient by not checking userCan in foreach, but before
* Check proper if( canTranslate ) instead of the other way around
Modified paths:
  • /trunk/extensions/Translate/SpecialTranslations.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/SpecialTranslations.php
@@ -159,17 +159,19 @@
160160 // Adapted version of TranslateUtils:makeListing() by Nikerabbit
161161 $out = $tableheader;
162162
 163+ $canTranslate = $wgUser->isAllowed( 'translate' );
 164+
163165 foreach ( $res as $s ) {
164166 $key = $s->page_title;
165167 $t = Title::makeTitle( $s->page_namespace, $key );
166168
167169 $niceTitle = htmlspecialchars( $this->getTheCode( $s->page_title ) );
168170
169 - if ( !$wgUser->isAllowed( 'translate' ) ) {
 171+ if ( $canTranslate ) ) {
170172 $tools['edit'] = $sk->link(
171173 $t,
172174 $niceTitle,
173 - array(),
 175+ array( 'action'),
174176 array(
175177 'action' => 'edit',
176178 'loadgroup' => $inMessageGroup

Follow-up revisions

RevisionCommit summaryAuthorDate
r51203Fix syntax error in r51202siebrand17:58, 30 May 2009

Status & tagging log