Namespace extension

Change-Id: Ic480033a3a2418e41d39aaf777872587c11f1786
This commit is contained in:
Reedy 2022-02-06 15:20:58 +00:00
parent ac0d54cc7b
commit e49e7da070
2 changed files with 19 additions and 10 deletions

View file

@ -35,8 +35,8 @@
"i18n"
]
},
"AutoloadClasses": {
"MultimediaViewerHooks": "includes/MultimediaViewerHooks.php"
"AutoloadNamespaces": {
"MediaWiki\\Extension\\MultimediaViewer\\": "includes/"
},
"ResourceModules": {
"mmv": {
@ -454,17 +454,17 @@
}
},
"Hooks": {
"UserGetDefaultOptions": "MultimediaViewerHooks::onUserGetDefaultOptions",
"GetPreferences": "MultimediaViewerHooks::onGetPreferences",
"BeforePageDisplay": "MultimediaViewerHooks::onBeforePageDisplay",
"CategoryPageView": "MultimediaViewerHooks::onCategoryPageView",
"ResourceLoaderGetConfigVars": "MultimediaViewerHooks::onResourceLoaderGetConfigVars",
"UserGetDefaultOptions": "MediaWiki\\Extension\\MultimediaViewer\\Hooks::onUserGetDefaultOptions",
"GetPreferences": "MediaWiki\\Extension\\MultimediaViewer\\Hooks::onGetPreferences",
"BeforePageDisplay": "MediaWiki\\Extension\\MultimediaViewer\\Hooks::onBeforePageDisplay",
"CategoryPageView": "MediaWiki\\Extension\\MultimediaViewer\\Hooks::onCategoryPageView",
"ResourceLoaderGetConfigVars": "MediaWiki\\Extension\\MultimediaViewer\\Hooks::onResourceLoaderGetConfigVars",
"MakeGlobalVariablesScript": "main",
"ThumbnailBeforeProduceHTML": "MultimediaViewerHooks::onThumbnailBeforeProduceHTML"
"ThumbnailBeforeProduceHTML": "MediaWiki\\Extension\\MultimediaViewer\\Hooks::onThumbnailBeforeProduceHTML"
},
"HookHandlers": {
"main": {
"class": "MultimediaViewerHooks",
"class": "MediaWiki\\Extension\\MultimediaViewer\\Hooks",
"services": [
"UserOptionsLookup"
]

View file

@ -21,12 +21,21 @@
* @copyright Copyright © 2013, Mark Holmquist
*/
namespace MediaWiki\Extension\MultimediaViewer;
use Category;
use CategoryPage;
use ExtensionRegistry;
use MediaWiki\Hook\MakeGlobalVariablesScriptHook;
use MediaWiki\MediaWikiServices;
use MediaWiki\User\UserIdentity;
use MediaWiki\User\UserOptionsLookup;
use OutputPage;
use Skin;
use ThumbnailImage;
use User;
class MultimediaViewerHooks implements MakeGlobalVariablesScriptHook {
class Hooks implements MakeGlobalVariablesScriptHook {
/** Link to more information about this module */
protected static $infoLink =
'https://mediawiki.org/wiki/Special:MyLanguage/Extension:Media_Viewer/About';