Get context from hook PersonalUrls
The hook PersonalUrls provides as third parameter an instance of the SkinTemplate class. This provides the context. Also fix the type of the $title parameter from string to Title in the @param comment. Change-Id: I35f4445292a4562718ab094bd62c0fa988abec19
This commit is contained in:
@@ -164,16 +164,20 @@ class UniversalLanguageSelectorHooks {
|
|||||||
* Add some tabs for navigation for users who do not use Ajax interface.
|
* Add some tabs for navigation for users who do not use Ajax interface.
|
||||||
* Hook: PersonalUrls
|
* Hook: PersonalUrls
|
||||||
* @param array &$personal_urls
|
* @param array &$personal_urls
|
||||||
* @param string &$title
|
* @param Title &$title
|
||||||
|
* @param SkinTemplate $context SkinTemplate object providing context
|
||||||
*/
|
*/
|
||||||
public static function addPersonalBarTrigger( array &$personal_urls, &$title ) {
|
public static function addPersonalBarTrigger(
|
||||||
|
array &$personal_urls,
|
||||||
|
&$title,
|
||||||
|
SkinTemplate $context
|
||||||
|
) {
|
||||||
global $wgULSPosition;
|
global $wgULSPosition;
|
||||||
|
|
||||||
if ( $wgULSPosition !== 'personal' ) {
|
if ( $wgULSPosition !== 'personal' ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$context = RequestContext::getMain();
|
|
||||||
if ( !self::isToolbarEnabled( $context->getUser() ) ) {
|
if ( !self::isToolbarEnabled( $context->getUser() ) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user