X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FPageHistory.php;h=7e31c0c66ac7336d55da7500d0f58bb5d6212526;hb=42fe290d16f66ba3d719bc6149cc79570e55a6b3;hp=56e9e183ef861ba9b3174a89b85c77c8453e4e86;hpb=bc35951c93df1b60e91f104f2b16579c275a28de;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/PageHistory.php b/includes/PageHistory.php index 56e9e183ef..7e31c0c66a 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -90,8 +90,13 @@ class PageHistory { $wgOut->addScriptFile( 'history.js' ); $logPage = SpecialPage::getTitleFor( 'Log' ); - $logLink = $this->mSkin->makeKnownLinkObj( $logPage, wfMsgHtml( 'viewpagelogs' ), - 'page=' . $this->mTitle->getPrefixedUrl() ); + $logLink = $this->mSkin->link( + $logPage, + wfMsgHtml( 'viewpagelogs' ), + array(), + array( 'page' => $this->mTitle->getPrefixedText() ), + array( 'known', 'noclasses' ) + ); $wgOut->setSubtitle( $logLink ); $feedType = $wgRequest->getVal( 'feed' ); @@ -296,9 +301,12 @@ class PageHistory { '(' . $this->message['rev-delundel'] . ')' ); // Otherwise, show the link... } else { - $jsCall = 'updateShowHideForm('.$rev->getId().',this.checked)'; + $id = $rev->getId(); + $jsCall = "updateShowHideForm($id,this.checked)"; $del = Xml::check( 'showhiderevisions', false, - $hidden + array('onchange' => $jsCall) ); + $hidden + array( + 'onchange' => $jsCall, + 'id' => "mw-revdel-$id" ) ); $query = array( 'type' => 'revision', 'target' => $this->mTitle->getPrefixedDbkey(), @@ -313,7 +321,7 @@ class PageHistory { $s .= " " . $this->mSkin->revUserTools( $rev, true ) . ""; if( $rev->isMinor() ) { - $s .= ' ' . Xml::element( 'span', array( 'class' => 'minor' ), wfMsg( 'minoreditletter') ); + $s .= ' ' . ChangesList::flag( 'minor' ); } if( !is_null( $size = $rev->getSize() ) && !$rev->isDeleted( Revision::DELETED_TEXT ) ) { @@ -379,7 +387,13 @@ class PageHistory { $date = $wgLang->timeanddate( wfTimestamp(TS_MW, $rev->getTimestamp()), true ); $date = htmlspecialchars( $date ); if( !$rev->isDeleted( Revision::DELETED_TEXT ) ) { - $link = $this->mSkin->makeKnownLinkObj( $this->mTitle, $date, "oldid=" . $rev->getId() ); + $link = $this->mSkin->link( + $this->mTitle, + $date, + array(), + array( 'oldid' => $rev->getId() ), + array( 'known', 'noclasses' ) + ); } else { $link = "$date"; } @@ -397,8 +411,16 @@ class PageHistory { if( $latest || !$rev->userCan( Revision::DELETED_TEXT ) ) { return $cur; } else { - return $this->mSkin->makeKnownLinkObj( $this->mTitle, $cur, - 'diff=' . $this->mTitle->getLatestRevID() . "&oldid=" . $rev->getId() ); + return $this->mSkin->link( + $this->mTitle, + $cur, + array(), + array( + 'diff' => $this->mTitle->getLatestRevID(), + 'oldid' => $rev->getId() + ), + array( 'known', 'noclasses' ) + ); } } @@ -418,13 +440,29 @@ class PageHistory { return $last; } elseif( $next === 'unknown' ) { # Next row probably exists but is unknown, use an oldid=prev link - return $this->mSkin->makeKnownLinkObj( $this->mTitle, $last, - "diff=" . $prevRev->getId() . "&oldid=prev" ); + return $this->mSkin->link( + $this->mTitle, + $last, + array(), + array( + 'diff' => $prevRev->getId(), + 'oldid' => 'prev' + ), + array( 'known', 'noclasses' ) + ); } elseif( !$prevRev->userCan(Revision::DELETED_TEXT) || !$nextRev->userCan(Revision::DELETED_TEXT) ) { return $last; } else { - return $this->mSkin->makeKnownLinkObj( $this->mTitle, $last, - "diff=" . $prevRev->getId() . "&oldid={$next->rev_id}" ); + return $this->mSkin->link( + $this->mTitle, + $last, + array(), + array( + 'diff' => $prevRev->getId(), + 'oldid' => $next->rev_id + ), + array( 'known', 'noclasses' ) + ); } } @@ -438,11 +476,15 @@ class PageHistory { */ function diffButtons( $rev, $firstInList, $counter ) { if( $this->linesonpage > 1 ) { - $radio = array( 'type' => 'radio', 'value' => $rev->getId() ); + $id = $rev->getId(); + $radio = array( 'type' => 'radio', 'value' => $id ); /** @todo: move title texts to javascript */ if( $firstInList ) { $first = Xml::element( 'input', - array_merge( $radio, array( 'style' => 'visibility:hidden', 'name' => 'oldid' ) ) + array_merge( $radio, array( + 'style' => 'visibility:hidden', + 'name' => 'oldid', + 'id' => 'mw-oldid-null' ) ) ); $checkmark = array( 'checked' => 'checked' ); } else { @@ -452,14 +494,20 @@ class PageHistory { $checkmark = array(); // We will check the next possible one } else if( $counter == 2 || !$this->mOldIdChecked ) { $checkmark = array( 'checked' => 'checked' ); - $this->mOldIdChecked = $rev->getId(); + $this->mOldIdChecked = $id; } else { $checkmark = array(); } - $first = Xml::element( 'input', array_merge( $radio, $checkmark, array( 'name' => 'oldid' ) ) ); + $first = Xml::element( 'input', + array_merge( $radio, $checkmark, array( + 'name' => 'oldid', + 'id' => "mw-oldid-$id" ) ) ); $checkmark = array(); } - $second = Xml::element( 'input', array_merge( $radio, $checkmark, array( 'name' => 'diff' ) ) ); + $second = Xml::element( 'input', + array_merge( $radio, $checkmark, array( + 'name' => 'diff', + 'id' => "mw-diff-$id" ) ) ); return $first . $second; } else { return ''; @@ -506,10 +554,11 @@ class PageHistory { } $feed = new $wgFeedClasses[$type]( - $this->mTitle->getPrefixedText() . ' - ' . - wfMsgForContent( 'history-feed-title' ), - wfMsgForContent( 'history-feed-description' ), - $this->mTitle->getFullUrl( 'action=history' ) ); + $this->mTitle->getPrefixedText() . ' - ' . + wfMsgForContent( 'history-feed-title' ), + wfMsgForContent( 'history-feed-description' ), + $this->mTitle->getFullUrl( array( '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) @@ -538,7 +587,8 @@ class PageHistory { $this->mTitle->getFullUrl(), wfTimestamp( TS_MW ), '', - $this->mTitle->getTalkPage()->getFullUrl() ); + $this->mTitle->getTalkPage()->getFullUrl() + ); } /** @@ -552,32 +602,39 @@ class PageHistory { function feedItem( $row ) { $rev = new Revision( $row ); $rev->setTitle( $this->mTitle ); - $text = FeedUtils::formatDiffRow( $this->mTitle, - $this->mTitle->getPreviousRevisionID( $rev->getId() ), - $rev->getId(), - $rev->getTimestamp(), - $rev->getComment() ); - + $text = FeedUtils::formatDiffRow( + $this->mTitle, + $this->mTitle->getPreviousRevisionID( $rev->getId() ), + $rev->getId(), + $rev->getTimestamp(), + $rev->getComment() + ); if( $rev->getComment() == '' ) { global $wgContLang; + $ts = $rev->getTimestamp(); $title = wfMsgForContent( 'history-feed-item-nocomment', - $rev->getUserText(), - $wgContLang->timeanddate( $rev->getTimestamp() ) ); + $rev->getUserText(), + $wgContLang->timeanddate( $ts ), + $wgContLang->date( $ts ), + $wgContLang->time( $ts ) ); } 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, $text, - $this->mTitle->getFullUrl( 'diff=' . $rev->getId() . '&oldid=prev' ), + $this->mTitle->getFullUrl( array( + 'diff' => $rev->getId(), + 'oldid' => 'prev' + ) ), $rev->getTimestamp(), $rev->getUserText(), - $this->mTitle->getTalkPage()->getFullUrl() ); + $this->mTitle->getTalkPage()->getFullUrl() + ); } } - /** * @ingroup Pager */