[MediaWiki-commits] [Gerrit] mediawiki...SocialProfile[master]: Convert SystemGifts to use extension registration

2017-12-07 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/392361 )

Change subject: Convert SystemGifts to use extension registration
..


Convert SystemGifts to use extension registration

Bug: T152865
Change-Id: Ia077907a113afeb9da91e45f8922af6be08df38c
---
M SocialProfile.php
D SystemGifts/SystemGifts.php
A SystemGifts/extension.json
M SystemGifts/i18n/en.json
M SystemGifts/i18n/qqq.json
5 files changed, 102 insertions(+), 106 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/SocialProfile.php b/SocialProfile.php
index 15f5a28..7ea60c0 100644
--- a/SocialProfile.php
+++ b/SocialProfile.php
@@ -161,8 +161,10 @@
 // Loader files
 require_once( "$IP/extensions/SocialProfile/UserProfile/UserProfile.php" ); // 
Profile page configuration loader file
 require_once( "$IP/extensions/SocialProfile/UserGifts/Gifts.php" ); // 
UserGifts (user-to-user gifting functionality) loader file
-require_once( "$IP/extensions/SocialProfile/SystemGifts/SystemGifts.php" ); // 
SystemGifts (awards functionality) loader file
-wfLoadExtension( 'SocialProfile/UserActivity' ); // UserActivity - recent 
social changes
+wfLoadExtensions( [
+   'SocialProfile/SystemGifts', // SystemGifts (awards functionality)
+   'SocialProfile/UserActivity' // UserActivity - recent social changes
+] );
 
 $wgHooks['BeforePageDisplay'][] = 'SocialProfileHooks::onBeforePageDisplay';
 $wgHooks['CanonicalNamespaces'][] = 
