Popups
Displays page/reference previews when hovering over a link to an article/reference.
Loading...
Searching...
No Matches
Popups\PopupsHooks Class Reference
+ Inheritance diagram for Popups\PopupsHooks:

Public Member Functions

 __construct (Config $config, PopupsContext $popupsContext, LoggerInterface $logger, UserOptionsManager $userOptionsManager)
 
 onGetPreferences ( $user, &$prefs)
 Add options to user Preferences page.
 
 onBeforePageDisplay ( $out, $skin)
 Allows last minute changes to the output page, e.g.
 
 onResourceLoaderGetConfigVars (array &$vars, $skin, Config $config)
 Hook handler for the ResourceLoaderStartUpModule that makes static configuration visible to the frontend.
 
 onMakeGlobalVariablesScript (&$vars, $out)
 Hook handler publishing dynamic configuration that depends on the context, e.g.
 
 onUserGetDefaultOptions (&$defaultOptions)
 Called whenever a user wants to reset their preferences.
 
 onLocalUserCreated ( $user, $isAutoCreated)
 Called one time when initializing a users preferences for a newly created account.
 

Static Public Member Functions

static getCustomPopupTypes ()
 Get custom Popups types registered by extensions.
 

Constructor & Destructor Documentation

◆ __construct()

Popups\PopupsHooks::__construct ( Config $config,
PopupsContext $popupsContext,
LoggerInterface $logger,
UserOptionsManager $userOptionsManager )
Parameters
Config$config
PopupsContext$popupsContext
LoggerInterface$logger
UserOptionsManager$userOptionsManager

Member Function Documentation

◆ getCustomPopupTypes()

static Popups\PopupsHooks::getCustomPopupTypes ( )
static

Get custom Popups types registered by extensions.

Returns
array

◆ onBeforePageDisplay()

Popups\PopupsHooks::onBeforePageDisplay ( $out,
$skin )

Allows last minute changes to the output page, e.g.

adding of CSS or JavaScript by extensions.

Parameters
OutputPage$outThe Output page object
Skin$skinSkin object that will be used to generate the page

◆ onGetPreferences()

Popups\PopupsHooks::onGetPreferences ( $user,
& $prefs )

Add options to user Preferences page.

Parameters
User$userUser whose preferences are being modified
array[]&$prefsPreferences description array, to be fed to a HTMLForm object

◆ onLocalUserCreated()

Popups\PopupsHooks::onLocalUserCreated ( $user,
$isAutoCreated )

Called one time when initializing a users preferences for a newly created account.

Parameters
User$userNewly created user object
bool$isAutoCreated

◆ onMakeGlobalVariablesScript()

Popups\PopupsHooks::onMakeGlobalVariablesScript ( & $vars,
$out )

Hook handler publishing dynamic configuration that depends on the context, e.g.

the page or the users settings. These variables end in an inline <script> in the documents head.

Variables added:

  • ‘wgPopupsReferencePreviews’ - The server's notion of whether or not the reference previews should be enabled. Depending on the general setting done on the wiki.
  • ‘wgPopupsConflictsWithNavPopupGadget’ - The server's notion of whether or not the user has enabled conflicting Navigational Popups Gadget.
  • ‘wgPopupsConflictsWithRefTooltipsGadget’ - The server's notion of whether or not the user has enabled conflicting Reference Tooltips Gadget.
Parameters
array&$varsvariables to be added into the output of OutputPage::headElement
\IContextSource$outOutputPage instance calling the hook

◆ onResourceLoaderGetConfigVars()

Popups\PopupsHooks::onResourceLoaderGetConfigVars ( array & $vars,
$skin,
Config $config )

Hook handler for the ResourceLoaderStartUpModule that makes static configuration visible to the frontend.

These variables end in the only "startup" ResourceLoader module that is loaded before all others.

Dynamic configuration that depends on the context needs to be published via the MakeGlobalVariablesScript hook.

Parameters
array&$varsArray of variables to be added into the output of the startup module
string$skin
Config$config

◆ onUserGetDefaultOptions()

Popups\PopupsHooks::onUserGetDefaultOptions ( & $defaultOptions)

Called whenever a user wants to reset their preferences.

Parameters
array&$defaultOptions

The documentation for this class was generated from the following file: