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:
Fomafix
2019-01-29 05:46:19 +01:00
committed by Umherirrender
parent cad808c722
commit 808e7cc8cd

View File

@@ -164,16 +164,20 @@ class UniversalLanguageSelectorHooks {
* Add some tabs for navigation for users who do not use Ajax interface.
* Hook: PersonalUrls
* @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;
if ( $wgULSPosition !== 'personal' ) {
return;
}
$context = RequestContext::getMain();
if ( !self::isToolbarEnabled( $context->getUser() ) ) {
return;
}