MediaWiki  1.34.4
GadgetHooks Class Reference

Static Public Member Functions

static beforePageDisplay (OutputPage $out)
 BeforePageDisplay hook handler. More...
 
static getPreferences (User $user, array &$preferences)
 GetPreferences hook handler. More...
 
static onCodeEditorGetPageLanguage (Title $title, &$lang)
 Set the CodeEditor language for Gadget definition pages. More...
 
static onContentHandlerDefaultModelFor (Title $title, &$model)
 Mark the Title as having a content model of javascript or css for pages in the Gadget namespace based on their file extension. More...
 
static onDeleteUnknownPreferences (array &$where, IDatabase $db)
 Prevent gadget preferences from being deleted. More...
 
static onEditFilterMergedContent (IContextSource $context, Content $content, Status $status, $summary)
 Valid gadget definition page after content is modified. More...
 
static onPageContentInsertComplete (WikiPage $page)
 After a new page is created in the Gadget definition namespace, invalidate the list of gadget ids. More...
 
static onPageContentSaveComplete (WikiPage $wikiPage, $user, $content)
 PageContentSaveComplete hook handler. More...
 
static onwgQueryPages (array &$queryPages)
 Add the GadgetUsage special page to the list of QueryPages. More...
 
static registerModules (ResourceLoader &$resourceLoader)
 ResourceLoaderRegisterModules hook handler. More...
 
static userGetDefaultOptions (array &$defaultOptions)
 UserGetDefaultOptions hook handler. More...
 

Static Private Member Functions

static makeLegacyWarning ( $id)
 

Detailed Description

Definition at line 26 of file GadgetHooks.php.

Member Function Documentation

◆ beforePageDisplay()

static GadgetHooks::beforePageDisplay ( OutputPage  $out)
static

◆ getPreferences()

static GadgetHooks::getPreferences ( User  $user,
array &  $preferences 
)
static

GetPreferences hook handler.

Parameters
User$user
array&$preferencesPreference descriptions

Definition at line 66 of file GadgetHooks.php.

References RequestContext\getMain(), GadgetRepo\singleton(), and wfMessage().

Referenced by GadgetHooksTest\testPreferences().

◆ makeLegacyWarning()

static GadgetHooks::makeLegacyWarning (   $id)
staticprivate

◆ onCodeEditorGetPageLanguage()

static GadgetHooks::onCodeEditorGetPageLanguage ( Title  $title,
$lang 
)
static

Set the CodeEditor language for Gadget definition pages.

It already knows the language for Gadget: namespace pages.

Parameters
Title$title
string&$lang
Returns
bool

Definition at line 306 of file GadgetHooks.php.

References $lang, and $title.

◆ onContentHandlerDefaultModelFor()

static GadgetHooks::onContentHandlerDefaultModelFor ( Title  $title,
$model 
)
static

Mark the Title as having a content model of javascript or css for pages in the Gadget namespace based on their file extension.

Parameters
Title$title
string&$model
Returns
bool

Definition at line 281 of file GadgetHooks.php.

References $ext, and $title.

◆ onDeleteUnknownPreferences()

static GadgetHooks::onDeleteUnknownPreferences ( array &  $where,
IDatabase  $db 
)
static

◆ onEditFilterMergedContent()

static GadgetHooks::onEditFilterMergedContent ( IContextSource  $context,
Content  $content,
Status  $status,
  $summary 
)
static

Valid gadget definition page after content is modified.

Parameters
IContextSource$context
Content$content
Status$status
string$summary
Exceptions
Exception
Returns
bool

Definition at line 234 of file GadgetHooks.php.

References $content, $context, $title, and StatusValue\merge().

◆ onPageContentInsertComplete()

static GadgetHooks::onPageContentInsertComplete ( WikiPage  $page)
static

After a new page is created in the Gadget definition namespace, invalidate the list of gadget ids.

Parameters
WikiPage$page

Definition at line 267 of file GadgetHooks.php.

References WikiPage\getTitle(), and GadgetRepo\singleton().

◆ onPageContentSaveComplete()

static GadgetHooks::onPageContentSaveComplete ( WikiPage  $wikiPage,
  $user,
  $content 
)
static

PageContentSaveComplete hook handler.

Parameters
WikiPage$wikiPage
User$user
Content$contentNew page content

Definition at line 34 of file GadgetHooks.php.

References WikiPage\getTitle(), and GadgetRepo\singleton().

◆ onwgQueryPages()

static GadgetHooks::onwgQueryPages ( array &  $queryPages)
static

Add the GadgetUsage special page to the list of QueryPages.

Parameters
array&$queryPages

Definition at line 319 of file GadgetHooks.php.

◆ registerModules()

static GadgetHooks::registerModules ( ResourceLoader $resourceLoader)
static

ResourceLoaderRegisterModules hook handler.

Parameters
ResourceLoader&$resourceLoader

Definition at line 132 of file GadgetHooks.php.

References $resourceLoader, Gadget\getModuleName(), and GadgetRepo\singleton().

◆ userGetDefaultOptions()

static GadgetHooks::userGetDefaultOptions ( array &  $defaultOptions)
static

UserGetDefaultOptions hook handler.

Parameters
array&$defaultOptionsArray of default preference keys and values

Definition at line 43 of file GadgetHooks.php.

References GadgetRepo\singleton().


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