CSteipp has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/93901


Change subject: Link rights to OAuth/grants instead of tooltips
......................................................................

Link rights to OAuth/grants instead of tooltips

Link each grant to the full description on OAuth/grants, instead of
compressing it into a single tooltip.

Bug: 55672
Change-Id: I73f28ffc9bdab3cdef7c0508abb9a26b7cba5a27
---
M backend/MWOAuthUtils.php
M frontend/specialpages/SpecialMWOAuthManageMyGrants.php
2 files changed, 9 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth 
refs/changes/01/93901/1

diff --git a/backend/MWOAuthUtils.php b/backend/MWOAuthUtils.php
index 35dc53d..133e2c9 100644
--- a/backend/MWOAuthUtils.php
+++ b/backend/MWOAuthUtils.php
@@ -471,4 +471,11 @@
 
                return $wgOAuthSecretKey ? hash_hmac( 'sha1', $secret, 
$wgOAuthSecretKey ) : $secret;
        }
+
+       public static function getGrantsLink( $grant ) {
+               return Linker::linkKnown(
+                       SpecialPage::getTitleFor( 'OAuth', 'grants', $grant ),
+                       htmlspecialchars( self::grantName( $grant ) )
+               );
+       }
 }
diff --git a/frontend/specialpages/SpecialMWOAuthManageMyGrants.php 
b/frontend/specialpages/SpecialMWOAuthManageMyGrants.php
index bf150db..c188ee5 100644
--- a/frontend/specialpages/SpecialMWOAuthManageMyGrants.php
+++ b/frontend/specialpages/SpecialMWOAuthManageMyGrants.php
@@ -157,7 +157,7 @@
                                'usedOnWiki' => array(
                                        'type' => 'info',
                                        'label-message' => 
'mwoauth-consumer-wiki',
-                                       'default' => $cmr->get( 'wiki', 
'MWOAuthUtils::getWikiIdName' )
+                                       'default' => $cmra->get( 'wiki', 
'MWOAuthUtils::getWikiIdName' )
                                ),
                                'grants'  => array(
                                        'type' => 'checkmatrix',
@@ -166,23 +166,12 @@
                                                $this->msg( 
'mwoauthmanagemygrants-grantaccept' )->escaped() => 'grant'
                                        ),
                                        'rows' => array_combine(
-                                               array_map( 'htmlspecialchars',
-                                                       
MWOAuthUtils::grantNames( $cmr->get( 'grants' ) ) ),
+                                               array_map( 
'MWOAuthUtils::getGrantsLink', $cmr->get( 'grants' ) ),
                                                $cmr->get( 'grants' )
                                        ),
                                        'default' => array_map(
                                                function( $g ) { return 
"grant-$g"; },
                                                $cmra->get( 'grants' )
-                                       ),
-                                       'tooltips' => array_combine(
-                                               array_map( 
'MWOAuthUtils::grantName', MWOAuthUtils::getValidGrants() ),
-                                               array_map(
-                                                       function( $rights ) use 
( $lang ) {
-                                                               return 
$lang->semicolonList( array_map(
-                                                                       
'User::getRightDescription', $rights ) );
-                                                       },
-                                                       
MWOAuthUtils::getRightsByGrant()
-                                               )
                                        ),
                                        'force-options-on' => array_map(
                                                function( $g ) { return 
"grant-$g"; },

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I73f28ffc9bdab3cdef7c0508abb9a26b7cba5a27
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: CSteipp <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to