Manual:Hooks/SkinTemplateTabAction

From Linux Web Expert

SkinTemplateTabAction
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
<translate> Removed in <tvar name=1><translate> version <tvar (Gerrit change 701109)</tvar></translate>
Override SkinTemplate::tabAction().
<translate> Define function:</translate>
public static function onSkinTemplateTabAction( &$sktemplate, $title, $message, $selected, $checkEdit, &$classes, &$query, &$text, &$result ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"SkinTemplateTabAction": "MediaWiki\\Extension\\MyExtension\\Hooks::onSkinTemplateTabAction"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> skins/SkinTemplate.php
<translate> Interface:</translate> SkinTemplateTabActionHook.php

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:SkinTemplateTabAction extensions</tvar>.</translate>


Details

You can either create your own array, or alter the parameters for the normal one.

  • &$sktemplate: The SkinTemplate instance.
  • $title: Title instance for the page.
  • $message: Visible label of tab.
  • $selected: Whether this is a selected tab.
  • $checkEdit: Whether or not the action=edit query should be added if appropriate.
  • &$classes: Array of CSS classes to apply.
  • &$query: Query string to add to link.
  • &$text: Link text.
  • &$result: Complete assoc. array if you want to return true.