Template:ExtensionHook

From Linux Web Expert


Template documentation

Copy and paste template

MyHook
Available from version ???

Define function:
public static function onMyHook( $x, $y ) { ... }
Attach hook:
$wgHooks['MyHook'][] = 'MyExtensionHooks::onMyHook';
Called from:File(s):

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

{{ExtensionHook
|name = MyHook
|version =
|gerrit =
|removed =
|summary =
|args = $x, $y
|extension =
|source =
|sourcefunction =
|sourceclass =
|newvarname =
|newvarlink =
|nocatdesc =
}}

Usage notes

name
The name of the hook. This is usually the same name as the sub-page.
version
The version of MediaWiki this hook was first introduced in.
rev
SVN revision in which this hook was first introduced. If this parameter is given, it will link to the appropriate CodeReview page (e.g. r115794).
gerrit
Gerrit change number in which this hook was first introduced. If this parameter is given, it will link to the appropriate Gerrit changeset page (e.g., Gerrit change 5)
removed
If the hook has been removed, the version of MediaWiki that it was removed in.
deprecated
If the hook has been deprecated (but not removed), the version of MediaWiki that it was deprecated in.
summary
A short description of the hook's purpose.
More detailed descriptions are desirable, and should be added to the main page content.
If you update the short description, please also update the two tables on Manual:Hooks .
args
The arguments, as used at the top of the function.
extension
Extension name where hook is called; for when the source is not in the MediaWiki core code repository.
source
Location (file name) which calls this hook in the code. Further locations can be added via source2...source10.
sourcefunction
Name of the function which calls this hook. Another can be added via sourcefunction2.
sourceclass
Name of the class which calls this hook.
newvarname
Used by {{Removed }} or {{Deprecated }} when removed or deprecated is set.
newvarlink
Used by {{Removed }} or {{Deprecated }} when removed or deprecated is set.
templatemode
Set to nocats if hook documentation should not appear in standard MediaWiki Categories.
By default, using this template places the documentation page into categories:
  • MediaWiki hooks
  • Hooks added in MediaWiki...
There are times when it is undesirable to automatically categorise the hook documentation. Examples would include when documenting a hook in an extension, or when documenting the template itself.
nocatdesc
If a hook is removed completely from MediaWiki version by setting yes, it will not show up the category description.

Template data