'SocialProfileHooks::onCanonicalNamespaces';
diff --git a/SystemGifts/SystemGifts.php b/SystemGifts/SystemGifts.php
deleted file mode 100644
index 6979ae0..000
--- a/SystemGifts/SystemGifts.php
+++ /dev/null
@@ -1,104 +0,0 @@
- 'SystemGift.css',
-   'localBasePath' => __DIR__,
-   'remoteExtPath' => 'SocialProfile/SystemGifts',
-   'position' => 'top'
-);
-
-$wgResourceModules['ext.socialprofile.special.removemastersystemgift.css'] = 
array(
-   'styles' => 'SpecialRemoveMasterSystemGift.css',
-   'localBasePath' => __DIR__,
-   'remoteExtPath' => 'SocialProfile/SystemGifts',
-   'position' => 'top'
-);
-
-$wgResourceModules['ext.socialprofile.special.systemgiftmanager.css'] = array(
-   'styles' => 'SpecialSystemGiftManager.css',
-   'localBasePath' => __DIR__,
-   'remoteExtPath' => 'SocialProfile/SystemGifts',
-   'position' => 'top'
-);
-
-$wgResourceModules['ext.socialprofile.special.systemgiftmanagerlogo.css'] = 
array(
-   'styles' => 'SpecialSystemGiftManagerLogo.css',
-   'localBasePath' => __DIR__,
-   'remoteExtPath' => 'SocialProfile/SystemGifts',
-   'position' => 'top'
-);
-
-$wgResourceModules['ext.socialprofile.special.topawards.css'] = array(
-   'styles' => 'SpecialTopAwards.css',
-   'localBasePath' => __DIR__,
-   'remoteExtPath' => 'SocialProfile/SystemGifts',
-   'position' => 'top'
-);
-
-$wgResourceModules['ext.socialprofile.special.viewsystemgift.css'] = array(
-   'styles' => 'SpecialViewSystemGift.css',
-   'localBasePath' => __DIR__,
-   'remoteExtPath' => 'SocialProfile/SystemGifts',
-   'position' => 'top'
-);
-
-$wgResourceModules['ext.socialprofile.special.viewsystemgifts.css'] = array(
-   'styles' => 'SpecialViewSystemGifts.css',
-   'localBasePath' => __DIR__,
-   'remoteExtPath' => 'SocialProfile/SystemGifts',
-   'position' => 'top'
-);
-
-// Echo (Notifications) stuff
-$wgAutoloadClasses['EchoUserSystemGiftPresentationModel'] = 
"{$wgSystemGiftsDirectory}/EchoUserSystemGiftPresentationModel.php";
-
-$wgHooks['BeforeCreateEchoEvent'][] = 
'UserSystemGiftsHooks::onBeforeCreateEchoEvent';
-$wgHooks['EchoGetDefaultNotifiedUsers'][] = 
'UserSystemGiftsHooks::onEchoGetDefaultNotifiedUsers';
-$wgHooks['EchoGetBundleRules'][] = 
'UserSystemGiftsHooks::onEchoGetBundleRules';
-
-$wgDefaultUserOptions['echo-subscriptions-web-social-award'] = true;
-$wgDefaultUserOptions['echo-subscriptions-email-social-award'] = false;
diff --git a/SystemGifts/extension.json b/SystemGifts/extension.json
new file mode 100644
index 000..2e84d47
--- /dev/null
+++ b/SystemGifts/extension.json
@@ -0,0 +1,96 @@
+{
+   "name": "SystemGifts",
+   "author": [
+   "Aaron Wright",
+   "David Pean",
+   "Jack Phoenix"
+   ],
+   "license-name": "GPL-2.0+",
+   "descriptionmsg": "systemgifts-desc",
+   "type": "other",
+   "MessagesDirs": {
+   "SystemGifts": [
+   "i18n"
+   ]
+   },
+   "ExtensionMessagesFiles": {
+   "SystemGiftsAlias": "SystemGifts.alias.php"
+   },
+   "AutoloadClasses": {
+   "SystemGifts": "SystemGiftsClass.php",
+   "UserSystemGifts": "UserSystemGiftsClass.php",
+   "UserSystemGiftsHooks": "UserSystemGiftsHooks.php",
+   "TopAwards": "TopAwards.php",
+ 

[MediaWiki-commits] [Gerrit] mediawiki...SocialProfile[master]: Convert SystemGifts to use extension registration

2017-11-19 Thread SamanthaNguyen (Code Review)
SamanthaNguyen has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392361 )

Change subject: Convert SystemGifts to use extension registration
..

Convert SystemGifts to use extension registration

Bug: T152865
Change-Id: Ia077907a113afeb9da91e45f8922af6be08df38c
---
M SocialProfile.php
D SystemGifts/SystemGifts.php
A SystemGifts/extension.json
M SystemGifts/i18n/en.json
M SystemGifts/i18n/qqq.json
5 files changed, 102 insertions(+), 106 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SocialProfile 
refs/changes/61/392361/1

diff --git a/SocialProfile.php b/SocialProfile.php
index 15f5a28..7ea60c0 100644
--- a/SocialProfile.php
+++ b/SocialProfile.php
@@ -161,8 +161,10 @@
 // Loader files
 require_once( "$IP/extensions/SocialProfile/UserProfile/UserProfile.php" ); // 
Profile page configuration loader file
 require_once( "$IP/extensions/SocialProfile/UserGifts/Gifts.php" ); // 
UserGifts (user-to-user gifting functionality) loader file
-require_once( "$IP/extensions/SocialProfile/SystemGifts/SystemGifts.php" ); // 
SystemGifts (awards functionality) loader file
-wfLoadExtension( 'SocialProfile/UserActivity' ); // UserActivity - recent 
social changes
+wfLoadExtensions( [
+   'SocialProfile/SystemGifts', // SystemGifts (awards functionality)
+   'SocialProfile/UserActivity' // UserActivity - recent social changes
+] );
 
 $wgHooks['BeforePageDisplay'][] = 'SocialProfileHooks::onBeforePageDisplay';
 $wgHooks['CanonicalNamespaces'][] = 
'SocialProfileHooks::onCanonicalNamespaces';
diff --git a/SystemGifts/SystemGifts.php b/SystemGifts/SystemGifts.php
deleted file mode 100644
index 6979ae0..000
--- a/SystemGifts/SystemGifts.php
+++ /dev/null
@@ -1,104 +0,0 @@
- 'SystemGift.css',
-   'localBasePath' => __DIR__,
-   'remoteExtPath' => 'SocialProfile/SystemGifts',
-   'position' => 'top'
-);
-
-$wgResourceModules['ext.socialprofile.special.removemastersystemgift.css'] = 
array(
-   'styles' => 'SpecialRemoveMasterSystemGift.css',
-   'localBasePath' => __DIR__,
-   'remoteExtPath' => 'SocialProfile/SystemGifts',
-   'position' => 'top'
-);
-
-$wgResourceModules['ext.socialprofile.special.systemgiftmanager.css'] = array(
-   'styles' => 'SpecialSystemGiftManager.css',
-   'localBasePath' => __DIR__,
-   'remoteExtPath' => 'SocialProfile/SystemGifts',
-   'position' => 'top'
-);
-
-$wgResourceModules['ext.socialprofile.special.systemgiftmanagerlogo.css'] = 
array(
-   'styles' => 'SpecialSystemGiftManagerLogo.css',
-   'localBasePath' => __DIR__,
-   'remoteExtPath' => 'SocialProfile/SystemGifts',
-   'position' => 'top'
-);
-
-$wgResourceModules['ext.socialprofile.special.topawards.css'] = array(
-   'styles' => 'SpecialTopAwards.css',
-   'localBasePath' => __DIR__,
-   'remoteExtPath' => 'SocialProfile/SystemGifts',
-   'position' => 'top'
-);
-
-$wgResourceModules['ext.socialprofile.special.viewsystemgift.css'] = array(
-   'styles' => 'SpecialViewSystemGift.css',
-   'localBasePath' => __DIR__,
-   'remoteExtPath' => 'SocialProfile/SystemGifts',
-   'position' => 'top'
-);
-
-$wgResourceModules['ext.socialprofile.special.viewsystemgifts.css'] = array(
-   'styles' => 'SpecialViewSystemGifts.css',
-   'localBasePath' => __DIR__,
-   'remoteExtPath' => 'SocialProfile/SystemGifts',
-   'position' => 'top'
-);
-
-// Echo (Notifications) stuff
-$wgAutoloadClasses['EchoUserSystemGiftPresentationModel'] = 
"{$wgSystemGiftsDirectory}/EchoUserSystemGiftPresentationModel.php";
-
-$wgHooks['BeforeCreateEchoEvent'][] = 
'UserSystemGiftsHooks::onBeforeCreateEchoEvent';
-$wgHooks['EchoGetDefaultNotifiedUsers'][] = 
'UserSystemGiftsHooks::onEchoGetDefaultNotifiedUsers';
-$wgHooks['EchoGetBundleRules'][] = 
'UserSystemGiftsHooks::onEchoGetBundleRules';
-
-$wgDefaultUserOptions['echo-subscriptions-web-social-award'] = true;
-$wgDefaultUserOptions['echo-subscriptions-email-social-award'] = false;
diff --git a/SystemGifts/extension.json b/SystemGifts/extension.json
new file mode 100644
index 000..eebc98b
--- /dev/null
+++ b/SystemGifts/extension.json
@@ -0,0 +1,96 @@
+{
+   "name": "SystemGifts",
+   "author": [
+   "Aaron Wright",
+   "David Pean",
+   "Jack Phoenix"
+   ],
+   "license-name": "GPL-2.0+",
+   "descriptionmsg": "systemgifts-desc",
+   "type": "other",
+   "MessagesDirs": {
+   "SystemGifts": [
+   "i18n"
+   ]
+   },
+   "ExtensionMessagesFiles": {
+   "SystemGiftsAlias": "SystemGifts.alias.php"
+   },
+   "AutoloadClasses": {
+   "SystemGifts": "SystemGiftsClass.php",
+   "UserSystemGifts": "UserSystemGiftsClass.php",
+   "UserSystemGiftsHooks": "UserSystemGiftsHooks.php",
+