HistoryPage Class Reference

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

Inherited by PageHistory.

List of all members.

Public Member Functions

 __construct ($article)
 Construct a new HistoryPage.
 getArticle ()
 getTitle ()
 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.
 history ()
 Print the history page for an article.
 fetchRevisions ($limit, $offset, $direction)
 Fetch an array of revisions, specified by a given limit, offset and direction.
 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).

Public Attributes

const DIR_PREV = 0
const DIR_NEXT = 1
 $article
 $title
 $skin


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 HistoryPage.php.


Constructor & Destructor Documentation

HistoryPage::__construct ( article  ) 

Construct a new HistoryPage.

Parameters:
$article Article

Definition at line 29 of file HistoryPage.php.

References $article, $wgUser, and preCacheMessages().


Member Function Documentation

HistoryPage::feed ( type  ) 

Output a subscription feed listing recent edits to this page.

Parameters:
$type String: feed type

Definition at line 213 of file HistoryPage.php.

References $wgFeedClasses, $wgFeedLimit, $wgRequest, FeedUtils::checkFeedOutput(), DIR_NEXT, feedEmpty(), feedItem(), fetchRevisions(), and wfMsgForContent().

Referenced by history().

HistoryPage::feedEmpty (  ) 

Definition at line 245 of file HistoryPage.php.

References $wgOut, wfMsgForContent(), and wfTimestamp().

Referenced by feed().

HistoryPage::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).

Parameters:
$row Object: database row
Returns:
FeedItem

Definition at line 265 of file HistoryPage.php.

References $title, $wgContLang, FeedUtils::formatDiffRow(), FeedItem::stripComment(), and wfMsgForContent().

Referenced by feed().

HistoryPage::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:
$limit Integer: the limit number of revisions to get
$offset Integer
$direction Integer: either HistoryPage::DIR_PREV or HistoryPage::DIR_NEXT
Returns:
ResultWrapper

Definition at line 184 of file HistoryPage.php.

References $dbr, $dirs, DIR_PREV, Revision::selectFields(), and wfGetDB().

Referenced by feed().

HistoryPage::getArticle (  ) 

Definition at line 37 of file HistoryPage.php.

HistoryPage::getTitle (  ) 

Definition at line 41 of file HistoryPage.php.

HistoryPage::history (  ) 

HistoryPage::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.

Definition at line 49 of file HistoryPage.php.

References $msg, and wfMsgExt().

Referenced by __construct().


Member Data Documentation

HistoryPage::$article

Definition at line 22 of file HistoryPage.php.

Referenced by __construct().

HistoryPage::$skin

Definition at line 22 of file HistoryPage.php.

HistoryPage::$title

Definition at line 22 of file HistoryPage.php.

Referenced by feedItem().

Definition at line 20 of file HistoryPage.php.

Referenced by feed().

Definition at line 19 of file HistoryPage.php.

Referenced by fetchRevisions().


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

Generated on Sat Apr 30 22:57:38 2011 for MediaWiki by  doxygen 1.5.9