MediaWiki  1.23.8
InfoAction Class Reference

Displays information about a page. More...

Inheritance diagram for InfoAction:
Collaboration diagram for InfoAction:

Public Member Functions

 getName ()
 Returns the name of the action this object responds to. More...
 
 onView ()
 Shows page information on GET request. More...
 
 requiresUnblock ()
 Whether this action can still be executed by a blocked user. More...
 
 requiresWrite ()
 Whether this action requires the wiki not to be locked. More...
 
- Public Member Functions inherited from FormlessAction
 execute (array $data=null, $captureErrors=true)
 Execute the action silently, not giving any output. More...
 
 onSubmit ( $data)
 
 onSuccess ()
 
 show ()
 The main action entry point. More...
 
- Public Member Functions inherited from Action
 __construct (Page $page, IContextSource $context=null)
 Constructor. More...
 
 execute ()
 Execute the action in a silent fashion: do not display anything or release any errors. More...
 
 getContext ()
 Get the IContextSource in use here. More...
 
 getLang ()
 Shortcut to get the user Language being used for this instance. More...
 
 getLanguage ()
 Shortcut to get the user Language being used for this instance. More...
 
 getOutput ()
 Get the OutputPage being used for this instance. More...
 
 getRequest ()
 Get the WebRequest being used for this instance. More...
 
 getRestriction ()
 Get the permission required to perform this action. More...
 
 getSkin ()
 Shortcut to get the Skin being used for this instance. More...
 
 getTitle ()
 Shortcut to get the Title object from the page. More...
 
 getUser ()
 Shortcut to get the User being used for this instance. More...
 
 msg ()
 Get a Message object with context set Parameters are the same as wfMessage() More...
 

Static Public Member Functions

static invalidateCache (Title $title)
 Clear the info cache for a given Title. More...
 
- Static Public Member Functions inherited from Action
static exists ( $name)
 Check if a given action is recognised, even if it's disabled. More...
 
static factory ( $action, Page $page, IContextSource $context=null)
 Get an appropriate Action subclass for the given action. More...
 
static getActionName (IContextSource $context)
 Get the action that will be executed, not necessarily the one passed passed through the "action" request parameter. More...
 

Public Attributes

const CACHE_VERSION = '2013-03-17'
 

Protected Member Functions

 addRow ( $table, $name, $value, $id)
 Adds a row to a table that will be added to the content. More...
 
 addTable ( $content, $table)
 Adds a table to the content that will be added to the output. More...
 
 getContributors ()
 Get a list of contributors of $article. More...
 
 getDescription ()
 Returns the description that goes below the "<h1>" tag. More...
 
 getPageTitle ()
 Returns the name that goes in the "<h1>" page title. More...
 
 makeHeader ( $header)
 Creates a header that can be added to the output. More...
 
 pageInfo ()
 Returns page information in an easily-manipulated format. More...
 
- Protected Member Functions inherited from FormlessAction
 getFormFields ()
 We don't want an HTMLForm. More...
 
- Protected Member Functions inherited from Action
 checkCanExecute (User $user)
 Checks if the given user (identified by an object) can perform this action. More...
 
 setHeaders ()
 Set output headers for noindexing etc. More...
 

Static Protected Member Functions

static pageCounts (Title $title)
 Returns page counts that would be too "expensive" to retrieve by normal means. More...
 

Additional Inherited Members

- Protected Attributes inherited from Action
IContextSource $context
 IContextSource if specified; otherwise we'll use the Context from the Page $context. More...
 
array $fields
 The fields used to create the HTMLForm $fields. More...
 
WikiPage Article ImagePage CategoryPage Page $page
 Page on which we're performing the action $page. More...
 

Detailed Description

Displays information about a page.

Definition at line 30 of file InfoAction.php.

Member Function Documentation

◆ addRow()

InfoAction::addRow (   $table,
  $name,
  $value,
  $id 
)
protected

Adds a row to a table that will be added to the content.

Parameters
string$tableThe table that will be added to the content
string$nameThe name of the row
string$valueThe value of the row
string$idThe ID to use for the 'tr' element
Returns
string The table with the row added

Definition at line 169 of file InfoAction.php.

References $name, $value, array(), and Html\rawElement().

Referenced by onView().

◆ addTable()

InfoAction::addTable (   $content,
  $table 
)
protected

Adds a table to the content that will be added to the output.

Parameters
string$contentThe content that will be added to the output
string$tableThe table
Returns
string The content with the table added

Definition at line 183 of file InfoAction.php.

