Public Member Functions | |
__construct ($article) | |
Construct a new PageHistory. | |
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. | |
beginHistoryList () | |
Creates begin of history list with a submit button. | |
endHistoryList () | |
Creates end of history list with a submit button. | |
submitButton ($message, $attributes=array()) | |
Creates a submit button. | |
historyLine ($row, $next, $counter= '', $notificationtimestamp=false, $latest=false, $firstInList=false) | |
Returns a row from the history printout. | |
revLink ($rev) | |
Create a link to view this revision of the page. | |
curLink ($rev, $latest) | |
Create a diff-to-current link for this revision for this page. | |
lastLink ($prevRev, $next, $counter) | |
Create a diff-to-previous link for this revision for this page. | |
diffButtons ($rev, $firstInList, $counter) | |
Create radio buttons for page history. | |
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 |
$mArticle | |
$mTitle | |
$mSkin | |
$lastdate | |
$linesonpage | |
$mLatestId = null | |
Private Attributes | |
$mOldIdChecked = 0 |
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 PageHistory.php.
PageHistory::__construct | ( | $ | article | ) |
Construct a new PageHistory.
Article | $article |
Definition at line 35 of file PageHistory.php.
References $wgUser, and preCacheMessages().
PageHistory::beginHistoryList | ( | ) |
Creates begin of history list with a submit button.
Definition at line 155 of file PageHistory.php.
References $s, $wgEnableHtmlDiff, $wgScript, $wgTitle, Xml::hidden(), Xml::openElement(), submitButton(), wfMsg(), and wfMsgExt().
Referenced by history().
PageHistory::curLink | ( | $ | rev, | |
$ | latest | |||
) |
Create a diff-to-current link for this revision for this page.
Revision | $rev | |
Bool | $latest, this is the latest revision of the page? |
Definition at line 367 of file PageHistory.php.
References Revision::DELETED_TEXT.
Referenced by historyLine().
PageHistory::diffButtons | ( | $ | rev, | |
$ | firstInList, | |||
$ | counter | |||
) |
Create radio buttons for page history.
object | $rev Revision | |
bool | $firstInList Is this version the first one? | |
int | $counter A counter of what row number we're at, counted from the top row = 1. |
Definition at line 411 of file PageHistory.php.
References $counter, Revision::DELETED_TEXT, and Xml::element().
Referenced by historyLine().
PageHistory::endHistoryList | ( | ) |
Creates end of history list with a submit button.
Definition at line 195 of file PageHistory.php.
References $s, $wgEnableHtmlDiff, submitButton(), and wfMsg().
Referenced by history().
PageHistory::feed | ( | $ | type | ) |
Output a subscription feed listing recent edits to this page.
string | $type |
Definition at line 474 of file PageHistory.php.
References $row, $type, $wgFeedClasses, $wgFeedLimit, $wgRequest, FeedUtils::checkFeedOutput(), DIR_NEXT, feedEmpty(), feedItem(), fetchRevisions(), and wfMsgForContent().
Referenced by history().
PageHistory::feedEmpty | ( | ) |
Definition at line 505 of file PageHistory.php.
References $wgOut, wfMsgForContent(), and wfTimestamp().
Referenced by feed().
PageHistory::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).
$row |
Definition at line 524 of file PageHistory.php.
References $row, $text, $title, $wgContLang, FeedUtils::formatDiffRow(), FeedItem::stripComment(), and wfMsgForContent().
Referenced by feed().
PageHistory::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.
Definition at line 446 of file PageHistory.php.
References $dbr, $offset, DIR_PREV, Revision::selectFields(), and wfGetDB().
Referenced by feed().
PageHistory::getArticle | ( | ) |
Definition at line 43 of file PageHistory.php.
PageHistory::getTitle | ( | ) |
Definition at line 47 of file PageHistory.php.
PageHistory::history | ( | ) |
Print the history page for an article.
Definition at line 69 of file PageHistory.php.
References $action, $wgOut, $wgRequest, $wgScript, $wgTitle, beginHistoryList(), ChangeTags::buildTagFilterSelector(), endHistoryList(), feed(), Xml::fieldset(), SpecialPage::getTitleFor(), Xml::hidden(), submitButton(), wfMsg(), wfMsgHtml(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
PageHistory::historyLine | ( | $ | row, | |
$ | next, | |||
$ | counter = '' , |
|||
$ | notificationtimestamp = false , |
|||
$ | latest = false , |
|||
$ | firstInList = false | |||
) |
Returns a row from the history printout.
Row | $row The database row corresponding to the previous line. | |
mixed | $next The database row corresponding to the next line. | |
int | $counter Apparently a counter of what row number we're at, counted from the top row = 1. | |
$notificationtimestamp | ||
bool | $latest Whether this row corresponds to the page's latest revision. | |
bool | $firstInList Whether this row corresponds to the first displayed on this history page. |
Definition at line 255 of file PageHistory.php.
References $classes, $counter, $del, $row, $s, $size, $wgLang, $wgUser, curLink(), Revision::DELETED_RESTRICTED, Revision::DELETED_TEXT, diffButtons(), Xml::element(), ChangeTags::formatSummaryRow(), lastLink(), revLink(), Xml::tags(), wfMsg(), wfMsgHtml(), and wfRunHooks().
PageHistory::lastLink | ( | $ | prevRev, | |
$ | next, | |||
$ | counter | |||
) |
Create a diff-to-previous link for this revision for this page.
Revision | $prevRev, the previous revision | |
mixed | $next, the newer revision | |
int | $counter, what row on the history list this is |
Definition at line 384 of file PageHistory.php.
References Revision::DELETED_TEXT.
Referenced by historyLine().
PageHistory::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 55 of file PageHistory.php.
References $msg, and wfMsgExt().
Referenced by __construct().
PageHistory::revLink | ( | $ | rev | ) |
Create a link to view this revision of the page.
Revision | $rev |
Definition at line 350 of file PageHistory.php.
References $wgLang, Revision::DELETED_TEXT, and wfTimestamp().
Referenced by historyLine().
PageHistory::submitButton | ( | $ | message, | |
$ | attributes = array() | |||
) |
Creates a submit button.
array | $attributes attributes |
Definition at line 233 of file PageHistory.php.
Referenced by beginHistoryList(), endHistoryList(), and history().
PageHistory::$lastdate |
Definition at line 23 of file PageHistory.php.
PageHistory::$linesonpage |
Definition at line 24 of file PageHistory.php.
PageHistory::$mArticle |
Definition at line 22 of file PageHistory.php.
PageHistory::$mLatestId = null |
Definition at line 25 of file PageHistory.php.
PageHistory::$mOldIdChecked = 0 [private] |
Definition at line 27 of file PageHistory.php.
PageHistory::$mSkin |
Definition at line 22 of file PageHistory.php.
PageHistory::$mTitle |
Definition at line 22 of file PageHistory.php.
const PageHistory::DIR_NEXT = 1 |
const PageHistory::DIR_PREV = 0 |