function preCacheMessages() {
// Precache various messages
if( !isset( $this->message ) ) {
- foreach( explode(' ', 'cur last rev-delundel' ) as $msg ) {
- $this->message[$msg] = wfMsgExt( $msg, array( 'escape') );
+ $msgs = array( 'cur', 'last', 'rev-delundel', 'pipe-separator' );
+ foreach( $msgs as $msg ) {
+ $this->message[$msg] = wfMsgExt( $msg, array( 'escapenoentities') );
}
}
}
if( !$this->title->exists() ) {
$wgOut->addWikiMsg( 'nohistory' );
# show deletion/move log if there is an entry
- LogEventsList::showLogExtract( $wgOut, array( 'delete', 'move' ), $this->title->getPrefixedText(), '',
+ LogEventsList::showLogExtract(
+ $wgOut,
+ array( 'delete', 'move' ),
+ $this->title->getPrefixedText(),
+ '',
array( 'lim' => 10,
'conds' => array( "log_action != 'revision'" ),
'showIfEmpty' => false,
- 'msgKey' => array( 'moveddeleted-notice' ) )
+ 'msgKey' => array( 'moveddeleted-notice' )
+ )
);
wfProfileOut( __METHOD__ );
return;
$action = htmlspecialchars( $wgScript );
$wgOut->addHTML(
"<form action=\"$action\" method=\"get\" id=\"mw-history-searchform\">" .
- Xml::fieldset( wfMsg( 'history-fieldset-title' ), false, array( 'id' => 'mw-history-search' ) ) .
+ Xml::fieldset(
+ wfMsg( 'history-fieldset-title' ),
+ false,
+ array( 'id' => 'mw-history-search' )
+ ) .
Xml::hidden( 'title', $this->title->getPrefixedDBKey() ) . "\n" .
Xml::hidden( 'action', 'history' ) . "\n" .
xml::dateMenu( $year, $month ) . ' ' .
Revision::selectFields(),
array_merge(array("rev_page=$page_id"), $offsets),
__METHOD__,
- array( 'ORDER BY' => "rev_timestamp $dirs",
+ array( 'ORDER BY' => "rev_timestamp $dirs",
'USE INDEX' => 'page_timestamp', 'LIMIT' => $limit)
);
}
}
$feed = new $wgFeedClasses[$type](
- $this->title->getPrefixedText() . ' - ' .
- wfMsgForContent( 'history-feed-title' ),
- wfMsgForContent( 'history-feed-description' ),
- $this->title->getFullUrl( 'action=history' ) );
+ $this->title->getPrefixedText() . ' - ' .
+ wfMsgForContent( 'history-feed-title' ),
+ wfMsgForContent( 'history-feed-description' ),
+ $this->title->getFullUrl( 'action=history' )
+ );
// Get a limit on number of feed entries. Provide a sane default
// of 10 if none is defined (but limit to $wgFeedLimit max)
if( $rev->getComment() == '' ) {
global $wgContLang;
$title = wfMsgForContent( 'history-feed-item-nocomment',
- $rev->getUserText(),
- $wgContLang->timeanddate( $rev->getTimestamp() ) );
+ $rev->getUserText(),
+ $wgContLang->timeanddate( $rev->getTimestamp() ),
+ $wgContLang->date( $rev->getTimestamp() ),
+ $wgContLang->time( $rev->getTimestamp() )
+ );
} else {
- $title = $rev->getUserText() . wfMsgForContent( 'colon-separator' ) . FeedItem::stripComment( $rev->getComment() );
+ $title = $rev->getUserText() .
+ wfMsgForContent( 'colon-separator' ) .
+ FeedItem::stripComment( $rev->getComment() );
}
return new FeedItem(
$title,
}
}
-
/**
* @ingroup Pager
*/
$this->tagFilter = $tagFilter;
$this->getDateCond( $year, $month );
}
-
+
// For hook compatibility...
function getArticle() {
return $this->historyPage->getArticle();
'options' => array( 'USE INDEX' => array('revision' => 'page_timestamp') ),
'join_conds' => array( 'tag_summary' => array( 'LEFT JOIN', 'ts_rev_id=rev_id' ) ),
);
- ChangeTags::modifyDisplayQuery( $queryInfo['tables'],
- $queryInfo['fields'],
- $queryInfo['conds'],
- $queryInfo['join_conds'],
- $queryInfo['options'],
- $this->tagFilter );
+ ChangeTags::modifyDisplayQuery(
+ $queryInfo['tables'],
+ $queryInfo['fields'],
+ $queryInfo['conds'],
+ $queryInfo['join_conds'],
+ $queryInfo['options'],
+ $this->tagFilter
+ );
wfRunHooks( 'PageHistoryPager::getQueryInfo', array( &$this, &$queryInfo ) );
return $queryInfo;
}
* @return string HTML output
*/
function getStartBody() {
- global $wgScript, $wgEnableHtmlDiff, $wgUser, $wgOut;
+ global $wgScript, $wgEnableHtmlDiff, $wgUser, $wgOut, $wgContLang;
$this->lastRow = false;
$this->counter = 1;
$this->oldIdChecked = 0;
$s = Xml::openElement( 'form', array( 'action' => $wgScript,
'id' => 'mw-history-compare' ) ) . "\n";
$s .= Xml::hidden( 'title', $this->title->getPrefixedDbKey() ) . "\n";
+ $s .= Xml::hidden( 'action', 'historysubmit' ) . "\n";
$this->buttons = '<div>';
if( $wgUser->isAllowed('deleterevision') ) {
- $this->buttons .= Xml::element( 'button',
+ $float = $wgContLang->alignEnd();
+ # Note bug #20966, <button> is non-standard in IE<8
+ $this->buttons .= Xml::element( 'button',
array(
'type' => 'submit',
- 'name' => 'action',
- 'value' => 'revisiondelete',
- 'style' => 'float: right',
+ 'name' => 'revisiondelete',
+ 'value' => '1',
+ 'style' => "float: $float;",
+ 'class' => 'mw-history-revisiondelete-button',
),
wfMsg( 'showhideselectedversions' )
) . "\n";
$curlink = $this->curLink( $rev, $latest );
$lastlink = $this->lastLink( $rev, $next, $counter );
$diffButtons = $this->diffButtons( $rev, $firstInList, $counter );
+ $histLinks = Html::rawElement(
+ 'span',
+ array( 'class' => 'mw-history-histlinks' ),
+ '(' . $curlink . $this->historyPage->message['pipe-separator'] . $lastlink . ') '
+ );
+ $s = $histLinks . $diffButtons;
+
$link = $this->revLink( $rev );
$classes = array();
- $s = "($curlink) ($lastlink) $diffButtons";
-
if( $wgUser->isAllowed( 'deleterevision' ) ) {
+ // Don't show useless link to people who cannot hide revisions
+ if( !$rev->getVisibility() && !$wgUser->isAllowed( 'deleterevision' ) ) {
+ $del = Xml::check( 'deleterevisions', false, array('class' => 'mw-revdelundel-hidden') );
// If revision was hidden from sysops
- if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) {
+ } else if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) {
$del = Xml::check( 'deleterevisions', false, array('disabled' => 'disabled') );
// Otherwise, show the link...
} else {
$this->title,
wfMsgHtml( 'editundo' ),
$undoTooltip,
- array( 'action' => 'edit', 'undoafter' => $next->rev_id, 'undo' => $rev->getId() ),
+ array(
+ 'action' => 'edit',
+ 'undoafter' => $next->rev_id,
+ 'undo' => $rev->getId()
+ ),
array( 'known', 'noclasses' )
);
$tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>";
$radio = array( 'type' => 'radio', 'value' => $id );
/** @todo: move title texts to javascript */
if( $firstInList ) {
- $first = Xml::element( 'input',
+ $first = Xml::element( 'input',
array_merge( $radio, array(
'style' => 'visibility:hidden',
'name' => 'oldid',
);
$checkmark = array( 'checked' => 'checked' );
} else {
- # Check visibility of old revisions
+ # Check ility of old revisions
if( !$rev->userCan( Revision::DELETED_TEXT ) ) {
$radio['disabled'] = 'disabled';
$checkmark = array(); // We will check the next possible one
*/
class PageHistory extends HistoryPage {}
class PageHistoryPager extends HistoryPager {}
-