MediaWiki  1.29.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)
 
static makeTypelessWarning ( $id)
 

Detailed Description

Definition at line 25 of file GadgetHooks.php.

Member Function Documentation

◆ beforePageDisplay()

static GadgetHooks::beforePageDisplay (   $out)
static

BeforePageDisplay hook handler.

Parameters
$outOutputPage
Returns
bool

Definition at line 163 of file GadgetHooks.php.

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

◆ getPreferences()

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

GetPreferences hook handler.

Parameters
$userUser
$preferencesArray: Preference descriptions
Returns
bool

Definition at line 77 of file GadgetHooks.php.

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

Referenced by GadgetsTest\testPreferences().

◆ makeLegacyWarning()

static GadgetHooks::makeLegacyWarning (   $id)
staticprivate

Definition at line 235 of file GadgetHooks.php.

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

Referenced by beforePageDisplay().

◆ makeTypelessWarning()

static GadgetHooks::makeTypelessWarning (   $id)
staticprivate

Definition at line 246 of file GadgetHooks.php.

References Xml\encodeJsCall().

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 332 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 307 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 263 of file GadgetHooks.php.

References $content, $context, $status, $title, and ContextSource\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 290 of file GadgetHooks.php.

References $page, and GadgetRepo\singleton().

◆ onPageContentSaveComplete()

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

PageContentSaveComplete hook handler.

Parameters
$articleArticle
$userUser
$contentContent New 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 346 of file GadgetHooks.php.

◆ registerModules()

static GadgetHooks::registerModules ( $resourceLoader)
static

ResourceLoaderRegisterModules hook handler.

Parameters
$resourceLoaderResourceLoader
Returns
bool

Definition at line 144 of file GadgetHooks.php.

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

◆ userGetDefaultOptions()

static GadgetHooks::userGetDefaultOptions ( $defaultOptions)
static

UserGetDefaultOptions hook handler.

Parameters
$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: