Semantic MediaWiki and related extensions
Static Public Member Functions | List of all members
PFHooks Class Reference

Static Public Member Functions

static registerExtension ()
 
static initialize ()
 
static registerModules (ResourceLoader &$resourceLoader)
 
static registerNamespaces (array &$list)
 
static registerFunctions (&$parser)
 
static setGlobalJSVariables (&$vars)
 
static registerProperty ( $id, $typeid, $label)
 
static addToAdminLinks (&$admin_links_tree)
 
static addToCargoTablesLinks (&$actionLinks, $tableName, $isReplacementTable, $hasReplacementTable, $templatesThatDeclareTables, $templatesThatAttachToTables)
 
static disableTinyMCE ( $title)
 
static showFormPreview (EditPage $editpage, WebRequest $request)
 
static setPostEditCookie (&$wikiPage, &$user, $content, $summary, $isMinor, $isWatch, $section, &$flags, $revision, &$status, $baseRevId, $undidRevId=0)
 

Member Function Documentation

◆ addToCargoTablesLinks()

static PFHooks::addToCargoTablesLinks ( $actionLinks,
  $tableName,
  $isReplacementTable,
  $hasReplacementTable,
  $templatesThatDeclareTables,
  $templatesThatAttachToTables 
)
static

Called by the CargoTablesActionLinks hook.

Adds an "Edit" link to Special:CargoTables, pointing to Special:MultiPageEdit.

Parameters
array&$actionLinksAction links
string$tableNameCargo table name
bool$isReplacementTableWhether this table iss a replacement table
bool$hasReplacementTableWhether this table has a replacement table
string[]$templatesThatDeclareTables An array
string[]$templatesThatAttachToTables An array
Returns
bool
Since
4.4

◆ disableTinyMCE()

static PFHooks::disableTinyMCE (   $title)
static

Disable TinyMCE if this is a form definition page, or a form-editable page.

Parameters
Title$titleThe page Title object
Returns
Whether or not to disable TinyMCE

◆ registerExtension()

static PFHooks::registerExtension ( )
static

This is a delayed init that makes sure that MediaWiki is set up properly before we add our stuff.

◆ registerModules()

static PFHooks::registerModules ( ResourceLoader &  $resourceLoader)
static

ResourceLoaderRegisterModules hook handler

See also
https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderRegisterModules
Parameters
ResourceLoader&$resourceLoaderThe ResourceLoader object
Returns
bool Always true

◆ registerNamespaces()

static PFHooks::registerNamespaces ( array &  $list)
static

Register the namespaces for Page Forms.

See also
https://www.mediawiki.org/wiki/Manual:Hooks/CanonicalNamespaces
Since
2.4.1
Parameters
array&$list
Returns
true

◆ setPostEditCookie()

static PFHooks::setPostEditCookie ( $wikiPage,
$user,
  $content,
  $summary,
  $isMinor,
  $isWatch,
  $section,
$flags,
  $revision,
$status,
  $baseRevId,
  $undidRevId = 0 
)
static

Called by the PageContentSaveComplete hook.

Set a cookie after the page save so that a "Your edit was saved" popup will appear after form-based saves, just as it does after standard saves. This code will be called after all saves, which means that it will lead to redundant cookie-setting after normal saves. However, there doesn't appear to be a way to to set the cookie correctly only after form-based saves, unfortunately.

Parameters
WikiPage&$wikiPageThe page modified
User&$userUser performing the modification
Content$contentNew content
string$summaryEdit summary/comment
bool$isMinorWhether or not the edit was marked as minor
bool$isWatchNo longer used
bool$sectionNo longer used
int[]&$flags Flags passed to WikiPage::doEditContent()
Revision$revisionRevision object of the saved content (or null)
Status&$statusStatus object about to be returned by doEditContent()
int$baseRevIdThe rev ID (or false) this edit was based on
int$undidRevIdThe rev ID this edit undid (default 0)
Returns
bool

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

About | General disclaimer | Privacy policy