MediaWiki  1.33.0
GadgetHooks Class Reference

Static Public Member Functions

static beforePageDisplay ( $out)
 BeforePageDisplay hook handler. More...
 
static getPreferences ( $user, &$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 (&$where, IDatabase $db)
 Prevent gadget preferences from being deleted. More...
 
static onEditFilterMergedContent ( $context, $content, $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 (&$queryPages)
 Add the GadgetUsage special page to the list of QueryPages. More...
 
static registerModules (&$resourceLoader)
 ResourceLoaderRegisterModules hook handler. More...
 
static userGetDefaultOptions (&$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 (   $out)
static

BeforePageDisplay hook handler.

Parameters
OutputPage$out
Returns
bool

Definition at line 160 of file GadgetHooks.php.

References $e, $out, $skin, $user, as, 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, $skin, $user, as, captcha-old\count, RequestContext\getMain(), GadgetRepo\singleton(), and wfMessage().

Referenced by GadgetTest\testPreferences().

◆ makeLegacyWarning()

static GadgetHooks::makeLegacyWarning (   $id)
staticprivate

Definition at line 227 of file GadgetHooks.php.

References Xml\encodeJsCall(), and SpecialPage\getTitleFor().

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 316 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 291 of file GadgetHooks.php.

References $ext, and $title.

◆ 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

Definition at line 248 of file GadgetHooks.php.

References $content, $context, $title, and MediaWiki\getTitle().

◆ 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 277 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
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 330 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, as, 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 as, and GadgetRepo\singleton().


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