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

References $options, $section, $user, as, captcha-old\count, GadgetRepo\singleton(), Xml\tags(), and wfMessage().

Referenced by GadgetsTest\testPreferences().

◆ makeLegacyWarning()

static GadgetHooks::makeLegacyWarning (   $id)
staticprivate

Definition at line 228 of file GadgetHooks.php.

References $special, 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 320 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 295 of file GadgetHooks.php.

References $ext, and $title.

◆ 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, $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 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 $article, $title, NS_MEDIAWIKI, 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 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, 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 51 of file GadgetHooks.php.

References as, and GadgetRepo\singleton().


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