Index: trunk/extensions/CentralNotice/SpecialBannerListLoader.php |
— | — | @@ -7,7 +7,6 @@ |
8 | 8 | public $project; // Project name |
9 | 9 | public $language; // Project language |
10 | 10 | public $location; // User country |
11 | | - public $centralNoticeDB; |
12 | 11 | protected $sharedMaxAge = 600; // Cache for 10 minutes on the server side |
13 | 12 | protected $maxAge = 600; // Cache for 10 minutes on the client side |
14 | 13 | |
— | — | @@ -61,19 +60,7 @@ |
62 | 61 | // Quick short circuit to be able to show preferred notices |
63 | 62 | $templates = array(); |
64 | 63 | |
65 | | - $templates[] = array( |
66 | | - 'name' => 'debug_begin', |
67 | | - 'weight' => 0, |
68 | | - 'display_anon' => 0, |
69 | | - 'display_account' => 0 |
70 | | - ); |
71 | 64 | if ( $this->language == 'en' && $this->project != null ) { |
72 | | - $templates[] = array( |
73 | | - 'name' => 'debug_en_preferred', |
74 | | - 'weight' => 0, |
75 | | - 'display_anon' => 0, |
76 | | - 'display_account' => 0 |
77 | | - ); |
78 | 65 | // See if we have any preferred notices for all of en |
79 | 66 | $notices = CentralNoticeDB::getNotices( null, 'en', null, 1, 1, $this->location ); |
80 | 67 | |
— | — | @@ -84,12 +71,6 @@ |
85 | 72 | } |
86 | 73 | |
87 | 74 | if ( !$templates && $this->project == 'wikipedia' ) { |
88 | | - $templates[] = array( |
89 | | - 'name' => 'debug_wikipedia_preferred', |
90 | | - 'weight' => 0, |
91 | | - 'display_anon' => 0, |
92 | | - 'display_account' => 0 |
93 | | - ); |
94 | 75 | // See if we have any preferred notices for this language wikipedia |
95 | 76 | $notices = CentralNoticeDB::getNotices( 'wikipedia', $this->language, false, 1, 1, $this->location ); |
96 | 77 | |
— | — | @@ -101,20 +82,9 @@ |
102 | 83 | |
103 | 84 | // Didn't find any preferred matches so do an old style lookup |
104 | 85 | if ( !$templates ) { |
105 | | - $templates[] = array( |
106 | | - 'name' => 'debug_old_style_lookup', |
107 | | - 'weight' => 0, |
108 | | - 'display_anon' => 0, |
109 | | - 'display_account' => 0 |
110 | | - ); |
111 | 86 | $templates = CentralNotice::selectNoticeTemplates( $this->project, $this->language, $this->location ); |
112 | 87 | } |
113 | | - $templates[] = array( |
114 | | - 'name' => 'debug_finished', |
115 | | - 'weight' => 0, |
116 | | - 'display_anon' => 0, |
117 | | - 'display_account' => 0 |
118 | | - ); |
| 88 | + |
119 | 89 | return FormatJson::encode( $templates ); |
120 | 90 | } |
121 | 91 | |
Index: trunk/extensions/CentralNotice/CentralNotice.php |
— | — | @@ -98,19 +98,20 @@ |
99 | 99 | |
100 | 100 | $wgSpecialPages['BannerController'] = 'SpecialBannerController'; |
101 | 101 | $wgAutoloadClasses['SpecialBannerController'] = $dir . 'SpecialBannerController.php'; |
| 102 | + |
| 103 | + $wgAutoloadClasses['CentralNoticeDB'] = $dir . 'CentralNotice.db.php'; |
102 | 104 | |
103 | 105 | if ( $wgNoticeInfrastructure ) { |
104 | 106 | $wgSpecialPages['CentralNotice'] = 'CentralNotice'; |
105 | 107 | $wgSpecialPageGroups['CentralNotice'] = 'wiki'; // Wiki data and tools" |
106 | 108 | $wgAutoloadClasses['CentralNotice'] = $dir . 'SpecialCentralNotice.php'; |
107 | | - |
| 109 | + |
108 | 110 | $wgSpecialPages['NoticeTemplate'] = 'SpecialNoticeTemplate'; |
109 | 111 | $wgAutoloadClasses['SpecialNoticeTemplate'] = $dir . 'SpecialNoticeTemplate.php'; |
110 | | - |
| 112 | + |
111 | 113 | $wgSpecialPages['BannerAllocation'] = 'SpecialBannerAllocation'; |
112 | 114 | $wgAutoloadClasses['SpecialBannerAllocation'] = $dir . 'SpecialBannerAllocation.php'; |
113 | | - |
114 | | - $wgAutoloadClasses['CentralNoticeDB'] = $dir . 'CentralNotice.db.php'; |
| 115 | + |
115 | 116 | $wgAutoloadClasses['TemplatePager'] = $dir . 'TemplatePager.php'; |
116 | 117 | } |
117 | 118 | } |