Add "User rights management" link on user page toolbox
authorJuneHyeon Bae <devunt@gmail.com>
Sun, 10 Mar 2013 09:55:14 +0000 (18:55 +0900)
committerJuneHyeon Bae <devunt@gmail.com>
Sun, 10 Mar 2013 22:32:18 +0000 (07:32 +0900)
Bug: 34040
Change-Id: I507962161581c3d9ae928594d8d280be9a4ffbdd

RELEASE-NOTES-1.21
includes/SkinTemplate.php

index 883fb8b..03790c8 100644 (file)
@@ -115,6 +115,7 @@ production.
   uz, vi.
 * Added 'CategoryAfterPageAdded' and 'CategoryAfterPageRemoved' hooks.
 * (bug 33186) Add image rotation api "imagerotate"
+* (bug 34040) Add "User rights management" link on user page toolbox.
 
 === Bug fixes in 1.21 ===
 * (bug 40353) SpecialDoubleRedirect should support interwiki redirects.
index e1aec17..a7e567c 100644 (file)
@@ -1174,6 +1174,7 @@ class SkinTemplate extends Skin {
                $nav_urls['log'] = false;
                $nav_urls['blockip'] = false;
                $nav_urls['emailuser'] = false;
+               $nav_urls['userrights'] = false;
 
                // A print stylesheet is attached to all pages, but nobody ever
                // figures that out. :)  Add a link...
@@ -1241,6 +1242,13 @@ class SkinTemplate extends Skin {
                                        'href' => self::makeSpecialUrlSubpage( 'Emailuser', $rootUser )
                                );
                        }
+
+                       $sur = new UserrightsPage;
+                       if ( $sur->userCanExecute( $this->getUser() ) ) {
+                               $nav_urls['userrights'] = array(
+                                       'href' => self::makeSpecialUrlSubpage( 'UserRights', $rootUser )
+                               );
+                       }
                }
 
                wfProfileOut( __METHOD__ );
@@ -1439,7 +1447,7 @@ abstract class BaseTemplate extends QuickTemplate {
                                $toolbox['feeds']['links'][$key]['class'] = 'feedlink';
                        }
                }
-               foreach ( array( 'contributions', 'log', 'blockip', 'emailuser', 'upload', 'specialpages' ) as $special ) {
+               foreach ( array( 'contributions', 'log', 'blockip', 'emailuser', 'userrights', 'upload', 'specialpages' ) as $special ) {
                        if ( isset( $this->data['nav_urls'][$special] ) && $this->data['nav_urls'][$special] ) {
                                $toolbox[$special] = $this->data['nav_urls'][$special];
                                $toolbox[$special]['id'] = "t-$special";