Manual:Hooks/PersonalUrls/cs
![]() | Pokud používáte MediaWiki >= 1.36, zvažte místo toho použití Manual:Hooks/SkinTemplateNavigation::Universal , což vám poskytne větší flexibilitu při umísťování vašich nabídek při zachování zpětné kompatibility se staršími vzhledy. |
![]() | Tato funkcionalita byla z jádra MediaWiki odstraněna od verze 1.41.0 (poté, co byla v roce 2006 ukončena verze 1.39.0). Jaká existují jiná alternativní řešení této funkcionality, zjistíte na stránce SkinTemplateNavigation::Universal. |
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 |
---|---|
text | The link text |
href | The link URL |
active | Determines if this link is the active page |
class | Custom CSS class for the link (e.g. new if the page doesn't exist) |
icon | Icon 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 & anonuserpage | The user page | User:John Doe |
mytalk & anontalk | The user talk page | User talk:John Doe |
preferences | The preferences special page | Special:Preferences |
watchlist | The user watchlist | Special:Watchlist |
mycontris | The user contributions page | Special:Contributions/John Doe |
logout | The logout page | Special:UserLogout |
createaccount | The registration page | Special:Createaccount |
login & anonlogin | The login page | Special:UserLogin |