SamanthaNguyen has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/392340 )
Change subject: Convert UserRelationship to use extension registration
......................................................................
Convert UserRelationship to use extension registration
Bug: T152865
Change-Id: Ia43cdc132314f784a785904fc03fb844df5cbbcb
---
M SocialProfile.php
A UserRelationship/extension.json
M UserRelationship/i18n/en.json
M UserRelationship/i18n/qqq.json
4 files changed, 63 insertions(+), 31 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SocialProfile
refs/changes/40/392340/1
diff --git a/SocialProfile.php b/SocialProfile.php
index 15f5a28..001b669 100644
--- a/SocialProfile.php
+++ b/SocialProfile.php
@@ -29,7 +29,6 @@
$wgMessagesDirs['SocialProfileUserBoard'] = __DIR__ . '/UserBoard/i18n';
$wgMessagesDirs['SocialProfileUserProfile'] = __DIR__ . '/UserProfile/i18n';
-$wgMessagesDirs['SocialProfileUserRelationship'] = __DIR__ .
'/UserRelationship/i18n';
$wgMessagesDirs['SocialProfileUserStats'] = __DIR__ . '/UserStats/i18n';
$wgExtensionMessagesFiles['SocialProfileNamespaces'] = __DIR__ .
'/SocialProfile.namespaces.php';
@@ -38,19 +37,14 @@
// Classes to be autoloaded
$wgAutoloadClasses['GenerateTopUsersReport'] = __DIR__ .
'/UserStats/GenerateTopUsersReport.php';
$wgAutoloadClasses['EchoUserBoardMessagePresentationModel'] = __DIR__ .
'/UserBoard/EchoUserBoardMessagePresentationModel.php';
-$wgAutoloadClasses['EchoUserRelationshipPresentationModel'] = __DIR__ .
'/UserRelationship/EchoUserRelationshipPresentationModel.php';
$wgAutoloadClasses['EchoUserLevelAdvancePresentationModel'] = __DIR__ .
'/UserStats/EchoUserLevelAdvancePresentationModel.php';
-$wgAutoloadClasses['SpecialAddRelationship'] = __DIR__ .
'/UserRelationship/SpecialAddRelationship.php';
$wgAutoloadClasses['SpecialBoardBlast'] = __DIR__ .
'/UserBoard/SpecialSendBoardBlast.php';
$wgAutoloadClasses['SpecialEditProfile'] = __DIR__ .
'/UserProfile/SpecialEditProfile.php';
$wgAutoloadClasses['SpecialPopulateUserProfiles'] = __DIR__ .
'/UserProfile/SpecialPopulateExistingUsersProfiles.php';
-$wgAutoloadClasses['SpecialRemoveRelationship'] = __DIR__ .
'/UserRelationship/SpecialRemoveRelationship.php';
$wgAutoloadClasses['SpecialToggleUserPage'] = __DIR__ .
'/UserProfile/SpecialToggleUserPageType.php';
$wgAutoloadClasses['SpecialUpdateProfile'] = __DIR__ .
'/UserProfile/SpecialUpdateProfile.php';
$wgAutoloadClasses['SpecialUploadAvatar'] = __DIR__ .
'/UserProfile/SpecialUploadAvatar.php';
$wgAutoloadClasses['UploadAvatar'] = __DIR__ .
'/UserProfile/SpecialUploadAvatar.php';
-$wgAutoloadClasses['SpecialViewRelationshipRequests'] = __DIR__ .
'/UserRelationship/SpecialViewRelationshipRequests.php';
-$wgAutoloadClasses['SpecialViewRelationships'] = __DIR__ .
'/UserRelationship/SpecialViewRelationships.php';
$wgAutoloadClasses['SpecialViewUserBoard'] = __DIR__ .
'/UserBoard/SpecialUserBoard.php';
$wgAutoloadClasses['RemoveAvatar'] = __DIR__ .
'/UserProfile/SpecialRemoveAvatar.php';
$wgAutoloadClasses['UpdateEditCounts'] = __DIR__ .
'/UserStats/SpecialUpdateEditCounts.php';
@@ -59,8 +53,6 @@
$wgAutoloadClasses['UserProfile'] = __DIR__ .
'/UserProfile/UserProfileClass.php';
$wgAutoloadClasses['UserProfileHooks'] = __DIR__ .
'/UserProfile/UserProfileHooks.php';
$wgAutoloadClasses['UserProfilePage'] = __DIR__ .
'/UserProfile/UserProfilePage.php';
-$wgAutoloadClasses['UserRelationship'] = __DIR__ .
'/UserRelationship/UserRelationshipClass.php';
-$wgAutoloadClasses['UserRelationshipHooks'] = __DIR__ .
'/UserRelationship/UserRelationshipHooks.php';
$wgAutoloadClasses['UserStatsHooks'] = __DIR__ .
'/UserStats/UserStatsHooks.php';
$wgAutoloadClasses['UserLevel'] = __DIR__ . '/UserStats/UserStatsClass.php';
$wgAutoloadClasses['UserStats'] = __DIR__ . '/UserStats/UserStatsClass.php';
@@ -83,9 +75,6 @@
$wgAutoloadClasses['ApiSendUserBoardMessage'] = __DIR__ .
'/UserBoard/ApiSendUserBoardMessage.php';
$wgAPIModules['socialprofile-send-message'] = 'ApiSendUserBoardMessage';
-$wgAutoloadClasses['ApiRelationshipResponse'] = __DIR__ .
'/UserRelationship/ApiRelationshipResponse.php';
-$wgAPIModules['socialprofile-request-response'] = 'ApiRelationshipResponse';
-
// Echo (Notifications) stuff
// UserBoard
$wgHooks['BeforeCreateEchoEvent'][] =
'UserBoardHooks::onBeforeCreateEchoEvent';
@@ -94,10 +83,6 @@
$wgDefaultUserOptions['echo-subscriptions-web-social-msg'] = true;
$wgDefaultUserOptions['echo-subscriptions-email-social-msg'] = false;
-
-// UserRelationship
-$wgHooks['BeforeCreateEchoEvent'][] =
'UserRelationshipHooks::onBeforeCreateEchoEvent';
-$wgHooks['EchoGetDefaultNotifiedUsers'][] =
'UserRelationshipHooks::onEchoGetDefaultNotifiedUsers';
$wgDefaultUserOptions['echo-subscriptions-web-social-rel'] = true;
$wgDefaultUserOptions['echo-subscriptions-email-social-rel'] = false;
@@ -162,7 +147,10 @@
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/UserActivity', // UserActivity - recent social changes
+ 'SocialProfile/UserRelationship'
+] );
$wgHooks['BeforePageDisplay'][] = 'SocialProfileHooks::onBeforePageDisplay';
$wgHooks['CanonicalNamespaces'][] =
'SocialProfileHooks::onCanonicalNamespaces';
@@ -238,21 +226,6 @@
),
'localBasePath' => __DIR__ . '/UserBoard',
'remoteExtPath' => 'SocialProfile/UserBoard',
-);
-
-// UserRelationship
-$wgResourceModules['ext.socialprofile.userrelationship.css'] = array(
- 'styles' => 'UserRelationship.css',
- 'localBasePath' => __DIR__ . '/UserRelationship',
- 'remoteExtPath' => 'SocialProfile/UserRelationship',
- 'position' => 'top' // just in case
-);
-
-$wgResourceModules['ext.socialprofile.userrelationship.js'] = array(
- 'scripts' => 'UserRelationship.js',
- 'dependencies' => 'mediawiki.util',
- 'localBasePath' => __DIR__ . '/UserRelationship',
- 'remoteExtPath' => 'SocialProfile/UserRelationship',
);
// UserStats
diff --git a/UserRelationship/extension.json b/UserRelationship/extension.json
new file mode 100644
index 0000000..93ec451
--- /dev/null
+++ b/UserRelationship/extension.json
@@ -0,0 +1,57 @@
+{
+ "name": "UserRelationship",
+ "author": [
+ "Aaron Wright",
+ "David Pean",
+ "Jack Phoenix"
+ ],
+ "license-name": "GPL-2.0+",
+ "descriptionmsg": "userrelationship-desc",
+ "type": "other",
+ "MessagesDirs": {
+ "UserRelationship": [
+ "i18n"
+ ]
+ },
+ "AutoloadClasses": {
+ "EchoUserRelationshipPresentationModel":
"EchoUserRelationshipPresentationModel.php",
+ "UserRelationship": "UserRelationshipClass.php",
+ "UserRelationshipHooks": "UserRelationshipHooks.php",
+ "SpecialAddRelationship": "SpecialAddRelationship.php",
+ "SpecialRemoveRelationship": "SpecialRemoveRelationship.php",
+ "SpecialViewRelationshipRequests":
"SpecialViewRelationshipRequests.php",
+ "SpecialViewRelationships": "SpecialViewRelationships.php",
+ "ApiRelationshipResponse": "ApiRelationshipResponse.php"
+ },
+ "APIModules": {
+ "socialprofile-request-response": "ApiRelationshipResponse"
+ },
+ "Hooks": {
+ "BeforeCreateEchoEvent":
"UserRelationshipHooks::onBeforeCreateEchoEvent",
+ "EchoGetDefaultNotifiedUsers":
"UserRelationshipHooks::onEchoGetDefaultNotifiedUsers"
+ },
+ "DefaultUserOptions": {
+ "echo-subscriptions-web-social-rel": true,
+ "echo-subscriptions-email-social-rel": false
+ },
+ "SpecialPages": {
+ "AddRelationship": "SpecialAddRelationship",
+ "RemoveRelationship": "SpecialRemoveRelationship",
+ "ViewRelationshipRequests": "SpecialViewRelationshipRequests",
+ "ViewRelationships": "SpecialViewRelationships"
+ },
+ "ResourceModules": {
+ "ext.socialprofile.userrelationship.css": {
+ "styles": "UserRelationship.css",
+ "position": "top"
+ },
+ "ext.socialprofile.userrelationship.js": {
+ "scripts": "UserRelationship.js"
+ }
+ },
+ "ResourceFileModulePaths": {
+ "localBasePath": "",
+ "remoteExtPath": "SocialProfile/UserRelationship"
+ },
+ "manifest_version": 1
+}
\ No newline at end of file
diff --git a/UserRelationship/i18n/en.json b/UserRelationship/i18n/en.json
index 807ee2f..4ddceff 100644
--- a/UserRelationship/i18n/en.json
+++ b/UserRelationship/i18n/en.json
@@ -4,6 +4,7 @@
"David Pean"
]
},
+ "userrelationship-desc": "Adds a feature that allows sending
relationship requests",
"viewrelationships": "View relationship",
"viewrelationshiprequests": "View relationship requests",
"ur-already-submitted": "Your request has been sent",
diff --git a/UserRelationship/i18n/qqq.json b/UserRelationship/i18n/qqq.json
index 2c2ec3e..5931bc6 100644
--- a/UserRelationship/i18n/qqq.json
+++ b/UserRelationship/i18n/qqq.json
@@ -5,6 +5,7 @@
"Siebrand"
]
},
+ "userrelationship-desc":
"{{desc|name=UserRelationship|url=https://www.mediawiki.org/wiki/Extension:SocialProfile}}",
"ur-add-friend": "{{Identical|Add as friend}}",
"ur-add-foe": "{{Identical|Add as foe}}",
"ur-remove": "{{Identical|Remove}}",
--
To view, visit https://gerrit.wikimedia.org/r/392340
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia43cdc132314f784a785904fc03fb844df5cbbcb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SocialProfile
Gerrit-Branch: master
Gerrit-Owner: SamanthaNguyen <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits