Index: trunk/extensions/CentralNotice/special/SpecialCentralNotice.php |
— | — | @@ -161,7 +161,7 @@ |
162 | 162 | $diffs = array_diff_assoc( $allInitialCampaignSettings[$campaignName], $finalCampaignSettings ); |
163 | 163 | // If there are changes, log them |
164 | 164 | if ( $diffs ) { |
165 | | - $campaignId = $this->getNoticeId( $campaignName ); |
| 165 | + $campaignId = CentralNotice::getNoticeId( $campaignName ); |
166 | 166 | $this->logCampaignChange( 'modified', $campaignId, $allInitialCampaignSettings[$campaignName], $finalCampaignSettings ); |
167 | 167 | } |
168 | 168 | } |
— | — | @@ -383,7 +383,7 @@ |
384 | 384 | 'method=listNoticeDetail¬ice=' . urlencode( $row->not_name ) ); |
385 | 385 | |
386 | 386 | // Projects |
387 | | - $projects = $this->getNoticeProjects( $row->not_name ); |
| 387 | + $projects = CentralNotice::getNoticeProjects( $row->not_name ); |
388 | 388 | $project_count = count( $projects ); |
389 | 389 | $projectList = ''; |
390 | 390 | if ( $project_count > 1 ) { |
— | — | @@ -405,7 +405,7 @@ |
406 | 406 | $fields[] = $projectList; |
407 | 407 | |
408 | 408 | // Languages |
409 | | - $project_langs = $this->getNoticeLanguages( $row->not_name ); |
| 409 | + $project_langs = CentralNotice::getNoticeLanguages( $row->not_name ); |
410 | 410 | $language_count = count( $project_langs ); |
411 | 411 | $languageList = ''; |
412 | 412 | if ( $language_count > 3 ) { |
— | — | @@ -711,7 +711,7 @@ |
712 | 712 | } |
713 | 713 | |
714 | 714 | $finalCampaignSettings = CentralNoticeDB::getCampaignSettings( $notice ); |
715 | | - $campaignId = $this->getNoticeId( $notice ); |
| 715 | + $campaignId = CentralNotice::getNoticeId( $notice ); |
716 | 716 | $this->logCampaignChange( 'modified', $campaignId, $initialCampaignSettings, $finalCampaignSettings ); |
717 | 717 | |
718 | 718 | // If there were no errors, reload the page to prevent duplicate form submission |
— | — | @@ -831,10 +831,10 @@ |
832 | 832 | $isEnabled = ( $campaign['enabled'] == '1' ); |
833 | 833 | $isPreferred = ( $campaign['preferred'] == '1' ); |
834 | 834 | $isLocked = ( $campaign['locked'] == '1' ); |
835 | | - $noticeProjects = $this->getNoticeProjects( $notice ); |
836 | | - $noticeLanguages = $this->getNoticeLanguages( $notice ); |
| 835 | + $noticeProjects = CentralNotice::getNoticeProjects( $notice ); |
| 836 | + $noticeLanguages = CentralNotice::getNoticeLanguages( $notice ); |
837 | 837 | $isGeotargeted = ( $campaign['geo'] == '1' ); |
838 | | - $countries = $this->getNoticeCountries( $notice ); |
| 838 | + $countries = CentralNotice::getNoticeCountries( $notice ); |
839 | 839 | } |
840 | 840 | |
841 | 841 | // Build Html |
— | — | @@ -1192,7 +1192,7 @@ |
1193 | 1193 | return; |
1194 | 1194 | } else { |
1195 | 1195 | // Log the removal of the campaign |
1196 | | - $noticeId = $this->getNoticeId( $noticeName ); |
| 1196 | + $noticeId = CentralNotice::getNoticeId( $noticeName ); |
1197 | 1197 | $this->logCampaignChange( 'removed', $noticeId ); |
1198 | 1198 | |
1199 | 1199 | $dbw = wfGetDB( DB_MASTER ); |
— | — | @@ -1212,7 +1212,7 @@ |
1213 | 1213 | $dbr = wfGetDB( DB_SLAVE ); |
1214 | 1214 | |
1215 | 1215 | $eNoticeName = htmlspecialchars ( $noticeName ); |
1216 | | - $noticeId = $this->getNoticeId( $eNoticeName ); |
| 1216 | + $noticeId = CentralNotice::getNoticeId( $eNoticeName ); |
1217 | 1217 | $templateId = $this->getTemplateId( $templateName ); |
1218 | 1218 | $res = $dbr->select( 'cn_assignments', 'asn_id', |
1219 | 1219 | array( |
— | — | @@ -1225,7 +1225,7 @@ |
1226 | 1226 | } else { |
1227 | 1227 | $dbw = wfGetDB( DB_MASTER ); |
1228 | 1228 | $dbw->begin(); |
1229 | | - $noticeId = $this->getNoticeId( $eNoticeName ); |
| 1229 | + $noticeId = CentralNotice::getNoticeId( $eNoticeName ); |
1230 | 1230 | $res = $dbw->insert( 'cn_assignments', |
1231 | 1231 | array( |
1232 | 1232 | 'tmp_id' => $templateId, |
— | — | @@ -1321,7 +1321,7 @@ |
1322 | 1322 | function removeTemplateFor( $noticeName, $templateName ) { |
1323 | 1323 | $dbw = wfGetDB( DB_MASTER ); |
1324 | 1324 | $dbw->begin(); |
1325 | | - $noticeId = $this->getNoticeId( $noticeName ); |
| 1325 | + $noticeId = CentralNotice::getNoticeId( $noticeName ); |
1326 | 1326 | $templateId = $this->getTemplateId( $templateName ); |
1327 | 1327 | $dbw->delete( 'cn_assignments', array ( 'tmp_id' => $templateId, 'not_id' => $noticeId ) ); |
1328 | 1328 | $dbw->commit(); |
— | — | @@ -1378,7 +1378,7 @@ |
1379 | 1379 | |
1380 | 1380 | function updateWeight( $noticeName, $templateId, $weight ) { |
1381 | 1381 | $dbw = wfGetDB( DB_MASTER ); |
1382 | | - $noticeId = $this->getNoticeId( $noticeName ); |
| 1382 | + $noticeId = CentralNotice::getNoticeId( $noticeName ); |
1383 | 1383 | $dbw->update( 'cn_assignments', |
1384 | 1384 | array ( 'tmp_weight' => $weight ), |
1385 | 1385 | array( |
— | — | @@ -1523,7 +1523,7 @@ |
1524 | 1524 | $dbw->begin(); |
1525 | 1525 | |
1526 | 1526 | // Get the previously assigned projects |
1527 | | - $oldProjects = $this->getNoticeProjects( $notice ); |
| 1527 | + $oldProjects = CentralNotice::getNoticeProjects( $notice ); |
1528 | 1528 | |
1529 | 1529 | // Get the notice id |
1530 | 1530 | $row = $dbw->selectRow( 'cn_notices', 'not_id', array( 'not_name' => $notice ) ); |
— | — | @@ -1552,7 +1552,7 @@ |
1553 | 1553 | $dbw->begin(); |
1554 | 1554 | |
1555 | 1555 | // Get the previously assigned languages |
1556 | | - $oldLanguages = $this->getNoticeLanguages( $notice ); |
| 1556 | + $oldLanguages = CentralNotice::getNoticeLanguages( $notice ); |
1557 | 1557 | |
1558 | 1558 | // Get the notice id |
1559 | 1559 | $row = $dbw->selectRow( 'cn_notices', 'not_id', array( 'not_name' => $notice ) ); |
— | — | @@ -1580,7 +1580,7 @@ |
1581 | 1581 | $dbw = wfGetDB( DB_MASTER ); |
1582 | 1582 | |
1583 | 1583 | // Get the previously assigned languages |
1584 | | - $oldCountries = $this->getNoticeCountries( $notice ); |
| 1584 | + $oldCountries = CentralNotice::getNoticeCountries( $notice ); |
1585 | 1585 | |
1586 | 1586 | // Get the notice id |
1587 | 1587 | $row = $dbw->selectRow( 'cn_notices', 'not_id', array( 'not_name' => $notice ) ); |
— | — | @@ -1697,7 +1697,7 @@ |
1698 | 1698 | 'notlog_user_id' => $wgUser->getId(), |
1699 | 1699 | 'notlog_action' => $action, |
1700 | 1700 | 'notlog_not_id' => $campaignId, |
1701 | | - 'notlog_not_name' => $this->getNoticeName( $campaignId ) |
| 1701 | + 'notlog_not_name' => CentralNotice::getNoticeName( $campaignId ) |
1702 | 1702 | ); |
1703 | 1703 | |
1704 | 1704 | foreach ( $beginSettings as $key => $value ) { |