You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
681 B
PHTML
19 lines
681 B
PHTML
2 years ago
|
<?php
|
||
|
namespace Isekai\ChatComplete;
|
||
|
|
||
|
use MediaWiki\MediaWikiServices;
|
||
|
use Config;
|
||
|
|
||
|
class Hooks {
|
||
|
public static function onLoad(\OutputPage $outputPage) {
|
||
|
$user = $outputPage->getUser();
|
||
|
$permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
|
||
|
if ($user->isRegistered() && $permissionManager->userHasRight($user, 'chatcomplete')) {
|
||
|
$outputPage->addModules(["ext.isekai.chatcomplete.launcher"]);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public static function onResourceLoaderGetConfigVars(array &$vars, string $skin, Config $config){
|
||
|
$vars['wgIsekaiChatCompleteFrontendUrl'] = $config->get('IsekaiChatCompleteFrontendUrl');
|
||
|
}
|
||
|
}
|