References array(), and Html\rawElement().

Referenced by onView().

◆ getContributors()

InfoAction::getContributors ( )
protected

Get a list of contributors of $article.

Returns
string Html

Definition at line 769 of file InfoAction.php.

References $count, Action\$page, $s, $user, array(), as, Action\getLanguage(), SpecialPage\getTitleFor(), global, Linker\link(), Action\msg(), and page.

◆ getDescription()

InfoAction::getDescription ( )
protected

Returns the description that goes below the "<h1>" tag.

Returns
string

Reimplemented from Action.

Definition at line 834 of file InfoAction.php.

◆ getName()

InfoAction::getName ( )

Returns the name of the action this object responds to.

Returns
string Lowercase name

Reimplemented from Action.

Definition at line 38 of file InfoAction.php.

◆ getPageTitle()

InfoAction::getPageTitle ( )
protected

Returns the name that goes in the "<h1>" page title.

Returns
string

Reimplemented from Action.

Definition at line 761 of file InfoAction.php.

References Action\getTitle(), and Action\msg().

◆ invalidateCache()

static InfoAction::invalidateCache ( Title  $title)
static

Clear the info cache for a given Title.

Since
1.22
Parameters
Title$titleTitle to clear cache for

Definition at line 66 of file InfoAction.php.

References $title, $wgMemc, WikiPage\factory(), global, and wfMemcKey().

Referenced by WikiPage\doUpdateRestrictions(), WikiPage\onArticleDelete(), WikiPage\onArticleEdit(), and RefreshLinksJob\runForTitle().

◆ makeHeader()

InfoAction::makeHeader (   $header)
protected

Creates a header that can be added to the output.

Parameters
string$headerThe header text.
Returns
string The HTML.

Definition at line 154 of file InfoAction.php.

References array(), Html\element(), Sanitizer\escapeId(), and Html\rawElement().

Referenced by onView().

◆ onView()

InfoAction::onView ( )

Shows page information on GET request.

Returns
string Page information that will be added to the output

Reimplemented from FormlessAction.

Definition at line 81 of file InfoAction.php.

References $name, $value, addRow(), addTable(), array(), as, Html\element(), Action\getContext(), makeHeader(), Action\msg(), page, pageInfo(), and wfRunHooks().

◆ pageCounts()

static InfoAction::pageCounts ( Title  $title)
staticprotected

Returns page counts that would be too "expensive" to retrieve by normal means.

Parameters
Title$titleTitle to get counts for
Returns
array

Definition at line 625 of file InfoAction.php.

References $dbr, $title, array(), DB_SLAVE, global, MWNamespace\hasSubpages(), wfGetDB(), wfProfileIn(), and wfProfileOut().

Referenced by pageInfo().

◆ pageInfo()

InfoAction::pageInfo ( )
protected

Returns page information in an easily-manipulated format.

Array keys are used so extensions may add additional information in arbitrary positions. Array values are arrays with one element to be rendered as a header, arrays with two elements to be rendered as a table row.

Returns
array

Definition at line 195 of file InfoAction.php.

References $batch, $dbr, $magicWords, $options, $property, $title, $user, $value, $version, $wgContLang, $wgMemc, array(), as, CACHE_VERSION, DB_SLAVE, Html\element(), Language\fetchLanguageName(), Revision\FOR_THIS_USER, Linker\formatHiddenCategories(), Linker\formatTemplates(), MagicWord\getDoubleUnderscoreArray(), Action\getLanguage(), ContentHandler\getLocalizedName(), Action\getTitle(), SpecialPage\getTitleFor(), Action\getUser(), global, MWNamespace\hasSubpages(), Linker\link(), Linker\linkKnown(), Action\msg(), Category\newFromTitle(), NS_CATEGORY, NS_USER, NS_USER_TALK, page, pageCounts(), Html\rawElement(), Linker\revUserTools(), wfGetDB(), and wfMemcKey().

Referenced by onView().

◆ requiresUnblock()

InfoAction::requiresUnblock ( )

Whether this action can still be executed by a blocked user.

Returns
bool

Reimplemented from Action.

Definition at line 47 of file InfoAction.php.

◆ requiresWrite()

InfoAction::requiresWrite ( )

Whether this action requires the wiki not to be locked.

Returns
bool

Reimplemented from Action.

Definition at line 56 of file InfoAction.php.

Member Data Documentation

◆ CACHE_VERSION

const InfoAction::CACHE_VERSION = '2013-03-17'

Definition at line 31 of file InfoAction.php.

Referenced by pageInfo().


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