r108537 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108536‎ | r108537 | r108538 >
Date:19:50, 10 January 2012
Author:kaldari
Status:ok
Tags:
Comment:
adding some useful comments
Modified paths:
  • /trunk/extensions/CentralNotice/CentralNotice.php (modified) (history)
  • /trunk/extensions/CentralNotice/bannerstats.js (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/CentralNotice.php
@@ -1,9 +1,8 @@
22 <?php
33
4 -// Override these per-wiki to pass on via the loader to the text system
5 -// for localization by language and project.
6 -// Actual user language is used for localization; $wgNoticeLang is used
7 -// for selective enabling/disabling on sites.
 4+// $wgNoticeLang and $wgNoticeProject are used for targeting campaigns to specific wikis. These
 5+// should be overridden on each wiki with the appropriate values.
 6+// Actual user language (wgUserLanguage) is used for banner localization.
87 $wgNoticeLang = $wgLanguageCode;
98 $wgNoticeProject = 'wikipedia';
109
@@ -23,8 +22,8 @@
2423 'test'
2524 );
2625
27 -// Enable the notice-hosting infrastructure on this wiki...
28 -// Leave at false for wikis that only use a sister site for the control.
 26+// Enable the campaign hosting infrastructure on this wiki...
 27+// Set to false for wikis that only use a sister site for the control.
2928 $wgNoticeInfrastructure = true;
3029
3130 // The name of the database which hosts the centralized campaign data
@@ -58,6 +57,7 @@
5958 // NOTE: This must be in UNIX timestamp format, for example, '1325462400'
6059 $wgNoticeHideBannersExpiration = '';
6160
 61+// Functions to be called after MediaWiki initialization is complete
6262 $wgExtensionFunctions[] = 'efCentralNoticeSetup';
6363
6464 $wgExtensionCredits['other'][] = array(
@@ -109,7 +109,7 @@
110110 }
111111
112112 /**
113 - * Called through wgExtensionFunctions
 113+ * Load all the classes, register special pages, etc. Called through wgExtensionFunctions.
114114 */
115115 function efCentralNoticeSetup() {
116116 global $wgHooks, $wgNoticeInfrastructure, $wgAutoloadClasses, $wgSpecialPages;
@@ -165,6 +165,7 @@
166166
167167 /**
168168 * LoadExtensionSchemaUpdates hook handler
 169+ * This function makes sure that the database schema is up to date.
169170 * @param $updater DatabaseUpdater|null
170171 * @return bool
171172 */
@@ -240,12 +241,13 @@
241242
242243 /**
243244 * SkinAfterBottomScripts hook handler
 245+ * This function outputs the call to the geoIP lookup
244246 * @param $skin Skin
245247 * @param $text string
246248 * @return bool
247249 */
248250 function efCentralNoticeGeoLoader( $skin, &$text ) {
249 - // Insert the geo IP lookup
 251+ // Insert the geoIP lookup
250252 $text .= Html::linkedScript( "//geoiplookup.wikimedia.org/" );
251253 return true;
252254 }
@@ -325,6 +327,7 @@
326328
327329 /**
328330 * SiteNoticeAfter hook handler
 331+ * This function outputs the siteNotice div that the banners are loaded into.
329332 * @param $notice string
330333 * @return bool
331334 */
Index: trunk/extensions/CentralNotice/bannerstats.js
@@ -3,6 +3,7 @@
44 * wgCentralNoticeAllocationCampaigns. It then adds the rates to the allocation tables.
55 */
66 $( document ).ready( function () {
 7+ /* TODO: Once the lag issue with retrieving the stats is resolved, finish implementing this functionality */
78 /*
89 if ( typeof wgCentralNoticeAllocationCampaigns !== 'undefined' ) {
910 $.each( wgCentralNoticeAllocationCampaigns, function( index, campaignName ) {

Status & tagging log