X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Factions%2FHistoryAction.php;h=909bd4919d5e46deca5e6e7eecb00c76abb318e1;hb=e05c4e9df06d68fcd43ce8eb888a0bea71b9dadf;hp=d26228a35b32e58ee8af80cb6abf0fd5809df122;hpb=de433e5b6e7be471cebd2d7387e40f338eade583;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index d26228a35b..909bd4919d 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -20,6 +20,7 @@ * http://www.gnu.org/copyleft/gpl.html * * @file + * @ingroup Actions */ /** @@ -30,6 +31,7 @@ * Construct it by passing in an Article, and call $h->history() to print the * history. * + * @ingroup Actions */ class HistoryAction extends FormlessAction { const DIR_PREV = 0; @@ -145,9 +147,9 @@ class HistoryAction extends FormlessAction { /** * Add date selector to quickly get to a certain time */ - $year = $request->getInt( 'year' ); - $month = $request->getInt( 'month' ); - $tagFilter = $request->getVal( 'tagfilter' ); + $year = $request->getInt( 'year' ); + $month = $request->getInt( 'month' ); + $tagFilter = $request->getVal( 'tagfilter' ); $tagSelector = ChangeTags::buildTagFilterSelector( $tagFilter ); /** @@ -174,7 +176,7 @@ class HistoryAction extends FormlessAction { false, array( 'id' => 'mw-history-search' ) ) . - Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() ) . "\n" . + Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n" . Html::hidden( 'action', 'history' ) . "\n" . Xml::dateMenu( ( $year == null ? date( "Y" ) : $year ), $month ) . ' ' . ( $tagSelector ? ( implode( ' ', $tagSelector ) . ' ' ) : '' ) . @@ -183,7 +185,7 @@ class HistoryAction extends FormlessAction { '' ); - wfRunHooks( 'PageHistoryBeforeList', array( &$this->page ) ); + wfRunHooks( 'PageHistoryBeforeList', array( &$this->page, $this->getContext() ) ); // Create and output the list. $pager = new HistoryPager( $this, $year, $month, $tagFilter, $conds ); @@ -241,7 +243,7 @@ class HistoryAction extends FormlessAction { /** * Output a subscription feed listing recent edits to this page. * - * @param $type String: feed type + * @param string $type feed type */ function feed( $type ) { global $wgFeedClasses, $wgFeedLimit; @@ -254,7 +256,7 @@ class HistoryAction extends FormlessAction { $this->getTitle()->getPrefixedText() . ' - ' . $this->msg( 'history-feed-title' )->inContentLanguage()->text(), $this->msg( 'history-feed-description' )->inContentLanguage()->text(), - $this->getTitle()->getFullUrl( 'action=history' ) + $this->getTitle()->getFullURL( 'action=history' ) ); // Get a limit on number of feed entries. Provide a sane default @@ -281,10 +283,10 @@ class HistoryAction extends FormlessAction { return new FeedItem( $this->msg( 'nohistory' )->inContentLanguage()->text(), $this->msg( 'history-feed-empty' )->inContentLanguage()->parseAsBlock(), - $this->getTitle()->getFullUrl(), + $this->getTitle()->getFullURL(), wfTimestamp( TS_MW ), '', - $this->getTitle()->getTalkPage()->getFullUrl() + $this->getTitle()->getTalkPage()->getFullURL() ); } @@ -321,16 +323,17 @@ class HistoryAction extends FormlessAction { return new FeedItem( $title, $text, - $this->getTitle()->getFullUrl( 'diff=' . $rev->getId() . '&oldid=prev' ), + $this->getTitle()->getFullURL( 'diff=' . $rev->getId() . '&oldid=prev' ), $rev->getTimestamp(), $rev->getUserText(), - $this->getTitle()->getTalkPage()->getFullUrl() + $this->getTitle()->getTalkPage()->getFullURL() ); } } /** * @ingroup Pager + * @ingroup Actions */ class HistoryPager extends ReverseChronologicalPager { public $lastRow = false, $counter, $historyPage, $buttons, $conds; @@ -440,7 +443,7 @@ class HistoryPager extends ReverseChronologicalPager { $this->getOutput()->wrapWikiMsg( "
\n$1\n
", 'histlegend' ); $s = Html::openElement( 'form', array( 'action' => $wgScript, 'id' => 'mw-history-compare' ) ) . "\n"; - $s .= Html::hidden( 'title', $this->getTitle()->getPrefixedDbKey() ) . "\n"; + $s .= Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n"; $s .= Html::hidden( 'action', 'historysubmit' ) . "\n"; // Button container stored in $this->buttons for re-use in getEndBody() @@ -508,8 +511,8 @@ class HistoryPager extends ReverseChronologicalPager { /** * Creates a submit button * - * @param $message String: text of the submit button, will be escaped - * @param $attributes Array: attributes + * @param string $message text of the submit button, will be escaped + * @param array $attributes attributes * @return String: HTML output for the submit button */ function submitButton( $message, $attributes = array() ) { @@ -580,7 +583,7 @@ class HistoryPager extends ReverseChronologicalPager { // Otherwise, show the link... } else { $query = array( 'type' => 'revision', - 'target' => $this->getTitle()->getPrefixedDbkey(), 'ids' => $rev->getId() ); + 'target' => $this->getTitle()->getPrefixedDBkey(), 'ids' => $rev->getId() ); $del .= Linker::revDeleteLink( $query, $rev->isDeleted( Revision::DELETED_RESTRICTED ), false ); } @@ -654,6 +657,8 @@ class HistoryPager extends ReverseChronologicalPager { $tools[] = "{$undolink}"; } } + // Allow extension to add their own links here + wfRunHooks( 'HistoryRevisionTools', array( $rev, &$tools ) ); if ( $tools ) { $s2 .= ' '. $this->msg( 'parentheses' )->rawParams( $lang->pipeList( $tools ) )->escaped();