Jump to content

Manual:Hooks/GalleryGetModes

From mediawiki.org
GalleryGetModes
Available from version 1.22.0 (Gerrit change 67885)
Allows extensions to add classes that can render different modes of a gallery.
Define function:
public static function onGalleryGetModes( array &$modeArray ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"GalleryGetModes": "MediaWiki\\Extension\\MyExtension\\Hooks::onGalleryGetModes"
	}
}
Called from: File(s): gallery/ImageGalleryBase.php
Interface: GalleryGetModesHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:GalleryGetModes extensions.

Details

[edit]

Allows an extension to add custom classes to render a gallery with. Add the mode name and the class to the associative array.

  • &$modeArray - An associative array mapping mode names to classes that implement that mode. It is expected all registered classes are a subclass of ImageGalleryBase.