MediaWiki REL1_32
GadgetHooks Class Reference

Static Public Member Functions

static beforePageDisplay ( $out)
 BeforePageDisplay hook handler.
 
static getPreferences ( $user, &$preferences)
 GetPreferences hook handler.
 
static onCodeEditorGetPageLanguage (Title $title, &$lang)
 Set the CodeEditor language for Gadget definition pages.
 
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.
 
static onDeleteUnknownPreferences (&$where, IDatabase $db)
 Prevent gadget preferences from being deleted.
 
static onEditFilterMergedContent ( $context, $content, $status, $summary)
 Valid gadget definition page after content is modified.
 
static onPageContentInsertComplete (WikiPage $page)
 After a new page is created in the Gadget definition namespace, invalidate the list of gadget ids.
 
static onPageContentSaveComplete (WikiPage $wikiPage, $user, $content)
 PageContentSaveComplete hook handler.
 
static onwgQueryPages (&$queryPages)
 Add the GadgetUsage special page to the list of QueryPages.
 
static registerModules (&$resourceLoader)
 ResourceLoaderRegisterModules hook handler.
 
static userGetDefaultOptions (&$defaultOptions)
 UserGetDefaultOptions hook handler.
 

Static Private Member Functions

static makeLegacyWarning ( $id)
 

Detailed Description

Definition at line 26 of file GadgetHooks.php.

Member Function Documentation

◆ beforePageDisplay()

static GadgetHooks::beforePageDisplay ( $out)
static

BeforePageDisplay hook handler.

Parameters
OutputPage$out
Returns
bool

Definition at line 160 of file GadgetHooks.php.

References $e, $out, Gadget\getModuleName(), makeLegacyWarning(), and GadgetRepo\singleton().

◆ getPreferences()

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

GetPreferences hook handler.

Parameters
User$user
array&$preferencesPreference descriptions
Returns
bool

Definition at line 72 of file GadgetHooks.php.

References $options, $section, GadgetRepo\singleton(), and wfMessage().

Referenced by GadgetTest\testPreferences().

◆ makeLegacyWarning()

static GadgetHooks::makeLegacyWarning ( $id)
staticprivate

Definition at line 227 of file GadgetHooks.php.

References ResourceLoader\makeInlineScript().

Referenced by beforePageDisplay().

◆ 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 317 of file GadgetHooks.php.

References $lang.

◆ 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 292 of file GadgetHooks.php.

References $ext.

◆ onDeleteUnknownPreferences()

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

◆ onEditFilterMergedContent()

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

Valid gadget definition page after content is modified.

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

Definition at line 249 of file GadgetHooks.php.

References $content, and $context.

◆ 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 278 of file GadgetHooks.php.

References GadgetRepo\singleton().

◆ onPageContentSaveComplete()

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

PageContentSaveComplete hook handler.

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

Definition at line 35 of file GadgetHooks.php.

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

◆ onwgQueryPages()

static GadgetHooks::onwgQueryPages ( & $queryPages)
static

Add the GadgetUsage special page to the list of QueryPages.

Parameters
array&$queryPages
Returns
bool

Definition at line 331 of file GadgetHooks.php.

◆ registerModules()

static GadgetHooks::registerModules ( & $resourceLoader)
static

ResourceLoaderRegisterModules hook handler.

Parameters
ResourceLoader&$resourceLoader
Returns
bool

Definition at line 141 of file GadgetHooks.php.

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

◆ userGetDefaultOptions()

static GadgetHooks::userGetDefaultOptions ( & $defaultOptions)
static

UserGetDefaultOptions hook handler.

Parameters
array&$defaultOptionsArray of default preference keys and values
Returns
bool

Definition at line 46 of file GadgetHooks.php.

References GadgetRepo\singleton().


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