<templatedata> { "params": { "templatemode": { "label": { "en": "Template mode", "cs": "Režim šablony", "fr": "Mode du modèle" }, "type": "string", "description": { "fr": "Mettre nocats si la documentation de l'accroche ne doit pas apparaître dans les catégories standards de MediaWiki. On peut ne pas vouloir catégoriser la documentation de l'accroche : documenter une MyHook dans une extension, ou documenter le modèle lui-même. ", "cs": "Pokud by se dokumentace s upoutávkou neměla objevit ve standardních kategoriích MediaWiki, vložte nocats. Dokumentaci teaseru možná nebudete chtít kategorizovat: Dokumentování upoutávky v rozšíření nebo dokumentaci samotné šablony." }, "default": { "fr": "La page de documentation est placée dans les catégories des accroches Mediawiki, des accroches ajoutées à Mediawiki...", "cs": "Stránka dokumentace je umístěna v kategoriích Mediawiki hooks, hooks added to Mediawiki..." } }, "name": { "label": { "en": "Name", "cs": "Název", "fr": "Nom" }, "description": { "en": "The name of the hook. This is usually the same name as the sub-page.", "cs": "Název háčku. Obvykle se jedná o stejný název jako podstránky.", "fr": "nom de l'accroche (habituellement c'est celui de la sous-page)." }, "type": "string", "required": true, "example": { "fr": "name=CirrusSearchMappingConfig", "cs": "name=CirrusSearchMappingConfig" } }, "removed": { "label": { "en": "Version removed", "cs": "Verze odstraněna", "fr": "Supprimé" }, "description": { "en": "If the hook has been removed, the version of MediaWiki that it was removed in.", "cs": "Pokud byl háček odstraněn, verze MediaWiki, ve které byl odstraněn.", "fr": "version de MediaWiki dans laquelle l'accroche a été supprimée (si c'est le cas)" }, "type": "string" }, "newvarname": { "label": { "en": "Replacement name", "cs": "Náhradní jméno", "fr": "Nouveau nom" }, "description": { "en": "If the hook is either deprecated or removed, name the feature that replaces this hook, if there is any replacement.", "cs": "Pokud je háček zastaralý nebo odstraněný, pojmenujte funkci, která tento háček nahrazuje, pokud existuje nějaká náhrada.",

"fr": "nom utilisé par ou lorsque removed ou deprecated sont positionnés."

}, "type": "string" }, "newvarlink": { "label": { "en": "Replacement link", "cs": "Náhradní odkaz", "fr": "Nouveau lien" }, "description": { "en": "If the hook is either deprecated or removed, link to the feature that replaces this hook, if there is any replacement.", "cs": "Pokud je háček zastaralý nebo odstraněný, odkaz na funkci, která tento háček nahrazuje, pokud existuje nějaká náhrada.",

"fr": "lien utilisé par ou lorsque removed ou deprecated sont positionnés."

}, "type": "wiki-page-name" }, "deprecated": { "label": { "en": "Version deprecated", "cs": "Zastaralá verze", "fr": "Obsolète" }, "description": { "en": "If the hook has been deprecated, the version of MediaWiki that it was deprecated in.", "cs": "Pokud byl háček zastaralý, verze MediaWiki, ve které byl zastaralý.", "fr": "version de MediaWiki où l'accroche est obsolète (si l'accroche est déclarée obsolète et n'a pas été supprimée)" }, "type": "string" }, "version": { "label": { "en": "Version introduced", "cs": "Verze představena", "fr": "Version" }, "description": { "en": "The version of MediaWiki this hook was first introduced in.", "cs": "Verze MediaWiki, ve které byl tento háček poprvé představen.", "fr": "version de MediaWiki où l'accroche a été introduite." }, "type": "string", "suggested": true, "example": { "fr": "version=1.24.0", "cs": "version=1.24.0" } }, "rev": { "label": { "en": "SVN revision introduced", "cs": "Zavedena revize SVN", "fr": "Révision" }, "description": { "en": "SVN revision in which this hook was first introduced. If this parameter is given, it will link to the appropriate CodeReview page.", "cs": "Revize SVN, ve které byl tento háček poprvé představen. Pokud je tento parametr zadán, bude odkazovat na příslušnou stránku CodeReview.", "fr": "Numéro SVN de révision avec laquelle cette accroche a été introduite la première fois. Quand ce paramètre est fourni, il est lié à la page correspondante de la revue de code." }, "type": "string", "example": { "fr": "rev=r115794", "cs": "rev=r115794" } }, "gerrit": { "label": { "en": "Gerrit changeset introduced", "cs": "Zavedena sada změn Gerritu", "fr": "Gerrit" }, "description": { "en": "Gerrit change number in which this hook was first introduced. If this parameter is given, it will link to the appropriate Gerrit changeset page.", "cs": "Číslo změny Gerritu, ve kterém byl tento háček poprvé představen. Pokud je tento parametr zadán, bude odkazovat na příslušnou stránku sady změn Gerritu.", "fr": "numéro de modification Gerrit par lequel cette accroche a été introduite la première fois. Si ce paramètre est fourni, il sera lié à la page de ll'ensemble de corrections correspondant de Gerrit. " }, "type": "number", "suggested": true, "example": { "fr": "gerrit=104766", "cs": "gerrit=104766" } }, "summary": { "label": { "en": "Summary", "cs": "Souhrn", "fr": "Résumé" }, "description": { "en": "A short description of the hook's purpose. More detailed descriptions are desirable, and should be added to the main page content.", "cs": "Krátký popis účelu háčku. Podrobnější popisy jsou žádoucí a měly by být přidány do obsahu hlavní stránky.", "fr": "Courte présentation de l'accroche. La description complete se trouve dans le contenu de la page principale. Si vous mettez a jour la description courte, mettez à jour également les deux tables de Manual:Hooks." }, "type": "string", "suggested": true, "example": { "fr": "summary= Permet de configurer l'organisation des champs", "cs": "summary= Umožňuje nakonfigurovat organizaci polí" } }, "args": { "label": { "en": "Arguments", "cs": "Argumenty", "fr": "Arguments" }, "description": { "en": "The arguments that are defined by the hook signature.", "cs": "Argumenty, které jsou definovány podpisem háčku.", "fr": "tels qu'il sont utilisés à l'entrée de la fonction" }, "required": true, "type": "string", "example": { "fr": "args=array &$config, MappingConfigBuilder $builder", "cs": "args=array &$config, MappingConfigBuilder $builder" } }, "extension": { "label": { "en": "Extension name", "cs": "Název rozšíření", "fr": "Extension" }, "description": { "en": "Extension name where the hook is called; for when the source is not in the MediaWiki core code repository.", "cs": "Název rozšíření, kde je jmenován hook; pro případ, že zdroj není v úložišti základního kódu MediaWiki.", "fr": "nom de l'extension où l'accroche est appelée; dans les cas où le source n'est pas dans le dépôt de code du noyau MediaWiki." }, "type": "wiki-page-name", "required": true, "example": { "fr": "extension=CirrusSearch", "cs": "extension=CirrusSearch" } }, "source": { "label": { "en": "Source 1", "cs": "Zdroj 1", "fr": "Source 1" }, "description": { "en": "Location (file name) which calls this hook in the code.", "cs": "Umístění (název souboru), který volá tento háček v kódu.", "fr": "nom du fichier de code source qui appelle cette accroche. D'autres endroits peuvent être ajoutés avec source2 ... source10" }, "type": "string", "suggested": true, "example": { "fr": "source=includes/Maintenance/MappingConfigBuilder.php", "cs": "source=includes/Maintenance/MappingConfigBuilder.php" } }, "source2": { "label": { "en": "Source 2", "cs": "Zdroj 2", "fr": "Source 2" }, "description": { "en": "Location (file name) which calls this hook in the code, if another source exists", "cs": "Umístění (název souboru), který volá tento háček v kódu, pokud existuje jiný zdroj", "fr": "nom du second fichier de code source qui appelle cette accroche; voir source" }, "type": "string" }, "source3": { "label": { "en": "Source 3", "cs": "Zdroj 3", "fr": "Source 3" }, "description": { "en": "Location (file name) which calls this hook in the code, if another source exists", "cs": "Umístění (název souboru), který volá tento háček v kódu, pokud existuje jiný zdroj", "fr": "nom du troisième fichier de code source qui appelle cette accroche; voir source" }, "type": "string" }, "source4": { "label": { "en": "Source 4", "cs": "Zdroj 4", "fr": "Source 4" }, "description": { "en": "Location (file name) which calls this hook in the code, if another source exists", "cs": "Umístění (název souboru), který volá tento háček v kódu, pokud existuje jiný zdroj", "fr": "nom du quatrième fichier de code source qui appelle cette accroche; voir source" }, "type": "string" }, "source5": { "label": { "en": "Source 5", "cs": "Zdroj 5", "fr": "Source 5" }, "description": { "en": "Location (file name) which calls this hook in the code, if another source exists", "cs": "Umístění (název souboru), který volá tento háček v kódu, pokud existuje jiný zdroj", "fr": "nom du cinquième fichier de code source qui appelle cette accroche; voir source" }, "type": "string" }, "source6": { "label": { "en": "Source 6", "cs": "Zdroj 6", "fr": "Source 6" }, "description": { "en": "Location (file name) which calls this hook in the code, if another source exists", "cs": "Umístění (název souboru), který volá tento háček v kódu, pokud existuje jiný zdroj", "fr": "nom du sixième fichier de code source qui appelle cette accroche; voir source" }, "type": "string" }, "source7": { "label": { "en": "Source 7", "cs": "Zdroj 7", "fr": "Source 7" }, "description": { "en": "Location (file name) which calls this hook in the code, if another source exists", "cs": "Umístění (název souboru), který volá tento háček v kódu, pokud existuje jiný zdroj", "fr": "nom du septième fichier de code source qui appelle cette accroche; voir source" }, "type": "string" }, "source8": { "label": { "en": "Source 8", "cs": "Zdroj 8", "fr": "Source 8" }, "description": { "en": "Location (file name) which calls this hook in the code, if another source exists", "cs": "Umístění (název souboru), který volá tento háček v kódu, pokud existuje jiný zdroj", "fr": "nom du huitième fichier de code source qui appelle cette accroche; voir source" }, "type": "string" }, "source9": { "label": { "en": "Source 9", "cs": "Zdroj 9", "fr": "Source 9" }, "description": { "en": "Location (file name) which calls this hook in the code, if another source exists", "cs": "Umístění (název souboru), který volá tento háček v kódu, pokud existuje jiný zdroj", "fr": "nom du neuvième fichier de code source qui appelle cette accroche; voir source" }, "type": "string" }, "source10": { "label": { "en": "Source 10", "cs": "Zdroj 10", "fr": "Source 10" }, "description": { "en": "Location (file name) which calls this hook in the code, if another source exists", "cs": "Umístění (název souboru), který volá tento háček v kódu, pokud existuje jiný zdroj", "fr": "nom du dixième fichier de code source qui appelle cette accroche; voir source" }, "type": "string" }, "sourcefunction": { "label": { "en": "Source function", "cs": "Funkce zdroje", "fr": "Fonction appelante" }, "description": { "en": "Name of the function which calls this hook", "cs": "Název funkce, která volá tento háček", "fr": "nom de la fonction qui appelle cette accroche. Vous pouvez en ajouter une autre avec sourcefunction2." }, "type": "string", "suggested": true, "example": { "fr": "sourcefunction = getUserBlockDetails", "cs": "sourcefunction = getUserBlockDetails" } }, "sourceclass": { "label": { "en": "Source class", "cs": "Třída zdroje", "fr": "Classe appelante" }, "description": { "en": "The fully qualified class name (FQCN) which calls this hook.", "cs": "Plně kvalifikovaný název třídy (FQCN), který volá tento háček.", "fr": "nom complètement qualifié (format FQCN) de la classe qui appelle cette accroche" }, "suggested": true, "type": "string", "example": { "fr": "sourceclass=CirrusSearch\\Maintenance\\MappingConfigBuilder", "cs": "sourceclass=CirrusSearch\\Maintenance\\MappingConfigBuilder" } }, "sourcefunction2": { "label": { "en": "Source function 2", "cs": "Funkce zdroje 2", "fr": "Autre source appelant" }, "description": { "en": "Name of the function which calls this hook, if another functions call this hook", "cs": "Název funkce, která volá tento háček, pokud ho jiné funkce volají", "fr": "comme sourcefunction mais nom d'une autre fonction (s'il elle existe) qui appelle aussi cette accroche " }, "type": "string" }, "nocatdesc": { "label": { "en": "No category description", "cs": "Žádný popis kategorie", "fr": "Sans description" }, "description": { "en": "Allows to hide the category hook description if the hook was removed completely from MediaWiki version.", "cs": "Umožňuje skrýt popis háčku kategorie, pokud byl háček zcela odstraněn z verze MediaWiki.", "fr": "avec yes, si une accroche est supprimée complètement d'une version MediaWiki, la description de la catégorie ne sera pas affichée afin de la garder cachée." }, "type": "string", "example": { "fr": "nocatdesc=yes", "cs": "nocatdesc=yes" } }, "gerritremoved": { "label": "Gerrit ID of removal", "type": "number" }, "gerritdeprecated": { "label": "Gerrit ID of deprecation", "type": "number" } }, "description": { "en": "A card which describes the information of a hook registered by an extension.", "cs": "Karta, která popisuje informace o háčku registrovaném rozšířením.", "fr": "Fiche décrivant les informations d'une accroche enregistrée par une extension." }, "paramOrder": [ "templatemode", "name", "rev", "gerrit", "version", "deprecated", "gerritdeprecated", "removed", "gerritremoved", "newvarname", "newvarlink", "summary", "args", "extension", "source", "source2", "source3", "source4", "source5", "source6", "source7", "source8", "source9", "source10", "sourceclass", "sourcefunction", "sourcefunction2", "nocatdesc" ], "format": "block" } </templatedata>

See also