Jack Phoenix has submitted this change and it was merged.

Change subject: Set the correct special page headers so that "What links here" 
and "Page info" won't show up on the toolbox when you're viewing these special 
pages.
......................................................................


Set the correct special page headers so that "What links here" and "Page
info" won't show up on the toolbox when you're viewing these special
pages.

Also fixed a bug with the "Use social userpage/Use wiki userpage" button
label message in UserProfile/UserProfilePage.php. Previously it would
display (at least initially) "Use social userpage" even when you were
already using it (in which case the label should've prompted you to "Use
wiki userpage" instead).

Change-Id: I0269d5ed560f233bd0736ac710d00aaaab5c71f2
---
M SystemGifts/SpecialPopulateAwards.php
M SystemGifts/SpecialRemoveMasterSystemGift.php
M SystemGifts/SpecialSystemGiftManager.php
M SystemGifts/SpecialSystemGiftManagerLogo.php
M SystemGifts/SpecialViewSystemGift.php
M SystemGifts/SpecialViewSystemGifts.php
M SystemGifts/TopAwards.php
M UserActivity/UserActivity.body.php
M UserBoard/SpecialSendBoardBlast.php
M UserBoard/SpecialUserBoard.php
M UserGifts/SpecialGiftManager.php
M UserGifts/SpecialGiftManagerLogo.php
M UserGifts/SpecialGiveGift.php
M UserGifts/SpecialRemoveGift.php
M UserGifts/SpecialRemoveMasterGift.php
M UserGifts/SpecialViewGift.php
M UserGifts/SpecialViewGifts.php
M UserProfile/SpecialEditProfile.php
M UserProfile/SpecialRemoveAvatar.php
M UserProfile/SpecialUpdateProfile.php
M UserProfile/UserProfilePage.php
M UserRelationship/SpecialViewRelationshipRequests.php
M UserRelationship/SpecialViewRelationships.php
M UserStats/TopFansByStat.php
M UserStats/TopFansRecent.php
M UserStats/TopUsers.php
26 files changed, 78 insertions(+), 3 deletions(-)

Approvals:
  Jack Phoenix: Verified; Looks good to me, approved



diff --git a/SystemGifts/SpecialPopulateAwards.php 
b/SystemGifts/SpecialPopulateAwards.php
index a49e19f..0b2ebbb 100644
--- a/SystemGifts/SpecialPopulateAwards.php
+++ b/SystemGifts/SpecialPopulateAwards.php
@@ -45,6 +45,10 @@
                        return;
                }
 
+               // Set the robot policies, etc.
+               $out->setArticleRelated( false );
+               $out->setRobotPolicy( 'noindex,nofollow' );
+
                $wgUserLevels = '';
 
                $g = new SystemGifts();
diff --git a/SystemGifts/SpecialRemoveMasterSystemGift.php 
b/SystemGifts/SpecialRemoveMasterSystemGift.php
index 72896e5..54d9a06 100644
--- a/SystemGifts/SpecialRemoveMasterSystemGift.php
+++ b/SystemGifts/SpecialRemoveMasterSystemGift.php
@@ -59,6 +59,10 @@
                        return;
                }
 
+               // Set the robot policies, etc.
+               $out->setArticleRelated( false );
+               $out->setRobotPolicy( 'noindex,nofollow' );
+
                // Add CSS
                $out->addModules( 'ext.socialprofile.systemgifts.css' );
 
diff --git a/SystemGifts/SpecialSystemGiftManager.php 
b/SystemGifts/SpecialSystemGiftManager.php
index f3b26a6..b510ed9 100644
--- a/SystemGifts/SpecialSystemGiftManager.php
+++ b/SystemGifts/SpecialSystemGiftManager.php
@@ -26,7 +26,8 @@
                $request = $this->getRequest();
                $user = $this->getUser();
 
-               $out->setPageTitle( $this->msg( 'systemgiftmanager' )->plain() 
);
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
 
                // If the user doesn't have the required 'awardsmanage' 
