jenkins-bot has submitted this change and it was merged. ( 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(+), 35 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/SocialProfile.php b/SocialProfile.php index f36b3b3..8c9c02c 100644 --- a/SocialProfile.php +++ b/SocialProfile.php @@ -28,7 +28,6 @@ $wgExtensionMessagesFiles['SocialProfileAlias'] = __DIR__ . '/SocialProfile.alias.php'; $wgMessagesDirs['SocialProfileUserProfile'] = __DIR__ . '/UserProfile/i18n'; -$wgMessagesDirs['SocialProfileUserRelationship'] = __DIR__ . '/UserRelationship/i18n'; $wgMessagesDirs['SocialProfileUserStats'] = __DIR__ . '/UserStats/i18n'; $wgExtensionMessagesFiles['SocialProfileNamespaces'] = __DIR__ . '/SocialProfile.namespaces.php'; @@ -36,25 +35,18 @@ // Classes to be autoloaded $wgAutoloadClasses['GenerateTopUsersReport'] = __DIR__ . '/UserStats/GenerateTopUsersReport.php'; -$wgAutoloadClasses['EchoUserRelationshipPresentationModel'] = __DIR__ . '/UserRelationship/EchoUserRelationshipPresentationModel.php'; $wgAutoloadClasses['EchoUserLevelAdvancePresentationModel'] = __DIR__ . '/UserStats/EchoUserLevelAdvancePresentationModel.php'; -$wgAutoloadClasses['SpecialAddRelationship'] = __DIR__ . '/UserRelationship/SpecialAddRelationship.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['RemoveAvatar'] = __DIR__ . '/UserProfile/SpecialRemoveAvatar.php'; $wgAutoloadClasses['UpdateEditCounts'] = __DIR__ . '/UserStats/SpecialUpdateEditCounts.php'; $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/UserLevel.php'; $wgAutoloadClasses['UserStats'] = __DIR__ . '/UserStats/UserStats.php'; @@ -71,14 +63,6 @@ $wgAutoloadClasses['ApiUserProfilePrivacy'] = __DIR__ . '/UserProfile/ApiUserProfilePrivacy.php'; $wgAPIModules['smpuserprivacy'] = 'ApiUserProfilePrivacy'; -$wgAutoloadClasses['ApiRelationshipResponse'] = __DIR__ . '/UserRelationship/ApiRelationshipResponse.php'; -$wgAPIModules['socialprofile-request-response'] = 'ApiRelationshipResponse'; - -// Echo (Notifications) stuff -// UserRelationship -$wgHooks['BeforeCreateEchoEvent'][] = 'UserRelationshipHooks::onBeforeCreateEchoEvent'; -$wgHooks['EchoGetDefaultNotifiedUsers'][] = 'UserRelationshipHooks::onEchoGetDefaultNotifiedUsers'; - $wgDefaultUserOptions['echo-subscriptions-web-social-rel'] = true; $wgDefaultUserOptions['echo-subscriptions-email-social-rel'] = false; @@ -90,12 +74,10 @@ $wgDefaultUserOptions['echo-subscriptions-email-social-level-up'] = false; // New special pages -$wgSpecialPages['AddRelationship'] = 'SpecialAddRelationship'; $wgSpecialPages['EditProfile'] = 'SpecialEditProfile'; $wgSpecialPages['GenerateTopUsersReport'] = 'GenerateTopUsersReport'; $wgSpecialPages['PopulateUserProfiles'] = 'SpecialPopulateUserProfiles'; $wgSpecialPages['RemoveAvatar'] = 'RemoveAvatar'; -$wgSpecialPages['RemoveRelationship'] = 'SpecialRemoveRelationship'; $wgSpecialPages['TopFansByStatistic'] = 'TopFansByStat'; $wgSpecialPages['TopUsers'] = 'TopUsersPoints'; $wgSpecialPages['TopUsersRecent'] = 'TopFansRecent'; @@ -103,8 +85,6 @@ $wgSpecialPages['UpdateEditCounts'] = 'UpdateEditCounts'; $wgSpecialPages['UpdateProfile'] = 'SpecialUpdateProfile'; $wgSpecialPages['UploadAvatar'] = 'SpecialUploadAvatar'; -$wgSpecialPages['ViewRelationshipRequests'] = 'SpecialViewRelationshipRequests'; -$wgSpecialPages['ViewRelationships'] = 'SpecialViewRelationships'; // What to display on social profile pages by default? $wgUserProfileDisplay['board'] = true; @@ -167,6 +147,7 @@ 'SocialProfile/SystemGifts', // SystemGifts (awards functionality) 'SocialProfile/UserActivity', // UserActivity - recent social changes 'SocialProfile/UserBoard', + 'SocialProfile/UserRelationship', ] ); $wgHooks['BeforePageDisplay'][] = 'SocialProfileHooks::onBeforePageDisplay'; @@ -210,21 +191,6 @@ 'position' => 'bottom', 'localBasePath' => __DIR__ . '/shared', 'remoteExtPath' => 'SocialProfile/shared', -); - -// 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..65af8b2 --- /dev/null +++ b/UserRelationship/extension.json @@ -0,0 +1,60 @@ +{ + "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", + "dependencies": [ + "mediawiki.util" + ] + } + }, + "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: merged Gerrit-Change-Id: Ia43cdc132314f784a785904fc03fb844df5cbbcb Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/SocialProfile Gerrit-Branch: master Gerrit-Owner: SamanthaNguyen <samanthanguyen1...@gmail.com> Gerrit-Reviewer: Jack Phoenix <ash...@uncyclomedia.co> Gerrit-Reviewer: Legoktm <lego...@member.fsf.org> Gerrit-Reviewer: Lewis Cawte <le...@lewiscawte.me> Gerrit-Reviewer: Siebrand <siebr...@kitano.nl> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits