Popups
Displays page/reference previews when hovering over a link to an article/reference.
Loading...
Searching...
No Matches
Popups\PopupsContext Class Reference

Public Member Functions

 __construct (Config $config, ExtensionRegistry $extensionRegistry, PopupsGadgetsIntegration $gadgetsIntegration, SpecialPageFactory $specialPageFactory, UserOptionsLookup $userOptionsLookup)
 
 conflictsWithNavPopupsGadget (User $user)
 
 showPreviewsOptInOnPreferencesPage ()
 Are Page previews visible on User Preferences Page.
 
 getConfigBitmaskFromUser (User $user)
 
 areDependenciesMet ()
 
 isTitleExcluded ( $title)
 Whether popups code should be shipped to $title.
 

Public Attributes

const EXTENSION_NAME = 'popups'
 
const LOGGER_CHANNEL = 'popups'
 Logger channel name.
 
const PREVIEWS_ENABLED = true
 User preference value for enabled Page Previews.
 
const PREVIEWS_DISABLED = false
 User preference value for disabled Page Previews.
 

Static Protected Attributes

static $instance
 

Constructor & Destructor Documentation

◆ __construct()

Popups\PopupsContext::__construct ( Config $config,
ExtensionRegistry $extensionRegistry,
PopupsGadgetsIntegration $gadgetsIntegration,
SpecialPageFactory $specialPageFactory,
UserOptionsLookup $userOptionsLookup )
Parameters
Config$configMediawiki configuration
ExtensionRegistry$extensionRegistryMediaWiki extension registry
PopupsGadgetsIntegration$gadgetsIntegrationGadgets integration helper
SpecialPageFactory$specialPageFactory
UserOptionsLookup$userOptionsLookup

Member Function Documentation

◆ areDependenciesMet()

Popups\PopupsContext::areDependenciesMet ( )
Returns
bool

◆ conflictsWithNavPopupsGadget()

Popups\PopupsContext::conflictsWithNavPopupsGadget ( User $user)
Parameters
User$userUser whose gadgets settings are being checked
Returns
bool

◆ getConfigBitmaskFromUser()

Popups\PopupsContext::getConfigBitmaskFromUser ( User $user)
Parameters
User$userUser whose preferences are checked
Returns
int

◆ isTitleExcluded()

Popups\PopupsContext::isTitleExcluded ( $title)

Whether popups code should be shipped to $title.

For example, if 'Special:UserLogin' is excluded, and the user is on 'Special:UserLogin', then the title is considered excluded.

A title is also considered excluded if its root matches one of the page names from the config variable. For example, if 'User:A' is excluded, and the title is 'User:A/b', then this title is considered excluded.

Language specific excluded titles affect all languages. For example, if "Main_Page" is excluded, "Bosh_Sahifa" (which is "Main_Page" in Uzbek) is considered excluded too.

Parameters
Title$titletitle being tested
Returns
bool

◆ showPreviewsOptInOnPreferencesPage()

Popups\PopupsContext::showPreviewsOptInOnPreferencesPage ( )

Are Page previews visible on User Preferences Page.

Returns
bool

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