Skip to content

Commit

Permalink
Merge pull request #24 from lakejason0/dev-24
Browse files Browse the repository at this point in the history
Convert to the new hook system
  • Loading branch information
winstonsung authored Jan 18, 2024
2 parents 7e590a3 + ee8a924 commit d7e31de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 4 additions & 2 deletions includes/LakeusHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

namespace MediaWiki\Skins\Lakeus;

class LakeusHooks {
use MediaWiki\Preferences\Hook\GetPreferencesHook;

class LakeusHooks implements GetPreferencesHook {
/**
* @see https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Hooks/GetPreferences
* @param User $user
* @param array &$preferences
*/
public static function onGetPreferences( $user, &$preferences ) {
public function onGetPreferences( $user, &$preferences ) {
// A checkbox
$preferences['lakeus-enable-theme-designer'] = [
'type' => 'check',
Expand Down
7 changes: 6 additions & 1 deletion skin.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,13 @@
"AutoloadNamespaces": {
"MediaWiki\\Skins\\Lakeus\\": "includes/"
},
"HookHandlers": {
"LakeusHooks": {
"class": "MediaWiki\\Skins\\Lakeus\\LakeusHooks"
}
},
"Hooks": {
"GetPreferences": "MediaWiki\\Skins\\Lakeus\\LakeusHooks::onGetPreferences"
"GetPreferences": "LakeusHooks"
},
"DefaultUserOptions": {
"lakeus-enable-theme-designer": 0,
Expand Down

0 comments on commit d7e31de

Please sign in to comment.