r92214 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92213‎ | r92214 | r92215 >
Date:23:09, 14 July 2011
Author:kaldari
Status:ok
Tags:
Comment:
follow-up to r91522, calling static methods as static methods
Modified paths:
  • /trunk/extensions/CentralNotice/special/SpecialCentralNotice.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/special/SpecialCentralNotice.php
@@ -161,7 +161,7 @@
162162 $diffs = array_diff_assoc( $allInitialCampaignSettings[$campaignName], $finalCampaignSettings );
163163 // If there are changes, log them
164164 if ( $diffs ) {
165 - $campaignId = $this->getNoticeId( $campaignName );
 165+ $campaignId = CentralNotice::getNoticeId( $campaignName );
166166 $this->logCampaignChange( 'modified', $campaignId, $allInitialCampaignSettings[$campaignName], $finalCampaignSettings );
167167 }
168168 }
@@ -383,7 +383,7 @@
384384 'method=listNoticeDetail&notice=' . urlencode( $row->not_name ) );
385385
386386 // Projects
387 - $projects = $this->getNoticeProjects( $row->not_name );
 387+ $projects = CentralNotice::getNoticeProjects( $row->not_name );
388388 $project_count = count( $projects );
389389 $projectList = '';
390390 if ( $project_count > 1 ) {
@@ -405,7 +405,7 @@
406406 $fields[] = $projectList;
407407
408408 // Languages
409 - $project_langs = $this->getNoticeLanguages( $row->not_name );
 409+ $project_langs = CentralNotice::getNoticeLanguages( $row->not_name );
410410 $language_count = count( $project_langs );
411411 $languageList = '';
412412 if ( $language_count > 3 ) {
@@ -711,7 +711,7 @@
712712 }
713713
714714 $finalCampaignSettings = CentralNoticeDB::getCampaignSettings( $notice );
715 - $campaignId = $this->getNoticeId( $notice );
 715+ $campaignId = CentralNotice::getNoticeId( $notice );
716716 $this->logCampaignChange( 'modified', $campaignId, $initialCampaignSettings, $finalCampaignSettings );
717717
718718 // If there were no errors, reload the page to prevent duplicate form submission
@@ -831,10 +831,10 @@
832832 $isEnabled = ( $campaign['enabled'] == '1' );
833833 $isPreferred = ( $campaign['preferred'] == '1' );
834834 $isLocked = ( $campaign['locked'] == '1' );
835 - $noticeProjects = $this->getNoticeProjects( $notice );
836 - $noticeLanguages = $this->getNoticeLanguages( $notice );
 835+ $noticeProjects = CentralNotice::getNoticeProjects( $notice );
 836+ $noticeLanguages = CentralNotice::getNoticeLanguages( $notice );
837837 $isGeotargeted = ( $campaign['geo'] == '1' );
838 - $countries = $this->getNoticeCountries( $notice );
 838+ $countries = CentralNotice::getNoticeCountries( $notice );
839839 }
840840
841841 // Build Html
@@ -1192,7 +1192,7 @@
11931193 return;
11941194 } else {
11951195 // Log the removal of the campaign
1196 - $noticeId = $this->getNoticeId( $noticeName );
 1196+ $noticeId = CentralNotice::getNoticeId( $noticeName );
11971197 $this->logCampaignChange( 'removed', $noticeId );
11981198
11991199 $dbw = wfGetDB( DB_MASTER );
@@ -1212,7 +1212,7 @@
12131213 $dbr = wfGetDB( DB_SLAVE );
12141214
12151215 $eNoticeName = htmlspecialchars ( $noticeName );
1216 - $noticeId = $this->getNoticeId( $eNoticeName );
 1216+ $noticeId = CentralNotice::getNoticeId( $eNoticeName );
12171217 $templateId = $this->getTemplateId( $templateName );
12181218 $res = $dbr->select( 'cn_assignments', 'asn_id',
12191219 array(
@@ -1225,7 +1225,7 @@
12261226 } else {
12271227 $dbw = wfGetDB( DB_MASTER );
12281228 $dbw->begin();
1229 - $noticeId = $this->getNoticeId( $eNoticeName );
 1229+ $noticeId = CentralNotice::getNoticeId( $eNoticeName );
12301230 $res = $dbw->insert( 'cn_assignments',
12311231 array(
12321232 'tmp_id' => $templateId,
@@ -1321,7 +1321,7 @@
13221322 function removeTemplateFor( $noticeName, $templateName ) {
13231323 $dbw = wfGetDB( DB_MASTER );
13241324 $dbw->begin();
1325 - $noticeId = $this->getNoticeId( $noticeName );
 1325+ $noticeId = CentralNotice::getNoticeId( $noticeName );
13261326 $templateId = $this->getTemplateId( $templateName );
13271327 $dbw->delete( 'cn_assignments', array ( 'tmp_id' => $templateId, 'not_id' => $noticeId ) );
13281328 $dbw->commit();
@@ -1378,7 +1378,7 @@
13791379
13801380 function updateWeight( $noticeName, $templateId, $weight ) {
13811381 $dbw = wfGetDB( DB_MASTER );
1382 - $noticeId = $this->getNoticeId( $noticeName );
 1382+ $noticeId = CentralNotice::getNoticeId( $noticeName );
13831383 $dbw->update( 'cn_assignments',
13841384 array ( 'tmp_weight' => $weight ),
13851385 array(
@@ -1523,7 +1523,7 @@
15241524 $dbw->begin();
15251525
15261526 // Get the previously assigned projects
1527 - $oldProjects = $this->getNoticeProjects( $notice );
 1527+ $oldProjects = CentralNotice::getNoticeProjects( $notice );
15281528
15291529 // Get the notice id
15301530 $row = $dbw->selectRow( 'cn_notices', 'not_id', array( 'not_name' => $notice ) );
@@ -1552,7 +1552,7 @@
15531553 $dbw->begin();
15541554
15551555 // Get the previously assigned languages
1556 - $oldLanguages = $this->getNoticeLanguages( $notice );
 1556+ $oldLanguages = CentralNotice::getNoticeLanguages( $notice );
15571557
15581558 // Get the notice id
15591559 $row = $dbw->selectRow( 'cn_notices', 'not_id', array( 'not_name' => $notice ) );
@@ -1580,7 +1580,7 @@
15811581 $dbw = wfGetDB( DB_MASTER );
15821582
15831583 // Get the previously assigned languages
1584 - $oldCountries = $this->getNoticeCountries( $notice );
 1584+ $oldCountries = CentralNotice::getNoticeCountries( $notice );
15851585
15861586 // Get the notice id
15871587 $row = $dbw->selectRow( 'cn_notices', 'not_id', array( 'not_name' => $notice ) );
@@ -1697,7 +1697,7 @@
16981698 'notlog_user_id' => $wgUser->getId(),
16991699 'notlog_action' => $action,
17001700 'notlog_not_id' => $campaignId,
1701 - 'notlog_not_name' => $this->getNoticeName( $campaignId )
 1701+ 'notlog_not_name' => CentralNotice::getNoticeName( $campaignId )
17021702 );
17031703
17041704 foreach ( $beginSettings as $key => $value ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r91522CentralNotice settings log - adding projects, languages, and countrieskaldari03:50, 6 July 2011

Status & tagging log