Manual:Hooks/PersonalUrls/ja
Appearance
If using MediaWiki >= 1.36, consider using Manual:Hooks/SkinTemplateNavigation::Universal instead, which will give you more flexibility about positioning of your menus while retaining backwards compatibility with older skins. |
この機能は、(バージョン 1.39.0 で廃止予定になったあと、) バージョン 1.41.0 で MediaWiki コアから除去されました。
この機能を使用するための代替方法については SkinTemplateNavigation::Universal を参照してください。 |
| PersonalUrls | |
|---|---|
| バージョン 1.7.0 (r14138, CodeReview archive) から利用可能 バージョン 1.41.0 (Gerrit change 959839) で除去 Called after the personal URLs have been set up, before they are shown. | |
| 関数の定義: | public static function onPersonalUrls( array &$personal_urls, Title $title, SkinTemplate $skin ) { ... }
|
| フックのアタッチ: | extension.json 内:
{
"Hooks": {
"PersonalUrls": "MediaWiki\\Extension\\MyExtension\\Hooks::onPersonalUrls"
}
}
|
| 呼び出し元: | ファイル: |
| インターフェイス: | PersonalUrlsHook.php |
フックの設定についての詳細情報は Manual:フック を参照してください。
このフックを使用する拡張機能の例については、Category:PersonalUrls extensions/ja を参照してください。
詳細
- $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 |