permission, display an error
                if ( !$user->isAllowed( 'awardsmanage' ) ) {
diff --git a/SystemGifts/SpecialSystemGiftManagerLogo.php 
b/SystemGifts/SpecialSystemGiftManagerLogo.php
index 7d983de..85cd4c0 100644
--- a/SystemGifts/SpecialSystemGiftManagerLogo.php
+++ b/SystemGifts/SpecialSystemGiftManagerLogo.php
@@ -35,6 +35,10 @@
                $request = $this->getRequest();
                $user = $this->getUser();
 
+               // Set the robot policies, etc.
+               $out->setArticleRelated( false );
+               $out->setRobotPolicy( 'noindex,nofollow' );
+
                // If the user doesn't have the required 'awardsmanage' 
permission, display an error
                if ( !$user->isAllowed( 'awardsmanage' ) ) {
                        $out->permissionRequired( 'awardsmanage' );
diff --git a/SystemGifts/SpecialViewSystemGift.php 
b/SystemGifts/SpecialViewSystemGift.php
index 82f4d41..57bce35 100644
--- a/SystemGifts/SpecialViewSystemGift.php
+++ b/SystemGifts/SpecialViewSystemGift.php
@@ -26,6 +26,9 @@
                $out = $this->getOutput();
                $user = $this->getUser();
 
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
+
                // Add CSS
                $out->addModules( 'ext.socialprofile.systemgifts.css' );
 
diff --git a/SystemGifts/SpecialViewSystemGifts.php 
b/SystemGifts/SpecialViewSystemGifts.php
index d06cbc0..b99dd4e 100644
--- a/SystemGifts/SpecialViewSystemGifts.php
+++ b/SystemGifts/SpecialViewSystemGifts.php
@@ -27,6 +27,9 @@
                $request = $this->getRequest();
                $user = $this->getUser();
 
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
+
                // Add CSS
                $out->addModules( 'ext.socialprofile.systemgifts.css' );
 
diff --git a/SystemGifts/TopAwards.php b/SystemGifts/TopAwards.php
index 741b719..da1aa20 100644
--- a/SystemGifts/TopAwards.php
+++ b/SystemGifts/TopAwards.php
@@ -114,7 +114,10 @@
                        array( 'system_gift' => array( 'INNER JOIN', 
'gift_id=sg_gift_id' ) )
                );
 
-               // Page title
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
+
+               // Set the correct page title ;)
                // for grep: topawards-edit-title, topawards-vote-title,
                // topawards-comment-title, topawards-recruit-title,
                // topawards-friend-title
diff --git a/UserActivity/UserActivity.body.php 
b/UserActivity/UserActivity.body.php
index fdf3b82..aeb8852 100644
--- a/UserActivity/UserActivity.body.php
+++ b/UserActivity/UserActivity.body.php
@@ -31,6 +31,9 @@
                // Add CSS
                $out->addModules( 'ext.socialprofile.useractivity.css' );
 
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
+
                $out->setPageTitle( $this->msg( 'useractivity-title' )->plain() 
);
 
                $output = '';
diff --git a/UserBoard/SpecialSendBoardBlast.php 
b/UserBoard/SpecialSendBoardBlast.php
index b445d5d..60692a0 100644
--- a/UserBoard/SpecialSendBoardBlast.php
+++ b/UserBoard/SpecialSendBoardBlast.php
@@ -29,6 +29,9 @@
                $request = $this->getRequest();
                $user = $this->getUser();
 
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
+
                // This feature is available only to logged-in users.
                if ( !$user->isLoggedIn() ) {
                        $out->setPageTitle( $this->msg( 'boardblastlogintitle' 
)->plain() );
diff --git a/UserBoard/SpecialUserBoard.php b/UserBoard/SpecialUserBoard.php
index bf2ee2a..c6aeea8 100644
--- a/UserBoard/SpecialUserBoard.php
+++ b/UserBoard/SpecialUserBoard.php
@@ -28,6 +28,9 @@
                $request = $this->getRequest();
                $currentUser = $this->getUser();
 
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
+
                // Add CSS & JS
                $out->addModules( array(
                        'ext.socialprofile.userboard.css',
diff --git a/UserGifts/SpecialGiftManager.php b/UserGifts/SpecialGiftManager.php
index 27e6d94..ebc5608 100644
--- a/UserGifts/SpecialGiftManager.php
+++ b/UserGifts/SpecialGiftManager.php
@@ -23,6 +23,9 @@
                $request = $this->getRequest();
                $user = $this->getUser();
 
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
+
                $out->setPageTitle( $this->msg( 'giftmanager' )->plain() );
 
                // Make sure that the user is logged in and that they can use 
this
diff --git a/UserGifts/SpecialGiftManagerLogo.php 
b/UserGifts/SpecialGiftManagerLogo.php
index b13f117..23aeb2b 100644
--- a/UserGifts/SpecialGiftManagerLogo.php
+++ b/UserGifts/SpecialGiftManagerLogo.php
@@ -113,6 +113,10 @@
 
                $this->avatarUploadDirectory = $wgUploadDirectory . '/awards';
 
+               // Set the robot policies, etc.
+               $out->setArticleRelated( false );
+               $out->setRobotPolicy( 'noindex,nofollow' );
+
                /** Show an error message if file upload is disabled */
                if ( !$wgEnableUploads ) {
                        $out->addWikiMsg( 'uploaddisabled' );
diff --git a/UserGifts/SpecialGiveGift.php b/UserGifts/SpecialGiveGift.php
index d42c0d3..b47edd6 100644
--- a/UserGifts/SpecialGiveGift.php
+++ b/UserGifts/SpecialGiveGift.php
@@ -29,6 +29,9 @@
 
                $output = ''; // Prevent E_NOTICE
 
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
+
                // Add CSS & JS
                $out->addModules( array(
                        'ext.socialprofile.usergifts.css',
diff --git a/UserGifts/SpecialRemoveGift.php b/UserGifts/SpecialRemoveGift.php
index 711d76d..3739032 100644
--- a/UserGifts/SpecialRemoveGift.php
+++ b/UserGifts/SpecialRemoveGift.php
@@ -21,6 +21,9 @@
                $request = $this->getRequest();
                $user = $this->getUser();
 
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
+
                // Add CSS
                $out->addModules( 'ext.socialprofile.usergifts.css' );
 
diff --git a/UserGifts/SpecialRemoveMasterGift.php 
b/UserGifts/SpecialRemoveMasterGift.php
index 9be8604..d73e9dc 100644
--- a/UserGifts/SpecialRemoveMasterGift.php
+++ b/UserGifts/SpecialRemoveMasterGift.php
@@ -55,6 +55,9 @@
                $out = $this->getOutput();
                $request = $this->getRequest();
 
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
+
                // Add CSS
                $out->addModules( 'ext.socialprofile.usergifts.css' );
 
diff --git a/UserGifts/SpecialViewGift.php b/UserGifts/SpecialViewGift.php
index 6cc1fbe..6d00269 100644
--- a/UserGifts/SpecialViewGift.php
+++ b/UserGifts/SpecialViewGift.php
@@ -20,6 +20,9 @@
                $out = $this->getOutput();
                $user = $this->getUser();
 
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
+
                // Add CSS
                $out->addModules( 'ext.socialprofile.usergifts.css' );
 
diff --git a/UserGifts/SpecialViewGifts.php b/UserGifts/SpecialViewGifts.php
index 5e73fce..b614bda 100644
--- a/UserGifts/SpecialViewGifts.php
+++ b/UserGifts/SpecialViewGifts.php
@@ -28,6 +28,9 @@
                $request = $this->getRequest();
                $currentUser = $this->getUser();
 
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
+
                // Add CSS
                $out->addModules( 'ext.socialprofile.usergifts.css' );
 
diff --git a/UserProfile/SpecialEditProfile.php 
b/UserProfile/SpecialEditProfile.php
index feaf4f0..bbdc9ff 100644
--- a/UserProfile/SpecialEditProfile.php
+++ b/UserProfile/SpecialEditProfile.php
@@ -31,6 +31,8 @@
 
                $wgSupressPageTitle = true;
 
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
                $out->setHTMLTitle( $this->msg( 'pagetitle',
                        $this->msg( 'edit-profiles-title' )->plain() )->plain() 
);
 
diff --git a/UserProfile/SpecialRemoveAvatar.php 
b/UserProfile/SpecialRemoveAvatar.php
index 6c6e42c..800d263 100644
--- a/UserProfile/SpecialRemoveAvatar.php
+++ b/UserProfile/SpecialRemoveAvatar.php
@@ -50,6 +50,8 @@
                        return;
                }
 
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
                $out->setPageTitle( $this->msg( 'avatarupload-removeavatar' 
)->plain() );
 
                if ( $request->getVal( 'user' ) != '' ) {
diff --git a/UserProfile/SpecialUpdateProfile.php 
b/UserProfile/SpecialUpdateProfile.php
index 19d11a7..754c8e7 100644
--- a/UserProfile/SpecialUpdateProfile.php
+++ b/UserProfile/SpecialUpdateProfile.php
@@ -59,6 +59,8 @@
 
                $wgSupressPageTitle = true;
 
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
                $out->setHTMLTitle( $this->msg( 'pagetitle', $this->msg( 
'edit-profile-title' )->plain() )->plain() );
 
                // This feature is only available for logged-in users.
diff --git a/UserProfile/UserProfilePage.php b/UserProfile/UserProfilePage.php
index 12531d7..802de7c 100644
--- a/UserProfile/UserProfilePage.php
+++ b/UserProfile/UserProfilePage.php
@@ -847,7 +847,8 @@
 
                if ( $this->isOwner() ) {
                        $toggle_title = SpecialPage::getTitleFor( 
'ToggleUserPage' );
-                       if ( $this->profile_data['user_page_type'] == 1 ) {
+                       // Cast it to an int because PHP is stupid.
+                       if ( (int) $profile_data['user_page_type'] == 1 ) {
                                $toggleMessage = wfMsg( 'user-type-toggle-old' 
);
                        } else {
                                $toggleMessage = wfMsg( 'user-type-toggle-new' 
);
diff --git a/UserRelationship/SpecialViewRelationshipRequests.php 
b/UserRelationship/SpecialViewRelationshipRequests.php
index 468016f..011e909 100644
--- a/UserRelationship/SpecialViewRelationshipRequests.php
+++ b/UserRelationship/SpecialViewRelationshipRequests.php
@@ -28,6 +28,9 @@
                $out = $this->getOutput();
                $user = $this->getUser();
 
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
+
                /**
                 * Redirect anonymous users to the login page
                 * It will automatically return them to the 
ViewRelationshipRequests page
diff --git a/UserRelationship/SpecialViewRelationships.php 
b/UserRelationship/SpecialViewRelationships.php
index cd45dcf..cd13e6a 100644
--- a/UserRelationship/SpecialViewRelationships.php
+++ b/UserRelationship/SpecialViewRelationships.php
@@ -31,6 +31,9 @@
                $request = $this->getRequest();
                $user = $this->getUser();
 
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
+
                // Add CSS
                $out->addModules( 'ext.socialprofile.userrelationship.css' );
 
diff --git a/UserStats/TopFansByStat.php b/UserStats/TopFansByStat.php
index e5e92af..6870adc 100644
--- a/UserStats/TopFansByStat.php
+++ b/UserStats/TopFansByStat.php
@@ -29,6 +29,9 @@
                $out = $this->getOutput();
                $request = $this->getRequest();
 
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
+
                // Load CSS
                $out->addModules( 'ext.socialprofile.userstats.css' );
 
diff --git a/UserStats/TopFansRecent.php b/UserStats/TopFansRecent.php
index 9b2a3f0..6393fa2 100644
--- a/UserStats/TopFansRecent.php
+++ b/UserStats/TopFansRecent.php
@@ -21,6 +21,9 @@
                $request = $this->getRequest();
                $user = $this->getUser();
 
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
+
                // Load CSS
                $out->addModules( 'ext.socialprofile.userstats.css' );
 
diff --git a/UserStats/TopUsers.php b/UserStats/TopUsers.php
index fc8016f..1382a6b 100644
--- a/UserStats/TopUsers.php
+++ b/UserStats/TopUsers.php
@@ -22,6 +22,9 @@
                // Load CSS
                $out->addModules( 'ext.socialprofile.userstats.css' );
 
+               // Set the page title, robot policies, etc.
+               $this->setHeaders();
+
                $out->setPageTitle( $this->msg( 'user-stats-alltime-title' 
)->plain() );
 
                $count = 100;

-- 
To view, visit https://gerrit.wikimedia.org/r/107011
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0269d5ed560f233bd0736ac710d00aaaab5c71f2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SocialProfile
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix <j...@countervandalism.net>
Gerrit-Reviewer: Jack Phoenix <j...@countervandalism.net>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to