http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73850

Revision: 73850
Author:   kaldari
Date:     2010-09-28 00:43:15 +0000 (Tue, 28 Sep 2010)

Log Message:
-----------
fix for database issue

Modified Paths:
--------------
    trunk/extensions/CentralNotice/CentralNotice.php
    trunk/extensions/CentralNotice/SpecialBannerListLoader.php

Modified: trunk/extensions/CentralNotice/CentralNotice.php
===================================================================
--- trunk/extensions/CentralNotice/CentralNotice.php    2010-09-28 00:40:06 UTC 
(rev 73849)
+++ trunk/extensions/CentralNotice/CentralNotice.php    2010-09-28 00:43:15 UTC 
(rev 73850)
@@ -98,19 +98,20 @@
        
        $wgSpecialPages['BannerController'] = 'SpecialBannerController';
        $wgAutoloadClasses['SpecialBannerController'] = $dir . 
'SpecialBannerController.php';
+       
+       $wgAutoloadClasses['CentralNoticeDB'] = $dir . 'CentralNotice.db.php';
 
        if ( $wgNoticeInfrastructure ) {
                $wgSpecialPages['CentralNotice'] = 'CentralNotice';
                $wgSpecialPageGroups['CentralNotice'] = 'wiki'; // Wiki data 
and tools"
                $wgAutoloadClasses['CentralNotice'] = $dir . 
'SpecialCentralNotice.php';
-               
+
                $wgSpecialPages['NoticeTemplate'] = 'SpecialNoticeTemplate';
                $wgAutoloadClasses['SpecialNoticeTemplate'] = $dir . 
'SpecialNoticeTemplate.php';
-               
+
                $wgSpecialPages['BannerAllocation'] = 'SpecialBannerAllocation';
                $wgAutoloadClasses['SpecialBannerAllocation'] = $dir . 
'SpecialBannerAllocation.php';
-               
-               $wgAutoloadClasses['CentralNoticeDB'] = $dir . 
'CentralNotice.db.php';
+
                $wgAutoloadClasses['TemplatePager'] = $dir . 
'TemplatePager.php';
        }
 }

Modified: trunk/extensions/CentralNotice/SpecialBannerListLoader.php
===================================================================
--- trunk/extensions/CentralNotice/SpecialBannerListLoader.php  2010-09-28 
00:40:06 UTC (rev 73849)
+++ trunk/extensions/CentralNotice/SpecialBannerListLoader.php  2010-09-28 
00:43:15 UTC (rev 73850)
@@ -7,7 +7,6 @@
        public $project; // Project name
        public $language; // Project language
        public $location; // User country
-       public $centralNoticeDB;
        protected $sharedMaxAge = 600; // Cache for 10 minutes on the server 
side
        protected $maxAge = 600; // Cache for 10 minutes on the client side
        
@@ -61,19 +60,7 @@
                // Quick short circuit to be able to show preferred notices
                $templates = array();
 
-               $templates[] = array(
-                       'name' => 'debug_begin',
-                       'weight' => 0,
-                       'display_anon' => 0,
-                       'display_account' => 0
-               );
                if ( $this->language == 'en' && $this->project != null ) {
-                       $templates[] = array(
-                               'name' => 'debug_en_preferred',
-                               'weight' => 0,
-                               'display_anon' => 0,
-                               'display_account' => 0
-                       );
                        // See if we have any preferred notices for all of en
                        $notices = CentralNoticeDB::getNotices( null, 'en', 
null, 1, 1, $this->location );
 
@@ -84,12 +71,6 @@
                }
 
                if ( !$templates && $this->project == 'wikipedia' ) {
-                       $templates[] = array(
-                               'name' => 'debug_wikipedia_preferred',
-                               'weight' => 0,
-                               'display_anon' => 0,
-                               'display_account' => 0
-                       );
                        // See if we have any preferred notices for this 
language wikipedia
                        $notices = CentralNoticeDB::getNotices( 'wikipedia', 
$this->language, false, 1, 1, $this->location );
                        
@@ -101,20 +82,9 @@
 
                // Didn't find any preferred matches so do an old style lookup
                if ( !$templates )  {
-                       $templates[] = array(
-                               'name' => 'debug_old_style_lookup',
-                               'weight' => 0,
-                               'display_anon' => 0,
-                               'display_account' => 0
-                       );
                        $templates = CentralNotice::selectNoticeTemplates( 
$this->project, $this->language, $this->location );
                }
-               $templates[] = array(
-                               'name' => 'debug_finished',
-                               'weight' => 0,
-                               'display_anon' => 0,
-                               'display_account' => 0
-                       );
+               
                return FormatJson::encode( $templates );
        }
        



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to