Movatterモバイル変換


[0]ホーム

URL:


Jump to content
MediaWiki
Search

Manual:Hooks/PreferencesGetLayout

From mediawiki.org
<Manual:Hooks
PreferencesGetLayout
Available fromversion 1.40.0
Use the hook to check if the preferences will have a mobile or desktop layout.
Define function:
publicstaticfunctiononPreferencesGetLayout(bool&$useMobileLayout,string$skinName,array$skinProperties){...}
Attach hook:Inextension.json:
{"Hooks":{"PreferencesGetLayout":"MediaWiki\\Extension\\MyExtension\\Hooks::onPreferencesGetLayout"}}
Called from:File(s):specials/forms/PreferencesFormOOUI.php
Interface:PreferencesGetLayoutHook.php

For more information about attaching hooks, seeManual:Hooks.
For examples of extensions using this hook, seeCategory:PreferencesGetLayout extensions.


Details

[edit]
  • bool &$useMobileLayout: A boolean which will indicate whether to use a mobile layout or not
  • string $skinName: The name of the skin being used.
  • array $skinProperties: An associative array that includes skin properties. Is an empty array by default. A skin property could be one of the following:
    • `isResponsive`: Whether a skin can be responsive.
    • `getVersion`: Get the version of the skin.

Notes

[edit]

This hook allows extensions or skins to determine whetherSpecial:Preferences should display a mobile layout or not.

The default is that the desktop layout will be shown.

See also

[edit]
Retrieved from "https://www.mediawiki.org/w/index.php?title=Manual:Hooks/PreferencesGetLayout&oldid=5606101"
Categories:

[8]ページ先頭

©2009-2025 Movatter.jp