MediaWiki REL1_30
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 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 ( $article, $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 25 of file GadgetHooks.php.

Member Function Documentation

◆ beforePageDisplay()

static GadgetHooks::beforePageDisplay ( $out)
static

BeforePageDisplay hook handler.

Parameters
OutputPage$out
Returns
bool

Definition at line 165 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 77 of file GadgetHooks.php.

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

Referenced by GadgetsTest\testPreferences().

◆ makeLegacyWarning()

static GadgetHooks::makeLegacyWarning ( $id)
staticprivate

Definition at line 228 of file GadgetHooks.php.

References SpecialPage\getTitleFor(), and 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 320 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 295 of file GadgetHooks.php.

References $ext.

◆ 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

Definition at line 249 of file GadgetHooks.php.

References $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 WikiPage\getTitle(), and GadgetRepo\singleton().

◆ onPageContentSaveComplete()

static GadgetHooks::onPageContentSaveComplete ( $article,
$user,
$content )
static

PageContentSaveComplete hook handler.

Parameters
Article$article
User$user
Content$contentNew page content
Returns
bool

Definition at line 34 of file GadgetHooks.php.

References 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 334 of file GadgetHooks.php.

◆ registerModules()

static GadgetHooks::registerModules ( & $resourceLoader)
static

ResourceLoaderRegisterModules hook handler.

Parameters
ResourceLoader&$resourceLoader
Returns
bool

Definition at line 146 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 51 of file GadgetHooks.php.

References GadgetRepo\singleton().


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