手册:钩子/GalleryGetModes

This page is a translated version of the page Manual:Hooks/GalleryGetModes and the translation is 33% complete.
GalleryGetModes
version 1.22.0 (Gerrit change 67885)版可用
Allows extensions to add classes that can render different modes of a gallery.
定义函数:
public static function onGalleryGetModes( array &$modeArray ) { ... }
附加钩子: extension.json中:
{
	"Hooks": {
		"GalleryGetModes": "MediaWiki\\Extension\\MyExtension\\Hooks::onGalleryGetModes"
	}
}
调用自: 文件: gallery/ImageGalleryBase.php
介面: GalleryGetModesHook.php

更多有关附加钩子的信息,请参见Manual:Hooks
有关使用此钩子的扩展示例,请参见Category:GalleryGetModes extensions/zh

详情

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.