MediaWiki  REL1_22
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 36 of file HistoryAction.php.


Member Function Documentation

HistoryAction::feed ( type)

Output a subscription feed listing recent edits to this page.

Parameters:
string$typefeed type

Definition at line 248 of file HistoryAction.php.

References $limit, as, FeedUtils\checkFeedOutput(), DIR_NEXT, feedEmpty(), feedItem(), fetchRevisions(), Action\getRequest(), Action\getTitle(), global, and Action\msg().

Referenced by onView().

Definition at line 281 of file HistoryAction.php.

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

Referenced by feed().

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 300 of file HistoryAction.php.

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

Referenced by feed().

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 212 of file HistoryAction.php.

References $dbr, $dirs, $limit, array(), DIR_PREV, Action\exists(), Action\getTitle(), list, page, Revision\selectFields(), and wfGetDB().

Referenced by feed().

Get the Article object we are working on.

Returns:
Page

Definition at line 70 of file HistoryAction.php.

References page.

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

Returns:
String

Reimplemented from Action.

Definition at line 56 of file HistoryAction.php.

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

Return the name of the action this object responds to.

Returns:
String lowercase

Reimplemented from Action.

Definition at line 40 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 52 of file HistoryAction.php.

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

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 78 of file HistoryAction.php.

References array(), as, message, and Action\msg().

Referenced by onView().

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

Returns:
Bool

Reimplemented from Action.

Definition at line 48 of file HistoryAction.php.

Whether this action requires the wiki not to be locked.

Returns:
Bool

Reimplemented from Action.

Definition at line 44 of file HistoryAction.php.


Member Data Documentation

Definition at line 38 of file HistoryAction.php.

Referenced by feed().

Definition at line 37 of file HistoryAction.php.

Referenced by fetchRevisions().


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