r55413 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55412‎ | r55413 | r55414 >
Date:15:53, 21 August 2009
Author:greg
Status:deferred
Tags:
Comment:
Fix some minor space vs. tabs issues.
Modified paths:
  • /trunk/extensions/CentralNotice/SpecialCentralNotice.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/SpecialCentralNotice.php
@@ -64,10 +64,10 @@
6565
6666 // Set locked/unlocked flag accordingly
6767 foreach ( $lockedNotices as $notice ) {
68 - $this->updateLock( $notice, '1' );
 68+ $this->updateLock( $notice, '1' );
6969 }
7070 foreach ( $unlockedNotices as $notice ) {
71 - $this->updateLock( $notice, '0' );
 71+ $this->updateLock( $notice, '0' );
7272 }
7373 }
7474 }
@@ -91,7 +91,7 @@
9292 }
9393 }
9494 }
95 -
 95+
9696 // Handle setting preferred
9797 $preferredNotices = $wgRequest->getArray( 'preferred' );
9898 if ( isset( $preferredNotices ) ) {
@@ -112,7 +112,7 @@
113113 CentralNoticeDB::updatePreferred( $notice, '0' );
114114 }
115115 }
116 - }
 116+ }
117117
118118 $noticeName = $wgRequest->getVal( 'notice' );
119119
@@ -134,7 +134,7 @@
135135 }
136136
137137 // Handle updates if no post content came through
138 - if ( !isset( $lockedNotices ) && $method !== 'addNotice' ) {
 138+ if ( !isset( $lockedNotices ) && $method !== 'addNotice' ) {
139139 if ( $method == 'listNoticeDetail' ) {
140140 $notice = $wgRequest->getVal ( 'notice' );
141141 $this->updateLock( $notice, 0 );
@@ -146,7 +146,7 @@
147147 }
148148 }
149149
150 - if ( !isset( $enabledNotices ) && $method !== 'addNotice' ) {
 150+ if ( !isset( $enabledNotices ) && $method !== 'addNotice' ) {
151151 if ( $method == 'listNoticeDetail' ) {
152152 $notice = $wgRequest->getVal ( 'notice' );
153153 $this->updateEnabled( $notice, 0);
@@ -158,7 +158,7 @@
159159 }
160160 }
161161
162 - if ( !isset( $preferredNotices ) && $method !== 'addNotice' ) {
 162+ if ( !isset( $preferredNotices ) && $method !== 'addNotice' ) {
163163 if ( $method == 'listNoticeDetail' ) {
164164 $notice = $wgRequest->getVal ( 'notice' );
165165 CentralNoticeDB::updatePreferred( $notice, 0 );
@@ -195,7 +195,7 @@
196196
197197 // Handle removing
198198 if ( $this->editable && $method == 'removeNotice' ) {
199 - $noticeName = $wgRequest->getVal ( 'noticeName' );
 199+ $noticeName = $wgRequest->getVal ( 'noticeName' );
200200 $this->removeNotice ( $noticeName );
201201 }
202202
@@ -229,11 +229,11 @@
230230
231231 // Update the enabled/disabled state of notice
232232 private function updateEnabled( $notice, $state ) {
233 - $dbw = wfGetDB( DB_MASTER );
234 - $dbw->begin();
235 - $res = $dbw->update( 'cn_notices',
236 - array( 'not_enabled' => $state ),
237 - array( 'not_name' => $notice )
 233+ $dbw = wfGetDB( DB_MASTER );
 234+ $dbw->begin();
 235+ $res = $dbw->update( 'cn_notices',
 236+ array( 'not_enabled' => $state ),
 237+ array( 'not_name' => $notice )
238238 );
239239 $dbw->commit();
240240 }
@@ -377,7 +377,7 @@
378378 'not_start',
379379 'not_end',
380380 'not_enabled',
381 - 'not_preferred',
 381+ 'not_preferred',
382382 'not_project',
383383 'not_language',
384384 'not_locked'
@@ -394,7 +394,7 @@
395395 'not_start',
396396 'not_end',
397397 'not_enabled',
398 - 'not_preferred',
 398+ 'not_preferred',
399399 'not_project',
400400 'not_locked'
401401 ),
@@ -480,11 +480,12 @@
481481 wfArrayMerge( $readonly,
482482 array( 'value' => $row->not_name ) ) );
483483
484 - // Preferred
485 - $fields[] =
486 - Xml::check( 'preferred[]', ( $row->not_preferred == '1' ),
487 - wfArrayMerge( $readonly,
488 - array( 'value' => $row->not_name ) ) );
 484+ // Preferred
 485+ $fields[] =
 486+ Xml::check( 'preferred[]', ( $row->not_preferred == '1' ),
 487+ wfArrayMerge( $readonly,
 488+ array( 'value' => $row->not_name ) ) );
 489+
489490 // Locked
490491 $fields[] =
491492 Xml::check( 'locked[]', ( $row->not_locked == '1' ),
@@ -650,7 +651,7 @@
651652 $htmlOut .= Xml::element( 'p' );
652653 $newPage = SpecialPage::getTitleFor( 'NoticeTemplate', 'add' );
653654 $sk = $wgUser->getSkin();
654 - $htmlOut .= $sk->makeLinkObj( $newPage, wfMsgHtml( 'centralnotice-add-template' ) );
 655+ $htmlOut .= $sk->makeLinkObj( $newPage, wfMsgHtml( 'centralnotice-add-template' ) );
655656 $htmlOut .= Xml::element( 'p' );
656657 } elseif ( $output_assigned == '' ) {
657658 $htmlOut .= wfMsg( 'centralnotice-no-templates-assigned' );
@@ -690,7 +691,7 @@
691692 'not_start',
692693 'not_end',
693694 'not_enabled',
694 - 'not_preferred',
 695+ 'not_preferred',
695696 'not_project',
696697 'not_language',
697698 'not_locked'
@@ -703,7 +704,7 @@
704705 if ( $row ) {
705706 // Build Html
706707 $htmlOut = Xml::fieldset( $notice );
707 - $htmlOut .= Xml::openElement( 'table', array( 'cellpadding' => 9 ) );
 708+ $htmlOut .= Xml::openElement( 'table', array( 'cellpadding' => 9 ) );
708709
709710 // Rows
710711 $table = array(
@@ -736,7 +737,7 @@
737738 wfArrayMerge( $readonly,
738739 array( 'value' => $row->not_name ) ) )
739740 ),
740 - // Preferred
 741+ // Preferred
741742 array(
742743 wfMsgHtml( 'centralnotice-preferred' ),
743744 Xml::check( 'preferred[]', ( $row->not_preferred == '1' ),
@@ -821,7 +822,7 @@
822823 // Rows
823824 while ( $row = $dbr->fetchObject( $res ) ) {
824825
825 - $htmlOut .= Xml::openElement( 'tr' );
 826+ $htmlOut .= Xml::openElement( 'tr' );
826827
827828 if( $this->editable ) {
828829 // Remove
@@ -909,8 +910,8 @@
910911 $htmlOut .= Xml::element( 'th', array( 'align' => 'left', 'width' => '70%' ),
911912 wfMsg ( "centralnotice-templates" ) );
912913
913 - // Find dups
914 - $templatesAssigned = $this->selectTemplatesAssigned( $notice );
 914+ // Find dups
 915+ $templatesAssigned = $this->selectTemplatesAssigned( $notice );
915916
916917 // Build rows
917918 while ( $row = $dbr->fetchObject( $res ) ) {
@@ -1054,13 +1055,13 @@
10551056 $endTs = wfTimeStamp( TS_MW, "{$end['year']}:{$end['month']}:{$start['day']} {$start['hour']}:00:00" );
10561057
10571058 $res = $dbw->insert( 'cn_notices',
1058 - array( 'not_name' => $noticeName,
1059 - 'not_enabled' => $enabled,
1060 - 'not_start' => $dbr->timestamp( $startTs ),
1061 - 'not_end' => $dbr->timestamp( $endTs ),
1062 - 'not_project' => $project_name,
1063 - 'not_language' => $project_language
1064 - )
 1059+ array( 'not_name' => $noticeName,
 1060+ 'not_enabled' => $enabled,
 1061+ 'not_start' => $dbr->timestamp( $startTs ),
 1062+ 'not_end' => $dbr->timestamp( $endTs ),
 1063+ 'not_project' => $project_name,
 1064+ 'not_language' => $project_language
 1065+ )
10651066 );
10661067 $dbw->commit();
10671068 return;
@@ -1084,7 +1085,7 @@
10851086 return;
10861087 } else {
10871088 $dbw = wfGetDB( DB_MASTER );
1088 - $dbw->begin();
 1089+ $dbw->begin();
10891090 $noticeId = htmlspecialchars( $this->getNoticeId( $noticeName ) );
10901091 $res = $dbw->delete( 'cn_assignments', array ( 'not_id' => $noticeId ) );
10911092 $res = $dbw->delete( 'cn_notices', array ( 'not_name' => $noticeName ) );
@@ -1189,7 +1190,7 @@
11901191 // Overlap over a date within the same project and language
11911192 $startDate = $dbr->timestamp( $start );
11921193 $endDate = $dbr->timestamp( $end );
1193 -
 1194+
11941195 $dbw = wfGetDB( DB_MASTER );
11951196 $dbw->begin();
11961197 $res = $dbw->update( 'cn_notices',

Status & tagging log