Manual:Hooks/PersonalUrls/cs

Category:MediaWiki hooks/cs#PersonalUrls Category:Hooks added in MediaWiki 1.7.0/cs#PersonalUrls Category:MediaWiki deprecated or obsolete features/cs#PersonalUrls Category:Hooks removed in MediaWiki 1.41.0/cs#PersonalUrls Category:Hooks deprecated in MediaWiki 1.39.0/cs#PersonalUrls
PersonalUrls
Dostupné od verze 1.7.0 (r14138, CodeReview archive)
Odstraněno od verze 1.41.0 (Gerrit change 959839)Category:Removed hooks/cs#PersonalUrls
Called after the personal URLs have been set up, before they are shown.
Definice funkce:
public static function onPersonalUrls( array &$personal_urls, Title $title, SkinTemplate $skin ) { ... }
Registrace háčku: V extension.json:
{
	"Hooks": {
		"PersonalUrls": "MediaWiki\\Extension\\MyExtension\\Hooks::onPersonalUrls"
	}
}
Volá se z: Soubor/y: skins/SkinTemplate.phpCategory:MediaWiki hooks included in SkinTemplate.php#cs
Rozhraní: PersonalUrlsHook.php

Další informace o háčcích najdete na stránce Příručka:Háčky .
Chcete-li vědět, jaká rozšíření tento háček používají, podívejte se na stránku Category:PersonalUrls extensions/cs.

Details

  • $personal_urls: the array of URLs set up so far
  • $title: the Title object of the current article
  • $skin: SkinTemplate object providing context (e.g. to check if the user is logged in, etc.) - since 1.23 (gerrit:95776)

personal_urls items format

Each line of the array is composed from an array, containing 4 items:
Key Description
textThe link text
hrefThe link URL
activeDetermines if this link is the active page
classCustom CSS class for the link (e.g. new if the page doesn't exist)
iconIcon identifier, for use in skins which support it, e.g. Vector (2022)

Only text and href are mandatory.

List of PersonalUrls

In a vanilla MediaWiki install, the $personal_urls contains the following entries:

Key Description Target page sample
userpage & anonuserpageThe user pageUser:John Doe
mytalk & anontalkThe user talk pageUser talk:John Doe
preferencesThe preferences special pageSpecial:Preferences
watchlistThe user watchlistSpecial:Watchlist
mycontrisThe user contributions pageSpecial:Contributions/John Doe
logoutThe logout pageSpecial:UserLogout
createaccountThe registration pageSpecial:Createaccount
login & anonloginThe login pageSpecial:UserLogin
Category:Hooks added in MediaWiki 1.7.0/cs Category:Hooks deprecated in MediaWiki 1.39.0/cs Category:Hooks removed in MediaWiki 1.41.0/cs Category:MediaWiki deprecated or obsolete features/cs Category:MediaWiki hooks/cs Category:MediaWiki hooks included in SkinTemplate.php Category:Removed hooks/cs