Index: branches/wmf/1.18wmf1/extensions/CentralNotice/special/SpecialCentralNotice.php |
— | — | @@ -1102,6 +1102,7 @@ |
1103 | 1103 | function addCampaign( $noticeName, $enabled, $start, $projects, |
1104 | 1104 | $project_languages, $geotargeted, $geo_countries ) |
1105 | 1105 | { |
| 1106 | + $noticeName = trim( $noticeName ); |
1106 | 1107 | if ( CentralNoticeDB::campaignExists( $noticeName ) ) { |
1107 | 1108 | $this->showError( 'centralnotice-notice-exists' ); |
1108 | 1109 | return null; |
— | — | @@ -1669,7 +1670,9 @@ |
1670 | 1671 | * @return multiple select list |
1671 | 1672 | */ |
1672 | 1673 | function geoMultiSelector( $selected = array() ) { |
1673 | | - $countries = CentralNoticeDB::getCountriesList(); |
| 1674 | + global $wgLang; |
| 1675 | + $userLanguageCode = $wgLang->getCode(); |
| 1676 | + $countries = CentralNoticeDB::getCountriesList( $userLanguageCode ); |
1674 | 1677 | $options = "\n"; |
1675 | 1678 | foreach( $countries as $code => $name ) { |
1676 | 1679 | $options .= Xml::option( |
Property changes on: branches/wmf/1.18wmf1/extensions/CentralNotice/special/SpecialCentralNotice.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1677 | 1680 | Merged /trunk/extensions/CentralNotice/special/SpecialCentralNotice.php:r103297,104003,104210,104999,105015,105740,105800,106166,106227,106497,106552,106846,106849,106866,106873,106914 |
Index: branches/wmf/1.18wmf1/extensions/CentralNotice/special/SpecialBannerAllocation.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | * Handle different types of page requests |
16 | 16 | */ |
17 | 17 | function execute( $sub ) { |
18 | | - global $wgOut, $wgRequest, $wgExtensionAssetsPath, $wgNoticeProjects, $wgLanguageCode, $wgNoticeProject; |
| 18 | + global $wgOut, $wgLang, $wgRequest, $wgExtensionAssetsPath, $wgNoticeProjects, $wgLanguageCode, $wgNoticeProject; |
19 | 19 | |
20 | 20 | $locationSubmitted = false; |
21 | 21 | |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | $this->setHeaders(); |
34 | 34 | |
35 | 35 | // Output ResourceLoader module for styling and javascript functions |
36 | | - $wgOut->addModules( 'ext.centralNotice.interface' ); |
| 36 | + $wgOut->addModules( array( 'ext.centralNotice.interface', 'ext.centralNotice.bannerStats' ) ); |
37 | 37 | |
38 | 38 | // Initialize error variable |
39 | 39 | $this->centralNoticeError = false; |
— | — | @@ -99,7 +99,8 @@ |
100 | 100 | $htmlOut .= Xml::tags( 'td', array(), wfMsg( 'centralnotice-country' ) ); |
101 | 101 | $htmlOut .= Html::openElement( 'td' ); |
102 | 102 | |
103 | | - $countries = CentralNoticeDB::getCountriesList(); |
| 103 | + $userLanguageCode = $wgLang->getCode(); |
| 104 | + $countries = CentralNoticeDB::getCountriesList( $userLanguageCode ); |
104 | 105 | |
105 | 106 | $htmlOut .= Html::openElement( 'select', array( 'name' => 'country' ) ); |
106 | 107 | |
— | — | @@ -160,23 +161,34 @@ |
161 | 162 | |
162 | 163 | $bannerList = $bannerLister->getJsonList(); |
163 | 164 | $banners = FormatJson::decode( $bannerList, true ); |
| 165 | + $campaigns = array(); |
164 | 166 | $anonBanners = array(); |
165 | 167 | $accountBanners = array(); |
166 | 168 | $anonWeight = 0; |
167 | 169 | $accountWeight = 0; |
168 | 170 | |
169 | 171 | if ( $banners ) { |
| 172 | + |
170 | 173 | foreach ( $banners as $banner ) { |
171 | | - if ($banner['display_anon']) { |
| 174 | + if ( $banner['display_anon'] ) { |
172 | 175 | $anonBanners[] = $banner; |
173 | 176 | $anonWeight += $banner['weight']; |
174 | 177 | } |
175 | 178 | |
176 | | - if ($banner['display_account']) { |
| 179 | + if ( $banner['display_account'] ) { |
177 | 180 | $accountBanners[] = $banner; |
178 | 181 | $accountWeight += $banner['weight']; |
179 | 182 | } |
| 183 | + |
| 184 | + if ( $banner['campaign'] ) { |
| 185 | + $campaigns[] = $banner['campaign']; |
| 186 | + } |
180 | 187 | } |
| 188 | + |
| 189 | + // Build campaign list for bannerstats.js |
| 190 | + $campaignList = FormatJson::encode( $campaigns ); |
| 191 | + $js = "wgCentralNoticeAllocationCampaigns = $campaignList;"; |
| 192 | + $htmlOut .= Html::inlineScript( $js ); |
181 | 193 | |
182 | 194 | if ( $anonBanners && $anonWeight > 0 ) { |
183 | 195 | $htmlOut .= $this->getTable( wfMsg ( 'centralnotice-banner-anonymous' ), $anonBanners, $anonWeight ); |
— | — | @@ -223,12 +235,16 @@ |
224 | 236 | |
225 | 237 | $htmlOut .= wfMsg ( 'percent', $wgLang->formatNum( $percentage ) ); |
226 | 238 | $htmlOut .= Html::closeElement( 'td' ); |
227 | | - $htmlOut .= Xml::tags( 'td', array( 'valign' => 'top' ), |
| 239 | + |
| 240 | + $htmlOut .= Xml::openElement( 'td', array( 'valign' => 'top' ) ); |
| 241 | + // The span class is used by bannerstats.js to find where to insert the stats |
| 242 | + $htmlOut .= Html::openElement( 'span', |
| 243 | + array( 'class' => 'cn-'.$banner['campaign'].'-'.$banner['name'] ) ); |
| 244 | + $htmlOut .= $sk->makeLinkObj( $viewBanner, htmlspecialchars( $banner['name'] ), |
| 245 | + 'template=' . urlencode( $banner['name'] ) ); |
| 246 | + $htmlOut .= Html::closeElement( 'span' ); |
| 247 | + $htmlOut .= Html::closeElement( 'td' ); |
228 | 248 | |
229 | | - $sk->makeLinkObj( $viewBanner, htmlspecialchars( $banner['name'] ), |
230 | | - 'template=' . urlencode( $banner['name'] ) ) |
231 | | - ); |
232 | | - |
233 | 249 | $htmlOut .= Xml::tags( 'td', array( 'valign' => 'top' ), |
234 | 250 | |
235 | 251 | $sk->makeLinkObj( $viewCampaign, htmlspecialchars( $banner['campaign'] ), |
Property changes on: branches/wmf/1.18wmf1/extensions/CentralNotice/special/SpecialBannerAllocation.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
236 | 252 | Merged /trunk/extensions/CentralNotice/special/SpecialBannerAllocation.php:r104003,104210,104999,105015,105740,105800,106166,106227,106497,106552,106846,106849,106866,106873,106914 |
Index: branches/wmf/1.18wmf1/extensions/CentralNotice/special/SpecialBannerLoader.php |
— | — | @@ -111,6 +111,8 @@ |
112 | 112 | |
113 | 113 | /** |
114 | 114 | * Extract a message name and send to getMessage() for translation |
| 115 | + * If the field is 'amount', get the current fundraiser donation amount and pass it as a |
| 116 | + * parameter to the message. |
115 | 117 | * @param $match A message array with 2 members: raw match, short name of message |
116 | 118 | * @return translated messsage string |
117 | 119 | * @throws SpecialBannerLoaderException |
— | — | @@ -118,9 +120,17 @@ |
119 | 121 | function getNoticeField( $match ) { |
120 | 122 | $field = $match[1]; |
121 | 123 | $params = array(); |
122 | | - if ( $field == 'amount' ) { |
123 | | - $params = array( $this->toMillions( $this->getDonationAmount() ) ); |
| 124 | + |
| 125 | + // Handle "magic messages" |
| 126 | + switch ( $field ) { |
| 127 | + case 'amount': // total fundraising amount |
| 128 | + $params = array( $this->toMillions( $this->getDonationAmount() ) ); |
| 129 | + break; |
| 130 | + case 'daily-amount': // daily fundraising amount |
| 131 | + $params = array( $this->toThousands( $this->getDailyDonationAmount() ) ); |
| 132 | + break; |
124 | 133 | } |
| 134 | + |
125 | 135 | $message = "centralnotice-{$this->bannerName}-$field"; |
126 | 136 | $source = $this->getMessage( $message, $params ); |
127 | 137 | return $source; |
— | — | @@ -137,6 +147,15 @@ |
138 | 148 | $lang = Language::factory( $this->language ); |
139 | 149 | return $lang->formatNum( $num ); |
140 | 150 | } |
| 151 | + |
| 152 | + /** |
| 153 | + * Convert number of dollars to thousands of dollars |
| 154 | + */ |
| 155 | + private function toThousands( $num ) { |
| 156 | + $num = sprintf( "%d", $num / 1000 ); |
| 157 | + $lang = Language::factory( $this->language ); |
| 158 | + return $lang->formatNum( $num ); |
| 159 | + } |
141 | 160 | |
142 | 161 | /** |
143 | 162 | * Retrieve a translated message |
— | — | @@ -196,6 +215,37 @@ |
197 | 216 | return $count; |
198 | 217 | } |
199 | 218 | |
| 219 | + /** |
| 220 | + * Pull the amount raised so far today during a fundraiser |
| 221 | + * @throws SpecialBannerLoaderException |
| 222 | + */ |
| 223 | + private function getDailyDonationAmount() { |
| 224 | + global $wgNoticeDailyCounterSource, $wgMemc; |
| 225 | + // Pull short-cached amount |
| 226 | + $count = intval( $wgMemc->get( wfMemcKey( 'centralnotice', 'dailycounter' ) ) ); |
| 227 | + if ( !$count ) { |
| 228 | + // Pull from dynamic counter |
| 229 | + $counter_value = Http::get( $wgNoticeDailyCounterSource ); |
| 230 | + if( !$counter_value ) { |
| 231 | + throw new RemoteServerProblemException(); |
| 232 | + } |
| 233 | + $count = intval( $counter_value ); |
| 234 | + if ( !$count ) { |
| 235 | + // Pull long-cached amount |
| 236 | + $count = intval( $wgMemc->get( |
| 237 | + wfMemcKey( 'centralnotice', 'dailycounter', 'fallback' ) ) ); |
| 238 | + if ( !$count ) { |
| 239 | + throw new DonationAmountUnknownException(); |
| 240 | + } |
| 241 | + } |
| 242 | + // Expire in 60 seconds |
| 243 | + $wgMemc->set( wfMemcKey( 'centralnotice', 'dailycounter' ), $count, 60 ); |
| 244 | + // No expiration |
| 245 | + $wgMemc->set( wfMemcKey( 'centralnotice', 'dailycounter', 'fallback' ), $count ); |
| 246 | + } |
| 247 | + return $count; |
| 248 | + } |
| 249 | + |
200 | 250 | function getFundraising( $bannerName ) { |
201 | 251 | global $wgCentralDBname; |
202 | 252 | $dbr = wfGetDB( DB_SLAVE, array(), $wgCentralDBname ); |
Property changes on: branches/wmf/1.18wmf1/extensions/CentralNotice/special/SpecialBannerLoader.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
203 | 253 | Merged /trunk/extensions/CentralNotice/special/SpecialBannerLoader.php:r105740,105800,106166,106227,106497,106552,106846,106849,106866,106873,106914 |
Index: branches/wmf/1.18wmf1/extensions/CentralNotice/special/SpecialNoticeTemplate.php |
— | — | @@ -513,7 +513,8 @@ |
514 | 514 | $htmlOut .= Xml::fieldset( wfMsg( 'centralnotice-change-lang' ) ); |
515 | 515 | $htmlOut .= Html::hidden( 'template', $currentTemplate ); |
516 | 516 | $htmlOut .= Html::openElement( 'table', array ( 'cellpadding' => 9 ) ); |
517 | | - list( $lsLabel, $lsSelect ) = Xml::languageSelector( $wpUserLang ); |
| 517 | + // Retrieve the language list |
| 518 | + list( $lsLabel, $lsSelect ) = Xml::languageSelector( $wpUserLang, true, $wgLang->getCode() ); |
518 | 519 | |
519 | 520 | $newPage = $this->getTitle( 'view' ); |
520 | 521 | |
Property changes on: branches/wmf/1.18wmf1/extensions/CentralNotice/special/SpecialNoticeTemplate.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
521 | 522 | Merged /trunk/extensions/CentralNotice/special/SpecialNoticeTemplate.php:r106846,106849,106866,106873,106914 |
Index: branches/wmf/1.18wmf1/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php |
— | — | @@ -90,7 +90,7 @@ |
91 | 91 | '<img src="'.$wgExtensionAssetsPath.'/CentralNotice/collapsed.png" id="cn-collapsed-filter-arrow" style="display:inline-block;position:relative;top:-2px;"/>'. |
92 | 92 | '<img src="'.$wgExtensionAssetsPath.'/CentralNotice/uncollapsed.png" id="cn-uncollapsed-filter-arrow" style="display:none;position:relative;top:-2px;"/>'. |
93 | 93 | '</a>'; |
94 | | - $htmlOut .= Xml::tags( 'span', array( 'style' => 'margin-left: 0.3em;' ), 'Log filters' ); |
| 94 | + $htmlOut .= Xml::tags( 'span', array( 'style' => 'margin-left: 0.3em;' ), wfMsg( 'centralnotice-filters' ) ); |
95 | 95 | $htmlOut .= Xml::openElement( 'div', array( 'id' => 'cn-log-filters', 'style' => 'display:none;' ) ); |
96 | 96 | } |
97 | 97 | |
Property changes on: branches/wmf/1.18wmf1/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
98 | 98 | Merged /trunk/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php:r106227,106497,106552,106846,106849,106866,106873,106914 |
Index: branches/wmf/1.18wmf1/extensions/CentralNotice/CentralNotice.php |
— | — | @@ -47,6 +47,7 @@ |
48 | 48 | |
49 | 49 | // Source for live counter information |
50 | 50 | $wgNoticeCounterSource = 'http://wikimediafoundation.org/wiki/Special:ContributionTotal?action=raw'; |
| 51 | +$wgNoticeDailyCounterSource = 'http://wikimediafoundation.org/wiki/Special:DailyTotal?action=raw'; |
51 | 52 | |
52 | 53 | // Domain to set global cookies for. |
53 | 54 | // Example: '.wikipedia.org' |
— | — | @@ -86,8 +87,16 @@ |
87 | 88 | 'remoteExtPath' => 'CentralNotice', |
88 | 89 | 'scripts' => 'centralnotice.js', |
89 | 90 | 'styles' => 'centralnotice.css', |
90 | | - 'messages' => 'centralnotice-documentwrite-error' |
| 91 | + 'messages' => array( |
| 92 | + 'centralnotice-documentwrite-error', |
| 93 | + 'centralnotice-close-title', |
| 94 | + ) |
91 | 95 | ); |
| 96 | +$wgResourceModules['ext.centralNotice.bannerStats'] = array( |
| 97 | + 'localBasePath' => dirname( __FILE__ ), |
| 98 | + 'remoteExtPath' => 'CentralNotice', |
| 99 | + 'scripts' => 'bannerstats.js', |
| 100 | +); |
92 | 101 | |
93 | 102 | // Temporary setting to enable and configure info for Harvard banner on en.wikipedia.org |
94 | 103 | $wgNoticeBanner_Harvard2011 = array( |
— | — | @@ -105,6 +114,9 @@ |
106 | 115 | return true; |
107 | 116 | } |
108 | 117 | |
| 118 | +/** |
| 119 | + * Called through wgExtensionFunctions |
| 120 | + */ |
109 | 121 | function efCentralNoticeSetup() { |
110 | 122 | global $wgHooks, $wgNoticeInfrastructure, $wgAutoloadClasses, $wgSpecialPages; |
111 | 123 | global $wgCentralNoticeLoader, $wgSpecialPageGroups; |
— | — | @@ -148,7 +160,7 @@ |
149 | 161 | |
150 | 162 | $wgSpecialPages['CentralNoticeLogs'] = 'SpecialCentralNoticeLogs'; |
151 | 163 | $wgAutoloadClasses['SpecialCentralNoticeLogs'] = $specialDir . 'SpecialCentralNoticeLogs.php'; |
152 | | - |
| 164 | + |
153 | 165 | $wgAutoloadClasses['TemplatePager'] = $dir . 'TemplatePager.php'; |
154 | 166 | $wgAutoloadClasses['CentralNoticePager'] = $dir . 'CentralNoticePager.php'; |
155 | 167 | $wgAutoloadClasses['CentralNoticeCampaignLogPager'] = $dir . 'CentralNoticeCampaignLogPager.php'; |
— | — | @@ -255,9 +267,7 @@ |
256 | 268 | |
257 | 269 | // Initialize global Javascript variables. We initialize Geo with empty values so if the geo |
258 | 270 | // IP lookup fails we don't have any surprises. |
259 | | - $geo = (object)array(); |
260 | | - $geo->{'city'} = ''; |
261 | | - $geo->{'country'} = ''; |
| 271 | + $geo = array( 'city' => '', 'country' => '' ); |
262 | 272 | $vars['Geo'] = $geo; // change this to wgGeo as soon as Mark updates on his end |
263 | 273 | $vars['wgNoticeProject'] = $wgNoticeProject; |
264 | 274 | |
— | — | @@ -319,7 +329,7 @@ |
320 | 330 | // "username" the user's username |
321 | 331 | $postData['username'] = $wgUser->getName(); |
322 | 332 | |
323 | | - // Security checksum. Prevent users from entering the survey with invalid metrics |
| 333 | + // Security checksum. Prevent users from entering the survey with invalid metrics |
324 | 334 | $postData['secretkey'] = md5( $salt . serialize( $hashData ) ); |
325 | 335 | |
326 | 336 | // MD5 hash |
Property changes on: branches/wmf/1.18wmf1/extensions/CentralNotice/CentralNotice.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
327 | 337 | Merged /trunk/extensions/CentralNotice/CentralNotice.php:r104003,104210,104999,105015,105740,105800,106166,106227,106497,106552,106846,106849,106866,106873,106914 |
Index: branches/wmf/1.18wmf1/extensions/CentralNotice/CentralNoticeBannerLogPager.php |
— | — | @@ -6,17 +6,17 @@ |
7 | 7 | function __construct( $special ) { |
8 | 8 | $this->special = $special; |
9 | 9 | parent::__construct($special); |
10 | | - |
| 10 | + |
11 | 11 | $this->viewPage = SpecialPage::getTitleFor( 'NoticeTemplate', 'view' ); |
12 | 12 | } |
13 | | - |
| 13 | + |
14 | 14 | /** |
15 | 15 | * Sort the log list by timestamp |
16 | 16 | */ |
17 | 17 | function getIndexField() { |
18 | 18 | return 'tmplog_timestamp'; |
19 | 19 | } |
20 | | - |
| 20 | + |
21 | 21 | /** |
22 | 22 | * Pull log entries from the database |
23 | 23 | */ |
— | — | @@ -26,29 +26,29 @@ |
27 | 27 | 'fields' => '*', |
28 | 28 | ); |
29 | 29 | } |
30 | | - |
| 30 | + |
31 | 31 | /** |
32 | 32 | * Generate the content of each table row (1 row = 1 log entry) |
33 | 33 | */ |
34 | 34 | function formatRow( $row ) { |
35 | 35 | global $wgLang, $wgExtensionAssetsPath; |
36 | | - |
| 36 | + |
37 | 37 | // Create a user object so we can pull the name, user page, etc. |
38 | 38 | $loggedUser = User::newFromId( $row->tmplog_user_id ); |
39 | 39 | // Create the user page link |
40 | | - $userLink = $this->getSkin()->makeLinkObj( $loggedUser->getUserPage(), |
| 40 | + $userLink = $this->getSkin()->makeLinkObj( $loggedUser->getUserPage(), |
41 | 41 | $loggedUser->getName() ); |
42 | | - $userTalkLink = $this->getSkin()->makeLinkObj( $loggedUser->getTalkPage(), |
| 42 | + $userTalkLink = $this->getSkin()->makeLinkObj( $loggedUser->getTalkPage(), |
43 | 43 | wfMsg ( 'centralnotice-talk-link' ) ); |
44 | | - |
| 44 | + |
45 | 45 | // Create the banner link |
46 | 46 | $bannerLink = $this->getSkin()->makeLinkObj( $this->viewPage, |
47 | 47 | htmlspecialchars( $row->tmplog_template_name ), |
48 | 48 | 'template=' . urlencode( $row->tmplog_template_name ) ); |
49 | | - |
| 49 | + |
50 | 50 | // Begin log entry primary row |
51 | 51 | $htmlOut = Xml::openElement( 'tr' ); |
52 | | - |
| 52 | + |
53 | 53 | $htmlOut .= Xml::openElement( 'td', array( 'valign' => 'top' ) ); |
54 | 54 | if ( $row->tmplog_action !== 'removed' ) { |
55 | 55 | $htmlOut .= '<a href="javascript:toggleLogDisplay(\''.$row->tmplog_id.'\')">'. |
— | — | @@ -64,7 +64,7 @@ |
65 | 65 | wfMsg ( 'centralnotice-user-links', $userLink, $userTalkLink ) |
66 | 66 | ); |
67 | 67 | $htmlOut .= Xml::tags( 'td', array( 'valign' => 'top', 'class' => 'primary' ), |
68 | | - $row->tmplog_action |
| 68 | + wfMsg ( 'centralnotice-action-'.$row->tmplog_action ) |
69 | 69 | ); |
70 | 70 | $htmlOut .= Xml::tags( 'td', array( 'valign' => 'top', 'class' => 'primary' ), |
71 | 71 | $bannerLink |
— | — | @@ -72,32 +72,32 @@ |
73 | 73 | $htmlOut .= Xml::tags( 'td', array(), |
74 | 74 | ' ' |
75 | 75 | ); |
76 | | - |
| 76 | + |
77 | 77 | // End log entry primary row |
78 | 78 | $htmlOut .= Xml::closeElement( 'tr' ); |
79 | | - |
| 79 | + |
80 | 80 | if ( $row->tmplog_action !== 'removed' ) { |
81 | 81 | // Begin log entry secondary row |
82 | 82 | $htmlOut .= Xml::openElement( 'tr', array( 'id' => 'cn-log-details-'.$row->tmplog_id, 'style' => 'display:none;' ) ); |
83 | | - |
| 83 | + |
84 | 84 | $htmlOut .= Xml::tags( 'td', array( 'valign' => 'top' ), |
85 | 85 | ' ' // force a table cell in older browsers |
86 | 86 | ); |
87 | 87 | $htmlOut .= Xml::openElement( 'td', array( 'valign' => 'top', 'colspan' => '5' ) ); |
88 | 88 | if ( $row->tmplog_action == 'created' ) { |
89 | 89 | $htmlOut .= $this->showInitialSettings( $row ); |
90 | | - } else if ( $row->tmplog_action == 'modified' ) { |
| 90 | + } elseif ( $row->tmplog_action == 'modified' ) { |
91 | 91 | $htmlOut .= $this->showChanges( $row ); |
92 | 92 | } |
93 | 93 | $htmlOut .= Xml::closeElement( 'td' ); |
94 | | - |
| 94 | + |
95 | 95 | // End log entry primary row |
96 | 96 | $htmlOut .= Xml::closeElement( 'tr' ); |
97 | 97 | } |
98 | | - |
| 98 | + |
99 | 99 | return $htmlOut; |
100 | 100 | } |
101 | | - |
| 101 | + |
102 | 102 | function getStartBody() { |
103 | 103 | $htmlOut = ''; |
104 | 104 | $htmlOut .= Xml::openElement( 'table', array( 'id' => 'cn-campaign-logs', 'cellpadding' => 3 ) ); |
— | — | @@ -121,7 +121,7 @@ |
122 | 122 | $htmlOut .= Xml::closeElement( 'tr' ); |
123 | 123 | return $htmlOut; |
124 | 124 | } |
125 | | - |
| 125 | + |
126 | 126 | /** |
127 | 127 | * Close table |
128 | 128 | */ |
— | — | @@ -130,40 +130,40 @@ |
131 | 131 | $htmlOut .= Xml::closeElement( 'table' ); |
132 | 132 | return $htmlOut; |
133 | 133 | } |
134 | | - |
| 134 | + |
135 | 135 | function showInitialSettings( $row ) { |
136 | 136 | global $wgLang; |
137 | 137 | $details = ''; |
138 | 138 | $details .= wfMsg ( |
139 | 139 | 'centralnotice-log-label', |
140 | | - wfMsg ( 'centralnotice-anon' ), |
| 140 | + wfMsg ( 'centralnotice-anon' ), |
141 | 141 | ($row->tmplog_end_anon ? 'on' : 'off') |
142 | 142 | )."<br/>"; |
143 | 143 | $details .= wfMsg ( |
144 | 144 | 'centralnotice-log-label', |
145 | | - wfMsg ( 'centralnotice-account' ), |
| 145 | + wfMsg ( 'centralnotice-account' ), |
146 | 146 | ($row->tmplog_end_account ? 'on' : 'off') |
147 | 147 | )."<br/>"; |
148 | 148 | $details .= wfMsg ( |
149 | 149 | 'centralnotice-log-label', |
150 | | - wfMsg ( 'centralnotice-fundraising' ), |
| 150 | + wfMsg ( 'centralnotice-fundraising' ), |
151 | 151 | ($row->tmplog_end_fundraising ? 'on' : 'off') |
152 | 152 | )."<br/>"; |
153 | 153 | $details .= wfMsg ( |
154 | 154 | 'centralnotice-log-label', |
155 | | - wfMsg ( 'centralnotice-autolink' ), |
| 155 | + wfMsg ( 'centralnotice-autolink' ), |
156 | 156 | ($row->tmplog_end_autolink ? 'on' : 'off') |
157 | 157 | )."<br/>"; |
158 | 158 | if ( $row->tmplog_end_landingpages ) { |
159 | 159 | $details .= wfMsg ( |
160 | 160 | 'centralnotice-log-label', |
161 | | - wfMsg ( 'centralnotice-landingpages' ), |
| 161 | + wfMsg ( 'centralnotice-landingpages' ), |
162 | 162 | $row->tmplog_end_landingpages |
163 | 163 | )."<br/>"; |
164 | 164 | } |
165 | 165 | return $details; |
166 | 166 | } |
167 | | - |
| 167 | + |
168 | 168 | function showChanges( $row ) { |
169 | 169 | global $wgLang; |
170 | 170 | $details = ''; |
— | — | @@ -182,7 +182,7 @@ |
183 | 183 | } |
184 | 184 | return $details; |
185 | 185 | } |
186 | | - |
| 186 | + |
187 | 187 | private function testBooleanChange( $param, $row ) { |
188 | 188 | $result = ''; |
189 | 189 | $beginField = 'tmplog_begin_'.$param; |
— | — | @@ -192,8 +192,8 @@ |
193 | 193 | 'centralnotice-log-label', |
194 | 194 | wfMsg ( 'centralnotice-'.$param ), |
195 | 195 | wfMsg ( |
196 | | - 'centralnotice-changed', |
197 | | - ( $row->$beginField ? wfMsg ( 'centralnotice-on' ) : wfMsg ( 'centralnotice-off' ) ), |
| 196 | + 'centralnotice-changed', |
| 197 | + ( $row->$beginField ? wfMsg ( 'centralnotice-on' ) : wfMsg ( 'centralnotice-off' ) ), |
198 | 198 | ( $row->$endField ? wfMsg ( 'centralnotice-on' ) : wfMsg ( 'centralnotice-off' ) ) |
199 | 199 | ) |
200 | 200 | )."<br/>"; |
Property changes on: branches/wmf/1.18wmf1/extensions/CentralNotice/CentralNoticeBannerLogPager.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
201 | 201 | Merged /trunk/extensions/CentralNotice/CentralNoticeBannerLogPager.php:r104210,104999,105015,105740,105800,106166,106227,106497,106552,106846,106849,106866,106873,106914 |
Index: branches/wmf/1.18wmf1/extensions/CentralNotice/CentralNotice.i18n.php |
— | — | @@ -121,6 +121,7 @@ |
122 | 122 | 'centralnotice-collapse-button' => 'Collapse link', |
123 | 123 | 'centralnotice-expand-button' => 'Expand link', |
124 | 124 | 'centralnotice-close-button' => 'Close button', |
| 125 | + 'centralnotice-close-title' => 'Close', |
125 | 126 | 'centralnotice-translate-button' => 'Help translate link', |
126 | 127 | 'centralnotice-donate-button' => 'Donate button', |
127 | 128 | 'centralnotice-expanded-banner' => 'Expanded banner', |
— | — | @@ -154,6 +155,9 @@ |
155 | 156 | 'centralnotice-timestamp' => 'Timestamp', |
156 | 157 | 'centralnotice-user' => 'User', |
157 | 158 | 'centralnotice-action' => 'Action', |
| 159 | + 'centralnotice-action-created' => 'created', |
| 160 | + 'centralnotice-action-modified' => 'modified', |
| 161 | + 'centralnotice-action-removed' => 'removed', |
158 | 162 | 'centralnotice-changed' => 'Changed from <span class="cn-old-value">$1</span> to <span class="cn-new-value">$2</span>', |
159 | 163 | 'centralnotice-on' => 'on', |
160 | 164 | 'centralnotice-off' => 'off', |
— | — | @@ -281,7 +285,12 @@ |
282 | 286 | 'centralnotice-timestamp' => '{{Identical|Timestamp}}', |
283 | 287 | 'centralnotice-user' => '{{Identical|User}}', |
284 | 288 | 'centralnotice-action' => '{{Identical|Action}}', |
285 | | - 'centralnotice-on' => 'indicates a notice is on air', |
| 289 | + 'centralnotice-action-created' => 'Indicates which type of action was performed. Should be lower-case, as if it appeared in the middle of a sentence.', |
| 290 | + 'centralnotice-action-modified' => 'Indicates which type of action was performed. Should be lower-case, as if it appeared in the middle of a sentence.', |
| 291 | + 'centralnotice-action-removed' => 'Indicates which type of action was performed. Should be lower-case, as if it appeared in the middle of a sentence.', |
| 292 | + 'centralnotice-on' => 'indicates a notice is on air |
| 293 | + |
| 294 | +{{Identical|On}}', |
286 | 295 | 'centralnotice-off' => 'indicates a notice is not on air |
287 | 296 | {{Identical|Off}}', |
288 | 297 | 'centralnotice-no-assignments' => 'Appears in the middle of a sentence; should be all lower case.', |
Property changes on: branches/wmf/1.18wmf1/extensions/CentralNotice/CentralNotice.i18n.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
289 | 298 | Merged /trunk/extensions/CentralNotice/CentralNotice.i18n.php:r105740,105800,106166,106227,106497,106552,106846,106849,106866,106873,106914 |
Index: branches/wmf/1.18wmf1/extensions/CentralNotice/CentralNoticePageLogPager.php |
— | — | @@ -1,8 +1,8 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
5 | | - * This class generates a paginated log of recent changes to banner messages (the parts that get |
6 | | - * translated). We use the rencentchanges table since it is lightweight, however, this means that |
| 5 | + * This class generates a paginated log of recent changes to banner messages (the parts that get |
| 6 | + * translated). We use the rencentchanges table since it is lightweight, however, this means that |
7 | 7 | * the log only goes back 30 days. |
8 | 8 | */ |
9 | 9 | class CentralNoticePageLogPager extends ReverseChronologicalPager { |
— | — | @@ -16,18 +16,18 @@ |
17 | 17 | function __construct( $special, $type = 'bannercontent' ) { |
18 | 18 | $this->special = $special; |
19 | 19 | parent::__construct( $special ); |
20 | | - |
| 20 | + |
21 | 21 | $this->viewPage = SpecialPage::getTitleFor( 'NoticeTemplate', 'view' ); |
22 | 22 | $this->logType = $type; |
23 | 23 | } |
24 | | - |
| 24 | + |
25 | 25 | /** |
26 | 26 | * Sort the log list by timestamp |
27 | 27 | */ |
28 | 28 | function getIndexField() { |
29 | 29 | return 'rc_timestamp'; |
30 | 30 | } |
31 | | - |
| 31 | + |
32 | 32 | /** |
33 | 33 | * Pull log entries from the database |
34 | 34 | */ |
— | — | @@ -54,29 +54,29 @@ |
55 | 55 | 'conds' => $conds, // WHERE conditions |
56 | 56 | ); |
57 | 57 | } |
58 | | - |
| 58 | + |
59 | 59 | /** |
60 | 60 | * Generate the content of each table row (1 row = 1 log entry) |
61 | 61 | */ |
62 | 62 | function formatRow( $row ) { |
63 | 63 | global $wgLang, $wgExtensionAssetsPath; |
64 | | - |
| 64 | + |
65 | 65 | // Create a user object so we can pull the name, user page, etc. |
66 | 66 | $loggedUser = User::newFromId( $row->rc_user ); |
67 | 67 | // Create the user page link |
68 | | - $userLink = $this->getSkin()->makeLinkObj( $loggedUser->getUserPage(), |
| 68 | + $userLink = $this->getSkin()->makeLinkObj( $loggedUser->getUserPage(), |
69 | 69 | $loggedUser->getName() ); |
70 | | - $userTalkLink = $this->getSkin()->makeLinkObj( $loggedUser->getTalkPage(), |
| 70 | + $userTalkLink = $this->getSkin()->makeLinkObj( $loggedUser->getTalkPage(), |
71 | 71 | wfMsg ( 'centralnotice-talk-link' ) ); |
72 | | - |
| 72 | + |
73 | 73 | $language = 'en'; // English is the default for CentralNotice messages |
74 | | - |
| 74 | + |
75 | 75 | if ( $this->logType == 'bannercontent' ) { |
76 | 76 | // Extract the banner name from the title |
77 | 77 | $pattern = '/Centralnotice-template-(.*)/'; |
78 | 78 | preg_match( $pattern, $row->rc_title, $matches ); |
79 | 79 | $banner = $matches[1]; |
80 | | - } else if ( $this->logType == 'bannermessages' ) { |
| 80 | + } elseif ( $this->logType == 'bannermessages' ) { |
81 | 81 | // Split the title into banner, message, and language |
82 | 82 | $titlePieces = explode( "/", $row->rc_title, 2 ); |
83 | 83 | $titleBase = $titlePieces[0]; |
— | — | @@ -86,17 +86,17 @@ |
87 | 87 | $banner = $matches[1]; |
88 | 88 | $message = $matches[2]; |
89 | 89 | } |
90 | | - |
| 90 | + |
91 | 91 | // Create banner link |
92 | 92 | $bannerLink = $this->getSkin()->makeLinkObj( $this->viewPage, |
93 | 93 | htmlspecialchars( $banner ), |
94 | 94 | 'template=' . urlencode( $banner ) ); |
95 | | - |
| 95 | + |
96 | 96 | // Create title object |
97 | 97 | $title = Title::newFromText( "MediaWiki:{$row->rc_title}" ); |
98 | | - |
| 98 | + |
99 | 99 | if ( $this->logType == 'bannercontent' ) { |
100 | | - // If the banner was just created, show a link to the banner. If the banner was |
| 100 | + // If the banner was just created, show a link to the banner. If the banner was |
101 | 101 | // edited, show a link to the banner and a link to the diff. |
102 | 102 | if ( $row->rc_new ) { |
103 | 103 | $bannerCell = $bannerLink; |
— | — | @@ -111,13 +111,13 @@ |
112 | 112 | // See ChangesList->preCacheMessages() for example. |
113 | 113 | $bannerCell = $bannerLink . " (<a href=\"$diffUrl\">diff</a>)"; |
114 | 114 | } |
115 | | - } else if ( $this->logType == 'bannermessages' ) { |
| 115 | + } elseif ( $this->logType == 'bannermessages' ) { |
116 | 116 | $bannerCell = $bannerLink; |
117 | | - |
| 117 | + |
118 | 118 | // Create the message link |
119 | 119 | $messageLink = $this->getSkin()->makeLinkObj( $title, htmlspecialchars( $message ) ); |
120 | | - |
121 | | - // If the message was just created, show a link to the message. If the message was |
| 120 | + |
| 121 | + // If the message was just created, show a link to the message. If the message was |
122 | 122 | // edited, show a link to the message and a link to the diff. |
123 | 123 | if ( $row->rc_new ) { |
124 | 124 | $messageCell = $messageLink; |
— | — | @@ -133,10 +133,10 @@ |
134 | 134 | $messageCell = $messageLink . " (<a href=\"$diffUrl\">diff</a>)"; |
135 | 135 | } |
136 | 136 | } |
137 | | - |
| 137 | + |
138 | 138 | // Begin log entry primary row |
139 | 139 | $htmlOut = Xml::openElement( 'tr' ); |
140 | | - |
| 140 | + |
141 | 141 | $htmlOut .= Xml::openElement( 'td', array( 'valign' => 'top' ) ); |
142 | 142 | $htmlOut .= Xml::closeElement( 'td' ); |
143 | 143 | $htmlOut .= Xml::tags( 'td', array( 'valign' => 'top', 'class' => 'primary' ), |
— | — | @@ -159,13 +159,13 @@ |
160 | 160 | $htmlOut .= Xml::tags( 'td', array(), |
161 | 161 | ' ' |
162 | 162 | ); |
163 | | - |
| 163 | + |
164 | 164 | // End log entry primary row |
165 | 165 | $htmlOut .= Xml::closeElement( 'tr' ); |
166 | | - |
| 166 | + |
167 | 167 | return $htmlOut; |
168 | 168 | } |
169 | | - |
| 169 | + |
170 | 170 | function getStartBody() { |
171 | 171 | $htmlOut = ''; |
172 | 172 | $htmlOut .= Xml::openElement( 'table', array( 'id' => 'cn-campaign-logs', 'cellpadding' => 3 ) ); |
— | — | @@ -194,7 +194,7 @@ |
195 | 195 | $htmlOut .= Xml::closeElement( 'tr' ); |
196 | 196 | return $htmlOut; |
197 | 197 | } |
198 | | - |
| 198 | + |
199 | 199 | /** |
200 | 200 | * Close table |
201 | 201 | */ |
— | — | @@ -203,5 +203,5 @@ |
204 | 204 | $htmlOut .= Xml::closeElement( 'table' ); |
205 | 205 | return $htmlOut; |
206 | 206 | } |
207 | | - |
| 207 | + |
208 | 208 | } |
Index: branches/wmf/1.18wmf1/extensions/CentralNotice/bannerstats.js |
— | — | @@ -0,0 +1,27 @@ |
| 2 | +/** |
| 3 | + * This script retrieves click-thru rates for all the banners in all the campaigns in |
| 4 | + * wgCentralNoticeAllocationCampaigns. It then adds the rates to the allocation tables. |
| 5 | + */ |
| 6 | +$( document ).ready( function () { |
| 7 | + /* |
| 8 | + if ( typeof wgCentralNoticeAllocationCampaigns !== 'undefined' ) { |
| 9 | + $.each( wgCentralNoticeAllocationCampaigns, function( index, campaignName ) { |
| 10 | + var statUrl = 'http://fundraising-analytics.wikimedia.org/json_reporting/' + campaignName; |
| 11 | + $.ajax( { |
| 12 | + 'url': statUrl, |
| 13 | + 'data': {}, |
| 14 | + 'dataType': 'jsonp', |
| 15 | + 'type': 'GET', |
| 16 | + 'success': function( data ) { |
| 17 | + //console.debug( "Success" ); |
| 18 | + //console.debug( data ); |
| 19 | + }, |
| 20 | + 'error': function( xhr ) { |
| 21 | + //console.debug( "Error" ); |
| 22 | + //console.debug( xhr ); |
| 23 | + } |
| 24 | + } ); |
| 25 | + } ) |
| 26 | + } |
| 27 | + */ |
| 28 | +} ); |
Index: branches/wmf/1.18wmf1/extensions/CentralNotice/CentralNoticeCampaignLogPager.php |
— | — | @@ -7,27 +7,27 @@ |
8 | 8 | global $wgRequest; |
9 | 9 | $this->special = $special; |
10 | 10 | parent::__construct(); |
11 | | - |
| 11 | + |
12 | 12 | // Override paging defaults |
13 | 13 | list( $this->mLimit, /* $offset */ ) = $this->mRequest->getLimitOffset( 20, '' ); |
14 | 14 | $this->mLimitsShown = array( 20, 50, 100 ); |
15 | | - |
| 15 | + |
16 | 16 | $this->viewPage = SpecialPage::getTitleFor( 'CentralNotice' ); |
17 | 17 | } |
18 | | - |
| 18 | + |
19 | 19 | /** |
20 | 20 | * Sort the log list by timestamp |
21 | 21 | */ |
22 | 22 | function getIndexField() { |
23 | 23 | return 'notlog_timestamp'; |
24 | 24 | } |
25 | | - |
| 25 | + |
26 | 26 | /** |
27 | 27 | * Pull log entries from the database |
28 | 28 | */ |
29 | 29 | function getQueryInfo() { |
30 | 30 | global $wgRequest; |
31 | | - |
| 31 | + |
32 | 32 | $filterStartDate = 0; |
33 | 33 | $filterEndDate = 0; |
34 | 34 | $startYear = $wgRequest->getVal( 'start_year' ); |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | if ( $endMonth === 'other' ) $endMonth = null; |
44 | 44 | $endDay = $wgRequest->getVal( 'end_day' ); |
45 | 45 | if ( $endDay === 'other' ) $endDay = null; |
46 | | - |
| 46 | + |
47 | 47 | if ( $startYear && $startMonth && $startDay ) { |
48 | 48 | $filterStartDate = $startYear . $startMonth . $startDay; |
49 | 49 | } |
— | — | @@ -52,13 +52,13 @@ |
53 | 53 | $filterCampaign = $wgRequest->getVal( 'campaign' ); |
54 | 54 | $filterUser = $wgRequest->getVal( 'user' ); |
55 | 55 | $reset = $wgRequest->getVal( 'centralnoticelogreset' ); |
56 | | - |
| 56 | + |
57 | 57 | $info = array( |
58 | 58 | 'tables' => array( 'cn_notice_log' ), |
59 | 59 | 'fields' => '*', |
60 | 60 | 'conds' => array() |
61 | 61 | ); |
62 | | - |
| 62 | + |
63 | 63 | if ( !$reset ) { |
64 | 64 | if ( $filterStartDate > 0 ) { |
65 | 65 | $filterStartDate = intval( $filterStartDate.'000000' ); |
— | — | @@ -77,32 +77,32 @@ |
78 | 78 | $info['conds'][] = "notlog_user_id = $userId"; |
79 | 79 | } |
80 | 80 | } |
81 | | - |
| 81 | + |
82 | 82 | return $info; |
83 | 83 | } |
84 | | - |
85 | | - /** |
| 84 | + |
| 85 | + /** |
86 | 86 | * Generate the content of each table row (1 row = 1 log entry) |
87 | 87 | */ |
88 | 88 | function formatRow( $row ) { |
89 | 89 | global $wgLang, $wgExtensionAssetsPath; |
90 | | - |
| 90 | + |
91 | 91 | // Create a user object so we can pull the name, user page, etc. |
92 | 92 | $loggedUser = User::newFromId( $row->notlog_user_id ); |
93 | 93 | // Create the user page link |
94 | | - $userLink = $this->getSkin()->makeLinkObj( $loggedUser->getUserPage(), |
| 94 | + $userLink = $this->getSkin()->makeLinkObj( $loggedUser->getUserPage(), |
95 | 95 | $loggedUser->getName() ); |
96 | | - $userTalkLink = $this->getSkin()->makeLinkObj( $loggedUser->getTalkPage(), |
| 96 | + $userTalkLink = $this->getSkin()->makeLinkObj( $loggedUser->getTalkPage(), |
97 | 97 | wfMsg ( 'centralnotice-talk-link' ) ); |
98 | | - |
| 98 | + |
99 | 99 | // Create the campaign link |
100 | 100 | $campaignLink = $this->getSkin()->makeLinkObj( $this->viewPage, |
101 | 101 | htmlspecialchars( $row->notlog_not_name ), |
102 | 102 | 'method=listNoticeDetail¬ice=' . urlencode( $row->notlog_not_name ) ); |
103 | | - |
| 103 | + |
104 | 104 | // Begin log entry primary row |
105 | 105 | $htmlOut = Xml::openElement( 'tr' ); |
106 | | - |
| 106 | + |
107 | 107 | $htmlOut .= Xml::openElement( 'td', array( 'valign' => 'top' ) ); |
108 | 108 | if ( $row->notlog_action !== 'removed' ) { |
109 | 109 | $htmlOut .= '<a href="javascript:toggleLogDisplay(\''.$row->notlog_id.'\')">'. |
— | — | @@ -118,7 +118,7 @@ |
119 | 119 | wfMsg ( 'centralnotice-user-links', $userLink, $userTalkLink ) |
120 | 120 | ); |
121 | 121 | $htmlOut .= Xml::tags( 'td', array( 'valign' => 'top', 'class' => 'primary' ), |
122 | | - $row->notlog_action |
| 122 | + wfMsg ( 'centralnotice-action-'.$row->notlog_action ) |
123 | 123 | ); |
124 | 124 | $htmlOut .= Xml::tags( 'td', array( 'valign' => 'top', 'class' => 'primary' ), |
125 | 125 | $campaignLink |
— | — | @@ -126,38 +126,38 @@ |
127 | 127 | $htmlOut .= Xml::tags( 'td', array(), |
128 | 128 | ' ' |
129 | 129 | ); |
130 | | - |
| 130 | + |
131 | 131 | // End log entry primary row |
132 | 132 | $htmlOut .= Xml::closeElement( 'tr' ); |
133 | | - |
| 133 | + |
134 | 134 | if ( $row->notlog_action !== 'removed' ) { |
135 | 135 | // Begin log entry secondary row |
136 | 136 | $htmlOut .= Xml::openElement( 'tr', array( 'id' => 'cn-log-details-'.$row->notlog_id, 'style' => 'display:none;' ) ); |
137 | | - |
| 137 | + |
138 | 138 | $htmlOut .= Xml::tags( 'td', array( 'valign' => 'top' ), |
139 | 139 | ' ' // force a table cell in older browsers |
140 | 140 | ); |
141 | 141 | $htmlOut .= Xml::openElement( 'td', array( 'valign' => 'top', 'colspan' => '5' ) ); |
142 | 142 | if ( $row->notlog_action == 'created' ) { |
143 | 143 | $htmlOut .= $this->showInitialSettings( $row ); |
144 | | - } else if ( $row->notlog_action == 'modified' ) { |
| 144 | + } elseif ( $row->notlog_action == 'modified' ) { |
145 | 145 | $htmlOut .= $this->showChanges( $row ); |
146 | 146 | } |
147 | 147 | $htmlOut .= Xml::closeElement( 'td' ); |
148 | | - |
| 148 | + |
149 | 149 | // End log entry primary row |
150 | 150 | $htmlOut .= Xml::closeElement( 'tr' ); |
151 | 151 | } |
152 | | - |
| 152 | + |
153 | 153 | return $htmlOut; |
154 | 154 | } |
155 | | - |
| 155 | + |
156 | 156 | function showInitialSettings( $row ) { |
157 | 157 | global $wgLang; |
158 | 158 | $details = ''; |
159 | 159 | $details .= wfMsg ( |
160 | 160 | 'centralnotice-log-label', |
161 | | - wfMsg ( 'centralnotice-start-date' ), |
| 161 | + wfMsg ( 'centralnotice-start-date' ), |
162 | 162 | $wgLang->date( $row->notlog_end_start ).' '.$wgLang->time( $row->notlog_end_start ) |
163 | 163 | )."<br/>"; |
164 | 164 | $details .= wfMsg ( |
— | — | @@ -203,7 +203,7 @@ |
204 | 204 | } |
205 | 205 | return $details; |
206 | 206 | } |
207 | | - |
| 207 | + |
208 | 208 | function showChanges( $row ) { |
209 | 209 | global $wgLang; |
210 | 210 | $details = ''; |
— | — | @@ -212,8 +212,8 @@ |
213 | 213 | 'centralnotice-log-label', |
214 | 214 | wfMsg ( 'centralnotice-start-date' ), |
215 | 215 | wfMsg ( |
216 | | - 'centralnotice-changed', |
217 | | - $wgLang->date( $row->notlog_begin_start ).' '.$wgLang->time( $row->notlog_begin_start ), |
| 216 | + 'centralnotice-changed', |
| 217 | + $wgLang->date( $row->notlog_begin_start ).' '.$wgLang->time( $row->notlog_begin_start ), |
218 | 218 | $wgLang->date( $row->notlog_end_start ).' '.$wgLang->time( $row->notlog_end_start ) |
219 | 219 | ) |
220 | 220 | )."<br/>"; |
— | — | @@ -223,8 +223,8 @@ |
224 | 224 | 'centralnotice-log-label', |
225 | 225 | wfMsg ( 'centralnotice-end-date' ), |
226 | 226 | wfMsg ( |
227 | | - 'centralnotice-changed', |
228 | | - $wgLang->date( $row->notlog_begin_end ).' '.$wgLang->time( $row->notlog_begin_end ), |
| 227 | + 'centralnotice-changed', |
| 228 | + $wgLang->date( $row->notlog_begin_end ).' '.$wgLang->time( $row->notlog_begin_end ), |
229 | 229 | $wgLang->date( $row->notlog_end_end ).' '.$wgLang->time( $row->notlog_end_end ) |
230 | 230 | ) |
231 | 231 | )."<br/>"; |
— | — | @@ -266,7 +266,7 @@ |
267 | 267 | } |
268 | 268 | return $details; |
269 | 269 | } |
270 | | - |
| 270 | + |
271 | 271 | private function testBooleanChange( $param, $row ) { |
272 | 272 | $result = ''; |
273 | 273 | $beginField = 'notlog_begin_'.$param; |
— | — | @@ -276,15 +276,15 @@ |
277 | 277 | 'centralnotice-log-label', |
278 | 278 | wfMsg ( 'centralnotice-'.$param ), |
279 | 279 | wfMsg ( |
280 | | - 'centralnotice-changed', |
281 | | - ( $row->$beginField ? wfMsg ( 'centralnotice-on' ) : wfMsg ( 'centralnotice-off' ) ), |
| 280 | + 'centralnotice-changed', |
| 281 | + ( $row->$beginField ? wfMsg ( 'centralnotice-on' ) : wfMsg ( 'centralnotice-off' ) ), |
282 | 282 | ( $row->$endField ? wfMsg ( 'centralnotice-on' ) : wfMsg ( 'centralnotice-off' ) ) |
283 | 283 | ) |
284 | 284 | )."<br/>"; |
285 | 285 | } |
286 | 286 | return $result; |
287 | 287 | } |
288 | | - |
| 288 | + |
289 | 289 | private function testSetChange( $param, $row ) { |
290 | 290 | $result = ''; |
291 | 291 | $beginField = 'notlog_begin_'.$param; |
— | — | @@ -316,7 +316,7 @@ |
317 | 317 | } |
318 | 318 | return $result; |
319 | 319 | } |
320 | | - |
| 320 | + |
321 | 321 | /** |
322 | 322 | * Specify table headers |
323 | 323 | */ |
— | — | @@ -343,7 +343,7 @@ |
344 | 344 | $htmlOut .= Xml::closeElement( 'tr' ); |
345 | 345 | return $htmlOut; |
346 | 346 | } |
347 | | - |
| 347 | + |
348 | 348 | /** |
349 | 349 | * Close table |
350 | 350 | */ |
— | — | @@ -352,5 +352,5 @@ |
353 | 353 | $htmlOut .= Xml::closeElement( 'table' ); |
354 | 354 | return $htmlOut; |
355 | 355 | } |
356 | | - |
| 356 | + |
357 | 357 | } |
Index: branches/wmf/1.18wmf1/extensions/CentralNotice/CentralNotice.db.php |
— | — | @@ -411,252 +411,268 @@ |
412 | 412 | |
413 | 413 | /** |
414 | 414 | * Return all of the available countries for geotargeting |
415 | | - * (This should probably be moved to a core database table at some point.) |
| 415 | + * @param string $code The language code to return the country list in |
416 | 416 | * @return array |
417 | 417 | */ |
418 | | - static function getCountriesList() { |
419 | | - return array( |
420 | | - 'AF'=>'Afghanistan', |
421 | | - 'AL'=>'Albania', |
422 | | - 'DZ'=>'Algeria', |
423 | | - 'AS'=>'American Samoa', |
424 | | - 'AD'=>'Andorra', |
425 | | - 'AO'=>'Angola', |
426 | | - 'AI'=>'Anguilla', |
427 | | - 'AQ'=>'Antarctica', |
428 | | - 'AG'=>'Antigua and Barbuda', |
429 | | - 'AR'=>'Argentina', |
430 | | - 'AM'=>'Armenia', |
431 | | - 'AW'=>'Aruba', |
432 | | - 'AU'=>'Australia', |
433 | | - 'AT'=>'Austria', |
434 | | - 'AZ'=>'Azerbaijan', |
435 | | - 'BS'=>'Bahamas', |
436 | | - 'BH'=>'Bahrain', |
437 | | - 'BD'=>'Bangladesh', |
438 | | - 'BB'=>'Barbados', |
439 | | - 'BY'=>'Belarus', |
440 | | - 'BE'=>'Belgium', |
441 | | - 'BZ'=>'Belize', |
442 | | - 'BJ'=>'Benin', |
443 | | - 'BM'=>'Bermuda', |
444 | | - 'BT'=>'Bhutan', |
445 | | - 'BO'=>'Bolivia', |
446 | | - 'BA'=>'Bosnia and Herzegovina', |
447 | | - 'BW'=>'Botswana', |
448 | | - 'BV'=>'Bouvet Island', |
449 | | - 'BR'=>'Brazil', |
450 | | - 'IO'=>'British Indian Ocean Territory', |
451 | | - 'BN'=>'Brunei Darussalam', |
452 | | - 'BG'=>'Bulgaria', |
453 | | - 'BF'=>'Burkina Faso', |
454 | | - 'BI'=>'Burundi', |
455 | | - 'KH'=>'Cambodia', |
456 | | - 'CM'=>'Cameroon', |
457 | | - 'CA'=>'Canada', |
458 | | - 'CV'=>'Cape Verde', |
459 | | - 'KY'=>'Cayman Islands', |
460 | | - 'CF'=>'Central African Republic', |
461 | | - 'TD'=>'Chad', |
462 | | - 'CL'=>'Chile', |
463 | | - 'CN'=>'China', |
464 | | - 'CX'=>'Christmas Island', |
465 | | - 'CC'=>'Cocos (Keeling) Islands', |
466 | | - 'CO'=>'Colombia', |
467 | | - 'KM'=>'Comoros', |
468 | | - 'CD'=>'Congo, Democratic Republic of the', |
469 | | - 'CG'=>'Congo', |
470 | | - 'CK'=>'Cook Islands', |
471 | | - 'CR'=>'Costa Rica', |
472 | | - 'CI'=>'Côte d\'Ivoire', |
473 | | - 'HR'=>'Croatia', |
474 | | - //'CU'=>'Cuba', |
475 | | - 'CY'=>'Cyprus', |
476 | | - 'CZ'=>'Czech Republic', |
477 | | - 'DK'=>'Denmark', |
478 | | - 'DJ'=>'Djibouti', |
479 | | - 'DM'=>'Dominica', |
480 | | - 'DO'=>'Dominican Republic', |
481 | | - 'EC'=>'Ecuador', |
482 | | - 'EG'=>'Egypt', |
483 | | - 'SV'=>'El Salvador', |
484 | | - 'GQ'=>'Equatorial Guinea', |
485 | | - 'ER'=>'Eritrea', |
486 | | - 'EE'=>'Estonia', |
487 | | - 'ET'=>'Ethiopia', |
488 | | - 'FK'=>'Falkland Islands (Malvinas)', |
489 | | - 'FO'=>'Faroe Islands', |
490 | | - 'FJ'=>'Fiji', |
491 | | - 'FI'=>'Finland', |
492 | | - 'FR'=>'France', |
493 | | - 'GF'=>'French Guiana', |
494 | | - 'PF'=>'French Polynesia', |
495 | | - 'TF'=>'French Southern Territories', |
496 | | - 'GA'=>'Gabon', |
497 | | - 'GM'=>'Gambia', |
498 | | - 'GE'=>'Georgia', |
499 | | - 'DE'=>'Germany', |
500 | | - 'GH'=>'Ghana', |
501 | | - 'GI'=>'Gibraltar', |
502 | | - 'GR'=>'Greece', |
503 | | - 'GL'=>'Greenland', |
504 | | - 'GD'=>'Grenada', |
505 | | - 'GP'=>'Guadeloupe', |
506 | | - 'GU'=>'Guam', |
507 | | - 'GT'=>'Guatemala', |
508 | | - 'GW'=>'Guinea-Bissau', |
509 | | - 'GN'=>'Guinea', |
510 | | - 'GY'=>'Guyana', |
511 | | - 'HT'=>'Haiti', |
512 | | - 'HM'=>'Heard Island and McDonald Islands', |
513 | | - 'VA'=>'Holy See (Vatican City State)', |
514 | | - 'HN'=>'Honduras', |
515 | | - 'HK'=>'Hong Kong', |
516 | | - 'HU'=>'Hungary', |
517 | | - 'IS'=>'Iceland', |
518 | | - 'IN'=>'India', |
519 | | - 'ID'=>'Indonesia', |
520 | | - //'IR'=>'Iran', |
521 | | - 'IQ'=>'Iraq', |
522 | | - 'IE'=>'Ireland', |
523 | | - 'IL'=>'Israel', |
524 | | - 'IT'=>'Italy', |
525 | | - 'JM'=>'Jamaica', |
526 | | - 'JP'=>'Japan', |
527 | | - 'JO'=>'Jordan', |
528 | | - 'KZ'=>'Kazakhstan', |
529 | | - 'KE'=>'Kenya', |
530 | | - 'KI'=>'Kiribati', |
531 | | - 'KW'=>'Kuwait', |
532 | | - 'KG'=>'Kyrgyzstan', |
533 | | - 'LA'=>'Lao People\'s Democratic Republic', |
534 | | - 'LV'=>'Latvia', |
535 | | - 'LB'=>'Lebanon', |
536 | | - 'LS'=>'Lesotho', |
537 | | - 'LR'=>'Liberia', |
538 | | - 'LY'=>'Libyan Arab Jamahiriya', |
539 | | - 'LI'=>'Liechtenstein', |
540 | | - 'LT'=>'Lithuania', |
541 | | - 'LU'=>'Luxembourg', |
542 | | - 'MO'=>'Macao', |
543 | | - 'MK'=>'Macedonia, Republic of', |
544 | | - 'MG'=>'Madagascar', |
545 | | - 'MW'=>'Malawi', |
546 | | - 'MY'=>'Malaysia', |
547 | | - 'MV'=>'Maldives', |
548 | | - 'ML'=>'Mali', |
549 | | - 'MT'=>'Malta', |
550 | | - 'MH'=>'Marshall Islands', |
551 | | - 'MQ'=>'Martinique', |
552 | | - 'MR'=>'Mauritania', |
553 | | - 'MU'=>'Mauritius', |
554 | | - 'YT'=>'Mayotte', |
555 | | - 'MX'=>'Mexico', |
556 | | - 'FM'=>'Micronesia', |
557 | | - 'MD'=>'Moldova, Republic of', |
558 | | - 'MC'=>'Moldova', |
559 | | - 'MN'=>'Mongolia', |
560 | | - 'ME'=>'Montenegro', |
561 | | - 'MS'=>'Montserrat', |
562 | | - 'MA'=>'Morocco', |
563 | | - 'MZ'=>'Mozambique', |
564 | | - 'MM'=>'Myanmar', |
565 | | - 'NA'=>'Namibia', |
566 | | - 'NR'=>'Nauru', |
567 | | - 'NP'=>'Nepal', |
568 | | - 'AN'=>'Netherlands Antilles', |
569 | | - 'NL'=>'Netherlands', |
570 | | - 'NC'=>'New Caledonia', |
571 | | - 'NZ'=>'New Zealand', |
572 | | - 'NI'=>'Nicaragua', |
573 | | - 'NE'=>'Niger', |
574 | | - 'NG'=>'Nigeria', |
575 | | - 'NU'=>'Niue', |
576 | | - 'NF'=>'Norfolk Island', |
577 | | - 'KP'=>'North Korea', |
578 | | - 'MP'=>'Northern Mariana Islands', |
579 | | - 'NO'=>'Norway', |
580 | | - 'OM'=>'Oman', |
581 | | - 'PK'=>'Pakistan', |
582 | | - 'PW'=>'Palau', |
583 | | - 'PS'=>'Palestinian Territory', |
584 | | - 'PA'=>'Panama', |
585 | | - 'PG'=>'Papua New Guinea', |
586 | | - 'PY'=>'Paraguay', |
587 | | - 'PE'=>'Peru', |
588 | | - 'PH'=>'Philippines', |
589 | | - 'PN'=>'Pitcairn', |
590 | | - 'PL'=>'Poland', |
591 | | - 'PT'=>'Portugal', |
592 | | - 'PR'=>'Puerto Rico', |
593 | | - 'QA'=>'Qatar', |
594 | | - 'RE'=>'Reunion', |
595 | | - 'RO'=>'Romania', |
596 | | - 'RU'=>'Russian Federation', |
597 | | - 'RW'=>'Rwanda', |
598 | | - 'SH'=>'Saint Helena', |
599 | | - 'KN'=>'Saint Kitts and Nevis', |
600 | | - 'LC'=>'Saint Lucia', |
601 | | - 'PM'=>'Saint Pierre and Miquelon', |
602 | | - 'VC'=>'Saint Vincent and the Grenadines', |
603 | | - 'WS'=>'Samoa', |
604 | | - 'SM'=>'San Marino', |
605 | | - 'ST'=>'Sao Tome and Principe', |
606 | | - 'SA'=>'Saudi Arabia', |
607 | | - 'SN'=>'Senegal', |
608 | | - 'CS'=>'Serbia and Montenegro', |
609 | | - 'RS'=>'Serbia', |
610 | | - 'SC'=>'Seychelles', |
611 | | - 'SL'=>'Sierra Leone', |
612 | | - 'SG'=>'Singapore', |
613 | | - 'SK'=>'Slovakia', |
614 | | - 'SI'=>'Slovenia', |
615 | | - 'SB'=>'Solomon Islands', |
616 | | - 'SO'=>'Somalia', |
617 | | - 'ZA'=>'South Africa', |
618 | | - 'KR'=>'South Korea', |
619 | | - 'SS'=>'South Sudan', |
620 | | - 'ES'=>'Spain', |
621 | | - 'LK'=>'Sri Lanka', |
622 | | - 'SD'=>'Sudan', |
623 | | - 'SR'=>'Suriname', |
624 | | - 'SJ'=>'Svalbard and Jan Mayen', |
625 | | - 'SZ'=>'Swaziland', |
626 | | - 'SE'=>'Sweden', |
627 | | - 'CH'=>'Switzerland', |
628 | | - //'SY'=>'Syrian Arab Republic', |
629 | | - 'TW'=>'Taiwan', |
630 | | - 'TJ'=>'Tajikistan', |
631 | | - 'TZ'=>'Tanzania', |
632 | | - 'TH'=>'Thailand', |
633 | | - 'TL'=>'Timor-Leste', |
634 | | - 'TG'=>'Togo', |
635 | | - 'TK'=>'Tokelau', |
636 | | - 'TO'=>'Tonga', |
637 | | - 'TT'=>'Trinidad and Tobago', |
638 | | - 'TN'=>'Tunisia', |
639 | | - 'TR'=>'Turkey', |
640 | | - 'TM'=>'Turkmenistan', |
641 | | - 'TC'=>'Turks and Caicos Islands', |
642 | | - 'TV'=>'Tuvalu', |
643 | | - 'UG'=>'Uganda', |
644 | | - 'UA'=>'Ukraine', |
645 | | - 'AE'=>'United Arab Emirates', |
646 | | - 'GB'=>'United Kingdom', |
647 | | - 'UM'=>'United States Minor Outlying Islands', |
648 | | - 'US'=>'United States', |
649 | | - 'UY'=>'Uruguay', |
650 | | - 'UZ'=>'Uzbekistan', |
651 | | - 'VU'=>'Vanuatu', |
652 | | - 'VE'=>'Venezuela', |
653 | | - 'VN'=>'Vietnam', |
654 | | - 'VG'=>'Virgin Islands, British', |
655 | | - 'VI'=>'Virgin Islands, U.S.', |
656 | | - 'WF'=>'Wallis and Futuna', |
657 | | - 'EH'=>'Western Sahara', |
658 | | - 'YE'=>'Yemen', |
659 | | - 'ZM'=>'Zambia', |
660 | | - 'ZW'=>'Zimbabwe' |
661 | | - ); |
| 418 | + static function getCountriesList( $code ) { |
| 419 | + |
| 420 | + $countries = array(); |
| 421 | + |
| 422 | + if ( is_callable( array( 'CountryNames', 'getNames' ) ) ) { |
| 423 | + // Retrieve the list of countries in user's language (via CLDR) |
| 424 | + $countries = CountryNames::getNames( $code ); |
| 425 | + unset( $countries['CU'] ); // Cuba |
| 426 | + unset( $countries['IR'] ); // Iran |
| 427 | + unset( $countries['SY'] ); // Syria |
| 428 | + } |
| 429 | + |
| 430 | + if ( !$countries ) { |
| 431 | + // Use this as fallback if CLDR extension is not enabled |
| 432 | + $countries = array( |
| 433 | + 'AF'=>'Afghanistan', |
| 434 | + 'AL'=>'Albania', |
| 435 | + 'DZ'=>'Algeria', |
| 436 | + 'AS'=>'American Samoa', |
| 437 | + 'AD'=>'Andorra', |
| 438 | + 'AO'=>'Angola', |
| 439 | + 'AI'=>'Anguilla', |
| 440 | + 'AQ'=>'Antarctica', |
| 441 | + 'AG'=>'Antigua and Barbuda', |
| 442 | + 'AR'=>'Argentina', |
| 443 | + 'AM'=>'Armenia', |
| 444 | + 'AW'=>'Aruba', |
| 445 | + 'AU'=>'Australia', |
| 446 | + 'AT'=>'Austria', |
| 447 | + 'AZ'=>'Azerbaijan', |
| 448 | + 'BS'=>'Bahamas', |
| 449 | + 'BH'=>'Bahrain', |
| 450 | + 'BD'=>'Bangladesh', |
| 451 | + 'BB'=>'Barbados', |
| 452 | + 'BY'=>'Belarus', |
| 453 | + 'BE'=>'Belgium', |
| 454 | + 'BZ'=>'Belize', |
| 455 | + 'BJ'=>'Benin', |
| 456 | + 'BM'=>'Bermuda', |
| 457 | + 'BT'=>'Bhutan', |
| 458 | + 'BO'=>'Bolivia', |
| 459 | + 'BA'=>'Bosnia and Herzegovina', |
| 460 | + 'BW'=>'Botswana', |
| 461 | + 'BV'=>'Bouvet Island', |
| 462 | + 'BR'=>'Brazil', |
| 463 | + 'IO'=>'British Indian Ocean Territory', |
| 464 | + 'BN'=>'Brunei Darussalam', |
| 465 | + 'BG'=>'Bulgaria', |
| 466 | + 'BF'=>'Burkina Faso', |
| 467 | + 'BI'=>'Burundi', |
| 468 | + 'KH'=>'Cambodia', |
| 469 | + 'CM'=>'Cameroon', |
| 470 | + 'CA'=>'Canada', |
| 471 | + 'CV'=>'Cape Verde', |
| 472 | + 'KY'=>'Cayman Islands', |
| 473 | + 'CF'=>'Central African Republic', |
| 474 | + 'TD'=>'Chad', |
| 475 | + 'CL'=>'Chile', |
| 476 | + 'CN'=>'China', |
| 477 | + 'CX'=>'Christmas Island', |
| 478 | + 'CC'=>'Cocos (Keeling) Islands', |
| 479 | + 'CO'=>'Colombia', |
| 480 | + 'KM'=>'Comoros', |
| 481 | + 'CD'=>'Congo, Democratic Republic of the', |
| 482 | + 'CG'=>'Congo', |
| 483 | + 'CK'=>'Cook Islands', |
| 484 | + 'CR'=>'Costa Rica', |
| 485 | + 'CI'=>'Côte d\'Ivoire', |
| 486 | + 'HR'=>'Croatia', |
| 487 | + //'CU'=>'Cuba', |
| 488 | + 'CY'=>'Cyprus', |
| 489 | + 'CZ'=>'Czech Republic', |
| 490 | + 'DK'=>'Denmark', |
| 491 | + 'DJ'=>'Djibouti', |
| 492 | + 'DM'=>'Dominica', |
| 493 | + 'DO'=>'Dominican Republic', |
| 494 | + 'EC'=>'Ecuador', |
| 495 | + 'EG'=>'Egypt', |
| 496 | + 'SV'=>'El Salvador', |
| 497 | + 'GQ'=>'Equatorial Guinea', |
| 498 | + 'ER'=>'Eritrea', |
| 499 | + 'EE'=>'Estonia', |
| 500 | + 'ET'=>'Ethiopia', |
| 501 | + 'FK'=>'Falkland Islands (Malvinas)', |
| 502 | + 'FO'=>'Faroe Islands', |
| 503 | + 'FJ'=>'Fiji', |
| 504 | + 'FI'=>'Finland', |
| 505 | + 'FR'=>'France', |
| 506 | + 'GF'=>'French Guiana', |
| 507 | + 'PF'=>'French Polynesia', |
| 508 | + 'TF'=>'French Southern Territories', |
| 509 | + 'GA'=>'Gabon', |
| 510 | + 'GM'=>'Gambia', |
| 511 | + 'GE'=>'Georgia', |
| 512 | + 'DE'=>'Germany', |
| 513 | + 'GH'=>'Ghana', |
| 514 | + 'GI'=>'Gibraltar', |
| 515 | + 'GR'=>'Greece', |
| 516 | + 'GL'=>'Greenland', |
| 517 | + 'GD'=>'Grenada', |
| 518 | + 'GP'=>'Guadeloupe', |
| 519 | + 'GU'=>'Guam', |
| 520 | + 'GT'=>'Guatemala', |
| 521 | + 'GW'=>'Guinea-Bissau', |
| 522 | + 'GN'=>'Guinea', |
| 523 | + 'GY'=>'Guyana', |
| 524 | + 'HT'=>'Haiti', |
| 525 | + 'HM'=>'Heard Island and McDonald Islands', |
| 526 | + 'VA'=>'Holy See (Vatican City State)', |
| 527 | + 'HN'=>'Honduras', |
| 528 | + 'HK'=>'Hong Kong', |
| 529 | + 'HU'=>'Hungary', |
| 530 | + 'IS'=>'Iceland', |
| 531 | + 'IN'=>'India', |
| 532 | + 'ID'=>'Indonesia', |
| 533 | + //'IR'=>'Iran', |
| 534 | + 'IQ'=>'Iraq', |
| 535 | + 'IE'=>'Ireland', |
| 536 | + 'IL'=>'Israel', |
| 537 | + 'IT'=>'Italy', |
| 538 | + 'JM'=>'Jamaica', |
| 539 | + 'JP'=>'Japan', |
| 540 | + 'JO'=>'Jordan', |
| 541 | + 'KZ'=>'Kazakhstan', |
| 542 | + 'KE'=>'Kenya', |
| 543 | + 'KI'=>'Kiribati', |
| 544 | + 'KW'=>'Kuwait', |
| 545 | + 'KG'=>'Kyrgyzstan', |
| 546 | + 'LA'=>'Lao People\'s Democratic Republic', |
| 547 | + 'LV'=>'Latvia', |
| 548 | + 'LB'=>'Lebanon', |
| 549 | + 'LS'=>'Lesotho', |
| 550 | + 'LR'=>'Liberia', |
| 551 | + 'LY'=>'Libyan Arab Jamahiriya', |
| 552 | + 'LI'=>'Liechtenstein', |
| 553 | + 'LT'=>'Lithuania', |
| 554 | + 'LU'=>'Luxembourg', |
| 555 | + 'MO'=>'Macao', |
| 556 | + 'MK'=>'Macedonia, Republic of', |
| 557 | + 'MG'=>'Madagascar', |
| 558 | + 'MW'=>'Malawi', |
| 559 | + 'MY'=>'Malaysia', |
| 560 | + 'MV'=>'Maldives', |
| 561 | + 'ML'=>'Mali', |
| 562 | + 'MT'=>'Malta', |
| 563 | + 'MH'=>'Marshall Islands', |
| 564 | + 'MQ'=>'Martinique', |
| 565 | + 'MR'=>'Mauritania', |
| 566 | + 'MU'=>'Mauritius', |
| 567 | + 'YT'=>'Mayotte', |
| 568 | + 'MX'=>'Mexico', |
| 569 | + 'FM'=>'Micronesia', |
| 570 | + 'MD'=>'Moldova, Republic of', |
| 571 | + 'MC'=>'Moldova', |
| 572 | + 'MN'=>'Mongolia', |
| 573 | + 'ME'=>'Montenegro', |
| 574 | + 'MS'=>'Montserrat', |
| 575 | + 'MA'=>'Morocco', |
| 576 | + 'MZ'=>'Mozambique', |
| 577 | + 'MM'=>'Myanmar', |
| 578 | + 'NA'=>'Namibia', |
| 579 | + 'NR'=>'Nauru', |
| 580 | + 'NP'=>'Nepal', |
| 581 | + 'AN'=>'Netherlands Antilles', |
| 582 | + 'NL'=>'Netherlands', |
| 583 | + 'NC'=>'New Caledonia', |
| 584 | + 'NZ'=>'New Zealand', |
| 585 | + 'NI'=>'Nicaragua', |
| 586 | + 'NE'=>'Niger', |
| 587 | + 'NG'=>'Nigeria', |
| 588 | + 'NU'=>'Niue', |
| 589 | + 'NF'=>'Norfolk Island', |
| 590 | + 'KP'=>'North Korea', |
| 591 | + 'MP'=>'Northern Mariana Islands', |
| 592 | + 'NO'=>'Norway', |
| 593 | + 'OM'=>'Oman', |
| 594 | + 'PK'=>'Pakistan', |
| 595 | + 'PW'=>'Palau', |
| 596 | + 'PS'=>'Palestinian Territory', |
| 597 | + 'PA'=>'Panama', |
| 598 | + 'PG'=>'Papua New Guinea', |
| 599 | + 'PY'=>'Paraguay', |
| 600 | + 'PE'=>'Peru', |
| 601 | + 'PH'=>'Philippines', |
| 602 | + 'PN'=>'Pitcairn', |
| 603 | + 'PL'=>'Poland', |
| 604 | + 'PT'=>'Portugal', |
| 605 | + 'PR'=>'Puerto Rico', |
| 606 | + 'QA'=>'Qatar', |
| 607 | + 'RE'=>'Reunion', |
| 608 | + 'RO'=>'Romania', |
| 609 | + 'RU'=>'Russian Federation', |
| 610 | + 'RW'=>'Rwanda', |
| 611 | + 'SH'=>'Saint Helena', |
| 612 | + 'KN'=>'Saint Kitts and Nevis', |
| 613 | + 'LC'=>'Saint Lucia', |
| 614 | + 'PM'=>'Saint Pierre and Miquelon', |
| 615 | + 'VC'=>'Saint Vincent and the Grenadines', |
| 616 | + 'WS'=>'Samoa', |
| 617 | + 'SM'=>'San Marino', |
| 618 | + 'ST'=>'Sao Tome and Principe', |
| 619 | + 'SA'=>'Saudi Arabia', |
| 620 | + 'SN'=>'Senegal', |
| 621 | + 'CS'=>'Serbia and Montenegro', |
| 622 | + 'RS'=>'Serbia', |
| 623 | + 'SC'=>'Seychelles', |
| 624 | + 'SL'=>'Sierra Leone', |
| 625 | + 'SG'=>'Singapore', |
| 626 | + 'SK'=>'Slovakia', |
| 627 | + 'SI'=>'Slovenia', |
| 628 | + 'SB'=>'Solomon Islands', |
| 629 | + 'SO'=>'Somalia', |
| 630 | + 'ZA'=>'South Africa', |
| 631 | + 'KR'=>'South Korea', |
| 632 | + 'SS'=>'South Sudan', |
| 633 | + 'ES'=>'Spain', |
| 634 | + 'LK'=>'Sri Lanka', |
| 635 | + 'SD'=>'Sudan', |
| 636 | + 'SR'=>'Suriname', |
| 637 | + 'SJ'=>'Svalbard and Jan Mayen', |
| 638 | + 'SZ'=>'Swaziland', |
| 639 | + 'SE'=>'Sweden', |
| 640 | + 'CH'=>'Switzerland', |
| 641 | + //'SY'=>'Syrian Arab Republic', |
| 642 | + 'TW'=>'Taiwan', |
| 643 | + 'TJ'=>'Tajikistan', |
| 644 | + 'TZ'=>'Tanzania', |
| 645 | + 'TH'=>'Thailand', |
| 646 | + 'TL'=>'Timor-Leste', |
| 647 | + 'TG'=>'Togo', |
| 648 | + 'TK'=>'Tokelau', |
| 649 | + 'TO'=>'Tonga', |
| 650 | + 'TT'=>'Trinidad and Tobago', |
| 651 | + 'TN'=>'Tunisia', |
| 652 | + 'TR'=>'Turkey', |
| 653 | + 'TM'=>'Turkmenistan', |
| 654 | + 'TC'=>'Turks and Caicos Islands', |
| 655 | + 'TV'=>'Tuvalu', |
| 656 | + 'UG'=>'Uganda', |
| 657 | + 'UA'=>'Ukraine', |
| 658 | + 'AE'=>'United Arab Emirates', |
| 659 | + 'GB'=>'United Kingdom', |
| 660 | + 'UM'=>'United States Minor Outlying Islands', |
| 661 | + 'US'=>'United States', |
| 662 | + 'UY'=>'Uruguay', |
| 663 | + 'UZ'=>'Uzbekistan', |
| 664 | + 'VU'=>'Vanuatu', |
| 665 | + 'VE'=>'Venezuela', |
| 666 | + 'VN'=>'Vietnam', |
| 667 | + 'VG'=>'Virgin Islands, British', |
| 668 | + 'VI'=>'Virgin Islands, U.S.', |
| 669 | + 'WF'=>'Wallis and Futuna', |
| 670 | + 'EH'=>'Western Sahara', |
| 671 | + 'YE'=>'Yemen', |
| 672 | + 'ZM'=>'Zambia', |
| 673 | + 'ZW'=>'Zimbabwe' |
| 674 | + ); |
| 675 | + } |
| 676 | + |
| 677 | + return $countries; |
662 | 678 | } |
663 | 679 | } |
Property changes on: branches/wmf/1.18wmf1/extensions/CentralNotice/CentralNotice.db.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
664 | 680 | Merged /trunk/extensions/CentralNotice/CentralNotice.db.php:r106497,106552,106846,106849,106866,106873,106914 |
Index: branches/wmf/1.18wmf1/extensions/CentralNotice/centralnotice.js |
— | — | @@ -67,9 +67,13 @@ |
68 | 68 | var bannerField = document.getElementById('templateBody'); |
69 | 69 | switch( buttonType ) { |
70 | 70 | case 'close': // Insert close button |
71 | | - var buttonValue = '<a href="#" onclick="hideBanner();return false;">' |
| 71 | + var buttonValue = '<a href="#" title="' |
| 72 | + + mw.msg( 'centralnotice-close-title' ) |
| 73 | + + '" onclick="hideBanner();return false;">' |
72 | 74 | + '<img border="0" src="' + mw.config.get( 'stylepath' ) |
73 | | - + '/common/images/closewindow.png" alt="Close" /></a>'; |
| 75 | + + '/common/images/closewindow19x19.png" alt="' |
| 76 | + + mw.msg( 'centralnotice-close-title' ) |
| 77 | + + '" /></a>'; |
74 | 78 | break; |
75 | 79 | } |
76 | 80 | if (document.selection) { |
Property changes on: branches/wmf/1.18wmf1/extensions/CentralNotice/centralnotice.js |
___________________________________________________________________ |
Modified: svn:mergeinfo |
77 | 81 | Merged /trunk/extensions/CentralNotice/centralnotice.js:r105740,105800,106166,106227,106497,106552,106846,106849,106866,106873,106914 |
Property changes on: branches/wmf/1.18wmf1/extensions/CentralNotice |
___________________________________________________________________ |
Modified: svn:mergeinfo |
78 | 82 | Merged /trunk/extensions/CentralNotice:r103297,104003,104210,104999,105015,105740,105800,106166,106227,106497,106552,106846,106849,106866,106873,106914 |