r45599 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45598‎ | r45599 | r45600 >
Date:13:38, 9 January 2009
Author:aaron
Status:ok
Tags:
Comment:
minor cleanup
Modified paths:
  • /trunk/phase3/includes/specials/SpecialProtectedpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialProtectedpages.php
@@ -16,12 +16,12 @@
1717 public function showList( $msg = '' ) {
1818 global $wgOut, $wgRequest;
1919
20 - if ( "" != $msg ) {
 20+ if( "" != $msg ) {
2121 $wgOut->setSubtitle( $msg );
2222 }
2323
2424 // Purge expired entries on one in every 10 queries
25 - if ( !mt_rand( 0, 10 ) ) {
 25+ if( !mt_rand( 0, 10 ) ) {
2626 Title::purgeExpiredRestrictions();
2727 }
2828
@@ -37,7 +37,7 @@
3838
3939 $wgOut->addHTML( $this->showOptions( $NS, $type, $level, $sizetype, $size, $indefOnly, $cascadeOnly ) );
4040
41 - if ( $pager->getNumRows() ) {
 41+ if( $pager->getNumRows() ) {
4242 $s = $pager->getNavigationBar();
4343 $s .= "<ul>" .
4444 $pager->getBody() .
@@ -73,31 +73,34 @@
7474
7575 $description_items[] = $protType;
7676
77 - if ( $row->pr_cascade ) {
 77+ if( $row->pr_cascade ) {
7878 $description_items[] = wfMsg( 'protect-summary-cascade' );
7979 }
8080
8181 $expiry_description = '';
8282 $stxt = '';
8383
84 - if ( $row->pr_expiry != 'infinity' && strlen($row->pr_expiry) ) {
 84+ if( $row->pr_expiry != 'infinity' && strlen($row->pr_expiry) ) {
8585 $expiry = Block::decodeExpiry( $row->pr_expiry );
8686
87 - $expiry_description = wfMsg( 'protect-expiring' , $wgLang->timeanddate( $expiry ) , $wgLang->date( $expiry ) , $wgLang->time( $expiry ) );
 87+ $expiry_description = wfMsg( 'protect-expiring' , $wgLang->timeanddate( $expiry ) ,
 88+ $wgLang->date( $expiry ) , $wgLang->time( $expiry ) );
8889
8990 $description_items[] = $expiry_description;
9091 }
9192
92 - if (!is_null($size = $row->page_len)) {
 93+ if(!is_null($size = $row->page_len)) {
9394 $stxt = $wgContLang->getDirMark() . ' ' . $skin->formatRevisionSize( $size );
9495 }
9596
9697 # Show a link to the change protection form for allowed users otherwise a link to the protection log
9798 if( $wgUser->isAllowed( 'protect' ) ) {
98 - $changeProtection = ' (' . $skin->makeKnownLinkObj( $title, wfMsgHtml( 'protect_change' ), 'action=unprotect' ) . ')';
 99+ $changeProtection = ' (' . $skin->makeKnownLinkObj( $title, wfMsgHtml( 'protect_change' ),
 100+ 'action=unprotect' ) . ')';
99101 } else {
100102 $ltitle = SpecialPage::getTitleFor( 'Log' );
101 - $changeProtection = ' (' . $skin->makeKnownLinkObj( $ltitle, wfMsgHtml( 'protectlogpage' ), 'type=protect&page=' . $title->getPrefixedUrl() ) . ')';
 103+ $changeProtection = ' (' . $skin->makeKnownLinkObj( $ltitle, wfMsgHtml( 'protectlogpage' ),
 104+ 'type=protect&page=' . $title->getPrefixedUrl() ) . ')';
102105 }
103106
104107 wfProfileOut( __METHOD__ );
@@ -220,7 +223,7 @@
221224
222225 // First pass to load the log names
223226 foreach( $wgRestrictionLevels as $type ) {
224 - if ( $type !='' && $type !='*') {
 227+ if( $type !='' && $type !='*') {
225228 $text = wfMsg("restriction-level-$type");
226229 $m[$text] = $type;
227230 }
@@ -248,8 +251,9 @@
249252 public $mForm, $mConds;
250253 private $type, $level, $namespace, $sizetype, $size, $indefonly;
251254
252 - function __construct( $form, $conds = array(), $type, $level, $namespace, $sizetype='',
253 - $size=0, $indefonly = false, $cascadeonly = false ) {
 255+ function __construct( $form, $conds = array(), $type, $level, $namespace, $sizetype='', $size=0,
 256+ $indefonly = false, $cascadeonly = false )
 257+ {
254258 $this->mForm = $form;
255259 $this->mConds = $conds;
256260 $this->type = ( $type ) ? $type : 'edit';
@@ -263,15 +267,12 @@
264268 }
265269
266270 function getStartBody() {
267 - wfProfileIn( __METHOD__ );
268271 # Do a link batch query
269272 $lb = new LinkBatch;
270273 while( $row = $this->mResult->fetchObject() ) {
271274 $lb->add( $row->page_namespace, $row->page_title );
272275 }
273276 $lb->execute();
274 -
275 - wfProfileOut( __METHOD__ );
276277 return '';
277278 }
278279
@@ -284,7 +285,7 @@
285286 $conds[] = 'pr_expiry>' . $this->mDb->addQuotes( $this->mDb->timestamp() );
286287 $conds[] = 'page_id=pr_page';
287288 $conds[] = 'pr_type=' . $this->mDb->addQuotes( $this->type );
288 -
 289+
289290 if( $this->sizetype=='min' ) {
290291 $conds[] = 'page_len>=' . $this->size;
291292 } else if( $this->sizetype=='max' ) {
@@ -294,7 +295,7 @@
295296 if( $this->indefonly ) {
296297 $conds[] = "pr_expiry = 'infinity' OR pr_expiry IS NULL";
297298 }
298 - if ( $this->cascadeonly ) {
 299+ if( $this->cascadeonly ) {
299300 $conds[] = "pr_cascade = '1'";
300301 }
301302
@@ -318,8 +319,6 @@
319320 * Constructor
320321 */
321322 function wfSpecialProtectedpages() {
322 -
323323 $ppForm = new ProtectedPagesForm();
324 -
325324 $ppForm->showList();
326325 }

Status & tagging log