MediaWiki REL1_28
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.
 
 onView ()
 Shows page information on GET request.
 
 requiresUnblock ()
 Whether this action can still be executed by a blocked user.
 
 requiresWrite ()
 Whether this action requires the wiki not to be locked.
 
- Public Member Functions inherited from FormlessAction
 show ()
 The main action entry point.
 
- Public Member Functions inherited from Action
 __construct (Page $page, IContextSource $context=null)
 Constructor.
 
 addHelpLink ( $to, $overrideBaseUrl=false)
 Adds help link with an icon via page indicators.
 
 doesWrites ()
 Indicates whether this action may perform database writes.
 
 getContext ()
 Get the IContextSource in use here.
 
 getLanguage ()
 Shortcut to get the user Language being used for this instance.
 
 getOutput ()
 Get the OutputPage being used for this instance.
 
 getRequest ()
 Get the WebRequest being used for this instance.
 
 getRestriction ()
 Get the permission required to perform this action.
 
 getSkin ()
 Shortcut to get the Skin being used for this instance.
 
 getTitle ()
 Shortcut to get the Title object from the page.
 
 getUser ()
 Shortcut to get the User being used for this instance.
 
 msg ()
 Get a Message object with context set Parameters are the same as wfMessage()
 

Static Public Member Functions

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

Public Attributes

const VERSION = 1
 

Protected Member Functions

 addRow ( $table, $name, $value, $id)
 Adds a row to a table that will be added to the content.
 
 addTable ( $content, $table)
 Adds a table to the content that will be added to the output.
 
 getContributors ()
 Get a list of contributors of $article.
 
 getDescription ()
 Returns the description that goes below the "<h1>" tag.
 
 getPageTitle ()
 Returns the name that goes in the "<h1>" page title.
 
 makeHeader ( $header)
 Creates a header that can be added to the output.
 
 pageCounts (Page $page)
 Returns page counts that would be too "expensive" to retrieve by normal means.
 
 pageInfo ()
 Returns page information in an easily-manipulated format.
 
- Protected Member Functions inherited from Action
 checkCanExecute (User $user)
 Checks if the given user (identified by an object) can perform this action.
 
 setHeaders ()
 Set output headers for noindexing etc.
 
 useTransactionalTimeLimit ()
 Call wfTransactionalTimeLimit() if this request was POSTed.
 

Static Protected Member Functions

static getCacheKey (Title $title, $revId)
 

Additional Inherited Members

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

Detailed Description

Displays information about a page.

Definition at line 32 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 168 of file InfoAction.php.

References $name, and $value.

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 185 of file InfoAction.php.

References $content.

Referenced by onView().

◆ getCacheKey()

static InfoAction::getCacheKey ( Title  $title,
  $revId 
)
staticprotected
Parameters
Title$title
int$revId
Returns
string

Definition at line 909 of file InfoAction.php.

References $revId, $title, and wfMemcKey().

Referenced by invalidateCache().

◆ getContributors()

InfoAction::getContributors ( )
protected

Get a list of contributors of $article.

Returns
string Html

Definition at line 834 of file InfoAction.php.

References $contributors, $count, $lang, Action\$page, $s, $user, as, Action\getLanguage(), SpecialPage\getTitleFor(), 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 900 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 40 of file InfoAction.php.

Referenced by UploadBase\validateName().

◆ getPageTitle()

InfoAction::getPageTitle ( )
protected

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

Returns
string

Reimplemented from Action.

Definition at line 826 of file InfoAction.php.

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

◆ invalidateCache()

static InfoAction::invalidateCache ( Title  $title,
  $revid = null 
)
static

Clear the info cache for a given Title.

Since
1.22
Parameters
Title$titleTitle to clear cache for
int | null$revidRevision id to clear

Definition at line 69 of file InfoAction.php.

References $title, getCacheKey(), and Revision\newFromTitle().

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 153 of file InfoAction.php.

References $header.

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 85 of file InfoAction.php.

References $content, $header, $name, $value, addRow(), addTable(), as, Action\getContext(), makeHeader(), Action\msg(), page, and pageInfo().

◆ pageCounts()

InfoAction::pageCounts ( Page  $page)
protected

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

Parameters
WikiPage | Article | Page$page
Returns
array

Definition at line 690 of file InfoAction.php.

References $dbr, $fname, Action\$page, $title, DB_REPLICA, function, TS_UNIX, use, wfGetDB(), and wfTimestamp().

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 197 of file InfoAction.php.

References $batch, $lang, $linkRenderer, $magicWords, $options, $property, $title, $user, $value, $wgContLang, as, Revision\FOR_THIS_USER, Linker\formatHiddenCategories(), Action\getContext(), MagicWord\getDoubleUnderscoreArray(), PageProps\getInstance(), Action\getLanguage(), ContentHandler\getLocalizedName(), Action\getTitle(), SpecialPage\getTitleFor(), SpecialPage\getTitleValueFor(), Action\getUser(), global, Linker\link(), Linker\linkKnown(), Action\msg(), NS_CATEGORY, NS_FILE, NS_USER, page, pageCounts(), and Linker\revUserTools().

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 49 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 58 of file InfoAction.php.

Member Data Documentation

◆ VERSION

const InfoAction::VERSION = 1

Definition at line 33 of file InfoAction.php.


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