MediaWiki  REL1_19
HistoryAction Class Reference

This class handles printing the history page for an article. More...

Inheritance diagram for HistoryAction:
Collaboration diagram for HistoryAction:

List of all members.

Public Member Functions

 feed ($type)
 Output a subscription feed listing recent edits to this page.
 feedEmpty ()
 feedItem ($row)
 Generate a FeedItem object from a given revision table row Borrows Recent Changes' feed generation functions for formatting; includes a diff to the previous revision (if any).
 fetchRevisions ($limit, $offset, $direction)
 Fetch an array of revisions, specified by a given limit, offset and direction.
 getArticle ()
 Get the Article object we are working on.
 getName ()
 Return the name of the action this object responds to.
 onView ()
 Print the history page for an article.
 requiresUnblock ()
 Whether this action can still be executed by a blocked user.
 requiresWrite ()
 Whether this action requires the wiki not to be locked.

Public Attributes

const DIR_NEXT = 1
const DIR_PREV = 0

Protected Member Functions

 getDescription ()
 Returns the description that goes below the <h1> tag.
 getPageTitle ()
 Returns the name that goes in the <h1> page title.

Private Member Functions

 preCacheMessages ()
 As we use the same small set of messages in various methods and that they are called often, we call them once and save them in $this->message.

Detailed Description

This class handles printing the history page for an article.

In order to be efficient, it uses timestamps rather than offsets for paging, to avoid costly LIMIT,offset queries.

Construct it by passing in an Article, and call $h->history() to print the history.

Definition at line 18 of file HistoryAction.php.


Member Function Documentation

HistoryAction::feed ( type)

Output a subscription feed listing recent edits to this page.

Parameters:
$typeString: feed type

Definition at line 225 of file HistoryAction.php.

References $limit, $wgFeedClasses, $wgFeedLimit, FeedUtils\checkFeedOutput(), DIR_NEXT, feedEmpty(), feedItem(), fetchRevisions(), Action\getRequest(), Action\getTitle(), and wfMsgForContent().

Referenced by onView().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 259 of file HistoryAction.php.

References Action\getOutput(), Action\getTitle(), wfMsgForContent(), and wfTimestamp().

Referenced by feed().

Here is the call graph for this function:

Here is the caller graph for this function:

Generate a FeedItem object from a given revision table row Borrows Recent Changes' feed generation functions for formatting; includes a diff to the previous revision (if any).

Parameters:
$rowObject: database row
Returns:
FeedItem

Definition at line 278 of file HistoryAction.php.

References $title, $wgContLang, FeedUtils\formatDiffRow(), Action\getTitle(), FeedItem\stripComment(), and wfMsgForContent().

Referenced by feed().

Here is the call graph for this function:

Here is the caller graph for this function:

HistoryAction::fetchRevisions ( limit,
offset,
direction 
)

Fetch an array of revisions, specified by a given limit, offset and direction.

This is now only used by the feeds. It was previously used by the main UI but that's now handled by the pager.

Parameters:
$limitInteger: the limit number of revisions to get
$offsetInteger
$directionInteger: either HistoryPage::DIR_PREV or HistoryPage::DIR_NEXT
Returns:
ResultWrapper

Definition at line 194 of file HistoryAction.php.

References $dbr, $limit, DIR_PREV, Revision\selectFields(), and wfGetDB().

Referenced by feed().

Here is the call graph for this function:

Here is the caller graph for this function:

Get the Article object we are working on.

Returns:
Page

Definition at line 52 of file HistoryAction.php.

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

Returns:
String

Reimplemented from Action.

Definition at line 38 of file HistoryAction.php.

References Action\getTitle(), SpecialPage\getTitleFor(), Linker\linkKnown(), and Action\msg().

Here is the call graph for this function:

Return the name of the action this object responds to.

Returns:
String lowercase

Reimplemented from Action.

Definition at line 22 of file HistoryAction.php.

HistoryAction::getPageTitle ( ) [protected]

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

Returns:
String

Reimplemented from Action.

Definition at line 34 of file HistoryAction.php.

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

Here is the call graph for this function:

As we use the same small set of messages in various methods and that they are called often, we call them once and save them in $this->message.

Definition at line 60 of file HistoryAction.php.

References Action\msg().

Referenced by onView().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Returns:
Bool

Reimplemented from Action.

Definition at line 30 of file HistoryAction.php.

Whether this action requires the wiki not to be locked.

Returns:
Bool

Reimplemented from Action.

Definition at line 26 of file HistoryAction.php.


Member Data Documentation

Definition at line 20 of file HistoryAction.php.

Referenced by feed().

Definition at line 19 of file HistoryAction.php.

Referenced by fetchRevisions().


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