* use array type parameter instead of string to escapeLocalUrl(), getFullURL() and getFullUrl() for readability
* add FIXME in Parser.php and LogEventsList.php where I didn't know how to replace makeKnownLinkObj by link()
* return type for private method Skin::editUrlOptions() changed from string to array
* some code readability improvements
Linking this to r51559 for CodeReview as there is some discussion there, and these changes are very similar.
Todo: core special pages
$hiddens = ''; // keep track for "go" button
foreach( $filter as $type => $val ) {
$hideVal = 1 - intval($val);
+ // FIXME: use link() here. Needs changes in getDefaultQuery()
$link = $this->skin->makeKnownLinkObj( $wgTitle, $messages[$hideVal],
wfArrayToCGI( array( "hide_{$type}_log" => $hideVal ), $this->getDefaultQuery() )
);
} else if( self::typeAction($row,'move','move','move') && !empty($paramArray[0]) ) {
$destTitle = Title::newFromText( $paramArray[0] );
if( $destTitle ) {
- $revert = '(' . $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Movepage' ),
+ $revert = '(' . $this->skin->link(
+ SpecialPage::getTitleFor( 'Movepage' ),
$this->message['revertmove'],
- 'wpOldTitle=' . urlencode( $destTitle->getPrefixedDBkey() ) .
- '&wpNewTitle=' . urlencode( $title->getPrefixedDBkey() ) .
- '&wpReason=' . urlencode( wfMsgForContent( 'revertmove' ) ) .
- '&wpMovetalk=0' ) . ')';
+ array(),
+ array(
+ 'wpOldTitle' => $destTitle->getPrefixedDBkey(),
+ 'wpNewTitle' => $title->getPrefixedDBkey(),
+ 'wpReason' => wfMsgForContent( 'revertmove' ),
+ 'wpMovetalk' => 0
+ ),
+ array( 'known', 'noclasses' )
+ ) . ')';
}
// Show undelete link
} else if( self::typeAction($row,array('delete','suppress'),'delete','deletedhistory') ) {
- if( !$wgUser->isAllowed( 'undelete' ) )
+ if( !$wgUser->isAllowed( 'undelete' ) ) {
$viewdeleted = $this->message['undeleteviewlink'];
- else
+ } else {
$viewdeleted = $this->message['undeletelink'];
- $revert = '(' . $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Undelete' ),
- $viewdeleted, 'target='. urlencode( $title->getPrefixedDBkey() ) ) . ')';
+ }
+
+ $revert = '(' . $this->skin->link(
+ SpecialPage::getTitleFor( 'Undelete' ),
+ $viewdeleted,
+ array(),
+ array( 'target' => $title->getPrefixedDBkey() ),
+ array( 'known', 'noclasses' )
+ ) . ')';
// Show unblock/change block link
} else if( self::typeAction($row,array('block','suppress'),array('block','reblock'),'block') ) {
$revert = '(' .
- $this->skin->link( SpecialPage::getTitleFor( 'Ipblocklist' ),
+ $this->skin->link(
+ SpecialPage::getTitleFor( 'Ipblocklist' ),
$this->message['unblocklink'],
array(),
- array( 'action' => 'unblock', 'ip' => $row->log_title ),
- 'known' )
- . $this->message['pipe-separator'] .
- $this->skin->link( SpecialPage::getTitleFor( 'Blockip', $row->log_title ),
+ array(
+ 'action' => 'unblock',
+ 'ip' => $row->log_title
+ ),
+ 'known'
+ ) .
+ $this->message['pipe-separator'] .
+ $this->skin->link(
+ SpecialPage::getTitleFor( 'Blockip', $row->log_title ),
$this->message['change-blocklink'],
- array(), array(), 'known' ) .
+ array(),
+ array(),
+ 'known'
+ ) .
')';
// Show change protection link
} else if( self::typeAction( $row, 'protect', array( 'modify', 'protect', 'unprotect' ) ) ) {
$this->skin->link( $title,
$this->message['hist'],
array(),
- array( 'action' => 'history', 'offset' => $row->log_timestamp ) );
+ array(
+ 'action' => 'history',
+ 'offset' => $row->log_timestamp
+ )
+ );
if( $wgUser->isAllowed( 'protect' ) ) {
$revert .= $this->message['pipe-separator'] .
$this->skin->link( $title,
// Show unmerge link
} else if( self::typeAction($row,'merge','merge','mergehistory') ) {
$merge = SpecialPage::getTitleFor( 'Mergehistory' );
- $revert = '(' . $this->skin->makeKnownLinkObj( $merge, $this->message['revertmerge'],
- wfArrayToCGI( array('target' => $paramArray[0], 'dest' => $title->getPrefixedDBkey(),
- 'mergepoint' => $paramArray[1] ) ) ) . ')';
+ $revert = '(' . $this->skin->link(
+ $merge,
+ $this->message['revertmerge'],
+ array(),
+ array(
+ 'target' => $paramArray[0],
+ 'dest' => $title->getPrefixedDBkey(),
+ 'mergepoint' => $paramArray[1]
+ ),
+ array( 'known', 'noclasses' )
+ ) . ')';
// If an edit was hidden from a page give a review link to the history
} else if( self::typeAction($row,array('delete','suppress'),'revision','deleterevision') ) {
if( count($paramArray) >= 2 ) {
$key = $paramArray[0];
// $paramArray[1] is a CSV of the IDs
$Ids = explode( ',', $paramArray[1] );
- $query = urlencode($paramArray[1]);
+ $query = $paramArray[1];
$revert = array();
// Diff link for single rev deletions
if( ( $key === 'oldid' || $key == 'revision' ) && count($Ids) == 1 ) {
- $revert[] = $this->skin->makeKnownLinkObj( $title, $this->message['diff'],
- 'diff='.intval($Ids[0])."&unhide=1" );
+ $revert[] = $this->skin->link(
+ $title,
+ $this->message['diff'],
+ array(),
+ array(
+ 'diff' => intval( $Ids[0] ),
+ 'unhide' => 1
+ ),
+ array( 'known', 'noclasses' )
+ );
}
// View/modify link...
- $revert[] = $this->skin->makeKnownLinkObj( $revdel, $this->message['revdel-restore'],
- 'target='.$title->getPrefixedUrl()."&type=$key&ids=$query" );
+ $revert[] = $this->skin->link(
+ $revdel,
+ $this->message['revdel-restore'],
+ array(),
+ array(
+ 'target' => $title->getPrefixedUrl(),
+ 'type' => $key,
+ 'ids' => $query
+ ),
+ array( 'known', 'noclasses' )
+ );
// Pipe links
$revert = '(' . implode(' | ',$revert) . ')';
}
$revdel = SpecialPage::getTitleFor( 'Revisiondelete' );
// $paramArray[1] is a CSV of the IDs
$Ids = explode( ',', $paramArray[0] );
- $query = urlencode($paramArray[0]);
+ $query = $paramArray[0];
// Link to each hidden object ID, $paramArray[1] is the url param
- $revert = '(' . $this->skin->makeKnownLinkObj( $revdel, $this->message['revdel-restore'],
- 'target='.$title->getPrefixedUrl()."&type=logging&ids=$query" ) . ')';
+ $revert = '(' . $this->skin->link(
+ $revdel,
+ $this->message['revdel-restore'],
+ array(),
+ array(
+ 'target' => $title->getPrefixedUrl(),
+ 'type' => 'logging',
+ 'ids' => $query
+ ),
+ array( 'known', 'noclasses' )
+ ) . ')';
}
// Self-created users
} else if( self::typeAction($row,'newusers','create2') ) {
$this->setArticleFlag( false );
$loginTitle = SpecialPage::getTitleFor( 'Userlogin' );
- $loginLink = $skin->makeKnownLinkObj( $loginTitle, wfMsgHtml( 'loginreqlink' ), 'returnto=' . $this->getTitle()->getPrefixedUrl() );
+ $loginLink = $skin->link(
+ $loginTitle,
+ wfMsgHtml( 'loginreqlink' ),
+ array(),
+ array( 'returnto' => $this->getTitle()->getPrefixedUrl() ),
+ array( 'known', 'noclasses' )
+ );
$this->addHTML( wfMsgWikiHtml( 'loginreqpagetext', $loginLink ) );
$this->addHTML( "\n<!--" . $this->getTitle()->getPrefixedUrl() . "-->" );
// Permissions error
if( $source ) {
$this->setPageTitle( wfMsg( 'viewsource' ) );
- $this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $this->getTitle() ) ) );
+ $this->setSubtitle(
+ wfMsg(
+ 'viewsourcefor',
+ $skin->link(
+ $this->getTitle(),
+ null,
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ )
+ )
+ );
} else {
$this->setPageTitle( wfMsg( 'badaccess' ) );
}
$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->getPrefixedUrl() ),
+ array( 'known', 'noclasses' )
+ );
$wgOut->setSubtitle( $logLink );
$feedType = $wgRequest->getVal( 'feed' );
$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 = "<span class=\"history-deleted\">$date</span>";
}
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' )
+ );
}
}
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' )
+ );
}
}
}
$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)
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() );
}
}
-
/**
* @ingroup Pager
*/
$link = $skin->link( $title );
if( $title->exists() ) {
# Generate a diff link
- $bits[] = 'oldid=' . urlencode( $cur );
- $bits[] = 'diff=prev';
- $bits = implode( '&', $bits );
- $diff = $skin->makeKnownLinkObj( $title, htmlspecialchars( wfMsg( 'patrol-log-diff', $cur ) ), $bits );
+ $query = array(
+ 'oldid' => $cur,
+ 'diff' => 'prev'
+ );
+
+ $diff = $skin->link(
+ $title,
+ htmlspecialchars( wfMsg( 'patrol-log-diff', $cur ) ),
+ array(),
+ $query,
+ array( 'known', 'noclasses' )
+ );
} else {
# Don't bother with a diff link, it's useless
$diff = htmlspecialchars( wfMsg( 'patrol-log-diff', $cur ) );
global $wgUser; // wgUser is okay here, it's for display
$skin = $wgUser->getSkin();
$emailauthenticated = wfMsgHtml('emailnotauthenticated').'<br />' .
- $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Confirmemail' ),
- wfMsg( 'emailconfirmlink' ) ) . '<br />';
+ $skin->link(
+ SpecialPage::getTitleFor( 'Confirmemail' ),
+ wfMsg( 'emailconfirmlink' ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ ) . '<br />';
}
} else {
$disableEmailPrefs = true;
}
}
if ( 'history' == $action || isset( $diff ) || isset( $oldid ) ) {
- $s[] .= $this->makeKnownLinkObj( $this->mTitle,
- wfMsg( 'currentrev' ) );
+ $s[] .= $this->link(
+ $this->mTitle,
+ wfMsg( 'currentrev' ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ );
}
if ( $wgUser->getNewtalk() ) {
# do not show "You have new messages" text when we are viewing our
# own talk page
if( !$this->mTitle->equals( $wgUser->getTalkPage() ) ) {
- $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(), wfMsgHtml( 'newmessageslink' ), 'redirect=no' );
- $dl = $this->makeKnownLinkObj( $wgUser->getTalkPage(), wfMsgHtml( 'newmessagesdifflink' ), 'diff=cur' );
+ $tl = $this->link(
+ $wgUser->getTalkPage(),
+ wfMsgHtml( 'newmessageslink' ),
+ array(),
+ array( 'redirect' => 'no' ),
+ array( 'known', 'noclasses' )
+ );
+
+ $dl = $this->link(
+ $wgUser->getTalkPage(),
+ wfMsgHtml( 'newmessagesdifflink' ),
+ array(),
+ array( 'diff' => 'cur' ),
+ array( 'known', 'noclasses' )
+ );
$s[] = '<strong>'. wfMsg( 'youhavenewmessages', $tl, $dl ) . '</strong>';
# disable caching
$wgOut->setSquidMaxage( 0 );
} else {
$msg = 'viewdeleted';
}
- return wfMsg( $msg,
- $this->makeKnownLinkObj(
+ return wfMsg(
+ $msg,
+ $this->link(
SpecialPage::getTitleFor( 'Undelete', $this->mTitle->getPrefixedDBkey() ),
- wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $wgLang->formatNum( $n ) ) ) );
+ wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $wgLang->formatNum( $n ) ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ )
+ );
}
}
return '';
$display .= $link;
$linkObj = Title::newFromText( $growinglink );
if( is_object( $linkObj ) && $linkObj->exists() ){
- $getlink = $this->makeKnownLinkObj( $linkObj, htmlspecialchars( $display ) );
+ $getlink = $this->link(
+ $linkObj,
+ htmlspecialchars( $display ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ );
$c++;
if( $c > 1 ) {
$subpages .= wfMsgExt( 'pipe-separator', 'escapenoentities' );
}
function mainPageLink() {
- $s = $this->makeKnownLinkObj( Title::newMainPage(), wfMsg( 'mainpage' ) );
+ $s = $this->link(
+ Title::newMainPage(),
+ wfMsg( 'mainpage' ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ );
return $s;
}
$t = wfMsg( 'viewsource' );
}
- $s = $this->makeKnownLinkObj( $this->mTitle, $t, $this->editUrlOptions() );
+ $s = $this->link(
+ $this->mTitle,
+ $t,
+ array(),
+ $this->editUrlOptions(),
+ array( 'known', 'noclasses' )
+ );
}
return $s;
}
* Return URL options for the 'edit page' link.
* This may include an 'oldid' specifier, if the current page view is such.
*
- * @return string
+ * @return array
* @private
*/
function editUrlOptions() {
global $wgArticle;
+ $options = array( 'action' => 'edit' );
+
if( $this->mRevisionId && ! $wgArticle->isCurrent() ) {
- return 'action=edit&oldid=' . intval( $this->mRevisionId );
- } else {
- return 'action=edit';
+ $options['oldid'] = intval( $this->mRevisionId );
}
+
+ return $options;
}
function deleteThisPage() {
if ( $this->mTitle->getArticleId() && ( !$diff ) && $wgUser->isAllowed( 'delete' ) ) {
$t = wfMsg( 'deletethispage' );
- $s = $this->makeKnownLinkObj( $this->mTitle, $t, 'action=delete' );
+ $s = $this->link(
+ $this->mTitle,
+ $t,
+ array(),
+ array( 'action' => 'delete' ),
+ array( 'known', 'noclasses' )
+ );
} else {
$s = '';
}
$diff = $wgRequest->getVal( 'diff' );
if ( $this->mTitle->getArticleId() && ( ! $diff ) && $wgUser->isAllowed('protect') ) {
if ( $this->mTitle->isProtected() ) {
- $t = wfMsg( 'unprotectthispage' );
- $q = 'action=unprotect';
+ $text = wfMsg( 'unprotectthispage' );
+ $query = array( 'action' => 'unprotect' );
} else {
- $t = wfMsg( 'protectthispage' );
- $q = 'action=protect';
+ $text = wfMsg( 'protectthispage' );
+ $query = array( 'action' => 'protect' );
}
- $s = $this->makeKnownLinkObj( $this->mTitle, $t, $q );
+
+ $s = $this->link(
+ $this->mTitle,
+ $text,
+ array(),
+ $query,
+ array( 'known', 'noclasses' )
+ );
} else {
$s = '';
}
if ( $wgOut->isArticleRelated() ) {
if ( $this->mTitle->userIsWatching() ) {
- $t = wfMsg( 'unwatchthispage' );
- $q = 'action=unwatch';
- $id = 'mw-unwatch-link' . $this->mWatchLinkNum;
+ $text = wfMsg( 'unwatchthispage' );
+ $query = array( 'action' => 'unwatch' );
+ $id = array( 'mw-unwatch-link' => $this->mWatchLinkNum );
} else {
- $t = wfMsg( 'watchthispage' );
- $q = 'action=watch';
- $id = 'mw-watch-link' . $this->mWatchLinkNum;
+ $text = wfMsg( 'watchthispage' );
+ $query = array( 'action' => 'watch' );
+ $id = array( 'mw-watch-link' => $this->mWatchLinkNum );
}
- $s = $this->makeKnownLinkObj( $this->mTitle, $t, $q, '', '', " id=\"$id\"" );
+
+ $s = $this->link(
+ $this->mTitle,
+ $text,
+ array( 'id' => $id ),
+ $query,
+ array( 'known', 'noclasses' )
+ );
} else {
$s = wfMsg( 'notanarticle' );
}
function moveThisPage() {
if ( $this->mTitle->quickUserCan( 'move' ) ) {
- return $this->makeKnownLinkObj( SpecialPage::getTitleFor( 'Movepage' ),
- wfMsg( 'movethispage' ), 'target=' . $this->mTitle->getPrefixedURL() );
+ return $this->link(
+ SpecialPage::getTitleFor( 'Movepage' ),
+ wfMsg( 'movethispage' ),
+ array(),
+ array( 'target' => $this->mTitle->getPrefixedURL() ),
+ array( 'known', 'noclasses' )
+ );
} else {
// no message if page is protected - would be redundant
return '';
}
function historyLink() {
- return $this->link( $this->mTitle, wfMsgHtml( 'history' ),
- array( 'rel' => 'archives' ), array( 'action' => 'history' ) );
+ return $this->link(
+ $this->mTitle,
+ wfMsgHtml( 'history' ),
+ array( 'rel' => 'archives' ),
+ array( 'action' => 'history' )
+ );
}
function whatLinksHere() {
- return $this->makeKnownLinkObj(
+ return $this->link(
SpecialPage::getTitleFor( 'Whatlinkshere', $this->mTitle->getPrefixedDBkey() ),
- wfMsgHtml( 'whatlinkshere' ) );
+ wfMsgHtml( 'whatlinkshere' ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ );
}
function userContribsLink() {
- return $this->makeKnownLinkObj(
+ return $this->link(
SpecialPage::getTitleFor( 'Contributions', $this->mTitle->getDBkey() ),
- wfMsgHtml( 'contributions' ) );
+ wfMsgHtml( 'contributions' ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ );
}
function showEmailUser( $id ) {
}
function emailUserLink() {
- return $this->makeKnownLinkObj(
+ return $this->link(
SpecialPage::getTitleFor( 'Emailuser', $this->mTitle->getDBkey() ),
- wfMsg( 'emailuser' ) );
+ wfMsg( 'emailuser' ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ );
}
function watchPageLinksLink() {
if ( ! $wgOut->isArticleRelated() ) {
return '(' . wfMsg( 'notanarticle' ) . ')';
} else {
- return $this->makeKnownLinkObj(
+ return $this->link(
SpecialPage::getTitleFor( 'Recentchangeslinked', $this->mTitle->getPrefixedDBkey() ),
- wfMsg( 'recentchangeslinked-toolbox' ) );
+ wfMsg( 'recentchangeslinked-toolbox' ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ );
}
}
}
# __NEWSECTIONLINK___ changes behaviour here
- # If it's present, the link points to this page, otherwise
+ # If it is present, the link points to this page, otherwise
# it points to the talk page
if( $this->mTitle->isTalkPage() ) {
$title = $this->mTitle;
$title = $this->mTitle->getTalkPage();
}
- return $this->makeKnownLinkObj( $title, wfMsg( 'postcomment' ), 'action=edit§ion=new' );
+ return $this->link(
+ $title,
+ wfMsg( 'postcomment' ),
+ array(),
+ array(
+ 'action' => 'edit',
+ 'section' => 'new'
+ ),
+ array( 'known', 'noclasses' )
+ );
}
/* these are used extensively in SkinTemplate, but also some other places */
} else {
$tpl->set( 'jsvarurl', false );
}
+
$newtalks = $wgUser->getNewMessageLinks();
if( count( $newtalks ) == 1 && $newtalks[0]['wiki'] === wfWikiID() ) {
$usertitle = $this->mUser->getUserPage();
$usertalktitle = $usertitle->getTalkPage();
+
if( !$usertalktitle->equals( $this->mTitle ) ) {
- $ntl = wfMsg( 'youhavenewmessages',
- $this->makeKnownLinkObj(
- $usertalktitle,
- wfMsgHtml( 'newmessageslink' ),
- 'redirect=no'
- ),
- $this->makeKnownLinkObj(
- $usertalktitle,
- wfMsgHtml( 'newmessagesdifflink' ),
- 'diff=cur'
- )
+ $newmessageslink = $this->link(
+ $usertalktitle,
+ wfMsgHtml( 'newmessageslink' ),
+ array(),
+ array( 'redirect' => 'no' ),
+ array( 'known', 'noclasses' )
+ );
+
+ $newmessagesdifflink = $this->link(
+ $usertalktitle,
+ wfMsgHtml( 'newmessagesdifflink' ),
+ array(),
+ array( 'diff' => 'cur' ),
+ array( 'known', 'noclasses' )
+ );
+
+ $ntl = wfMsg(
+ 'youhavenewmessages',
+ $newmessageslink,
+ $newmessagesdifflink
);
# Disable Cache
$out->setSquidMaxage( 0 );
if( ( $count = $this->showItemCount( $output, $user ) ) > 0 ) {
$self = SpecialPage::getTitleFor( 'Watchlist' );
$form = Xml::openElement( 'form', array( 'method' => 'post',
- 'action' => $self->getLocalUrl( 'action=edit' ) ) );
+ 'action' => $self->getLocalUrl( array( 'action' => 'edit' ) ) ) );
$form .= Xml::hidden( 'token', $wgUser->editToken( 'watchlistedit' ) );
$form .= "<fieldset>\n<legend>" . wfMsgHtml( 'watchlistedit-normal-legend' ) . "</legend>";
$form .= wfMsgExt( 'watchlistedit-normal-explain', 'parse' );
$link = '<span class="watchlistredir">' . $link . '</span>';
$tools[] = $skin->link( $title->getTalkPage(), wfMsgHtml( 'talkpagelinktext' ) );
if( $title->exists() ) {
- $tools[] = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'history_short' ), 'action=history' );
+ $tools[] = $skin->link(
+ $title,
+ wfMsgHtml( 'history_short' ),
+ array(),
+ array( 'action' => 'history' ),
+ array( 'known', 'noclasses' )
+ );
}
if( $title->getNamespace() == NS_USER && !$title->isSubpage() ) {
- $tools[] = $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Contributions', $title->getText() ), wfMsgHtml( 'contributions' ) );
+ $tools[] = $skin->link(
+ SpecialPage::getTitleFor( 'Contributions', $title->getText() ),
+ wfMsgHtml( 'contributions' ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ );
}
return "<li>"
. Xml::check( 'titles[]', false, array( 'value' => $title->getPrefixedText() ) )
$this->showItemCount( $output, $user );
$self = SpecialPage::getTitleFor( 'Watchlist' );
$form = Xml::openElement( 'form', array( 'method' => 'post',
- 'action' => $self->getLocalUrl( 'action=raw' ) ) );
+ 'action' => $self->getLocalUrl( array( 'action' => 'raw' ) ) ) );
$form .= Xml::hidden( 'token', $wgUser->editToken( 'watchlistedit' ) );
$form .= '<fieldset><legend>' . wfMsgHtml( 'watchlistedit-raw-legend' ) . '</legend>';
$form .= wfMsgExt( 'watchlistedit-raw-explain', 'parse' );
$tools = array();
$modes = array( 'view' => false, 'edit' => 'edit', 'raw' => 'raw' );
foreach( $modes as $mode => $subpage ) {
- $tools[] = $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Watchlist', $subpage ), wfMsgHtml( "watchlisttools-{$mode}" ) );
+ // can use messages 'watchlisttools-view', 'watchlisttools-edit', 'watchlisttools-raw'
+ $tools[] = $skin->link(
+ SpecialPage::getTitleFor( 'Watchlist', $subpage ),
+ wfMsgHtml( "watchlisttools-{$mode}" ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ );
}
return $wgLang->pipeList( $tools );
}
function makeKnownLinkHolder( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
list( $inside, $trail ) = Linker::splitTrail( $trail );
$sk = $this->mOptions->getSkin();
+ // FIXME: use link() instead of deprecated makeKnownLinkObj()
$link = $sk->makeKnownLinkObj( $nt, $text, $query, $inside, $prefix );
return $this->armorLinks( $link ) . $trail;
}
$s .= $this->bottomLinks();
$s .= $wgLang->pipeList( array(
- "\n<br />" . $this->makeKnownLinkObj( Title::newMainPage() ),
+ "\n<br />" . $this->link(
+ Title::newMainPage(),
+ null,
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ ),
$this->aboutLink(),
$this->searchForm( wfMsg( 'qbfind' ) )
) );
$s .= $this->menuHead( 'qbmyoptions' );
if ( $wgUser->isLoggedIn() ) {
$name = $wgUser->getName();
- $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
- wfMsg( 'mytalk' ) );
+ $tl = $this->link(
+ $wgUser->getTalkPage(),
+ wfMsg( 'mytalk' ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ );
if ( $wgUser->getNewtalk() ) {
$tl .= " *";
}
- $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(),
- wfMsg( 'mypage' ) )
+ $s .= $this->link(
+ $wgUser->getUserPage(),
+ wfMsg( 'mypage' ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ )
. $sep . $tl
. $sep . $this->specialLink( 'watchlist' )
- . $sep . $this->makeKnownLinkObj( SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ),
- wfMsg( 'mycontris' ) )
- . $sep . $this->specialLink( 'preferences' )
- . $sep . $this->specialLink( 'userlogout' );
+ . $sep . $this->link(
+ SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ),
+ wfMsg( 'mycontris' ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ )
+ . $sep . $this->specialLink( 'preferences' )
+ . $sep . $this->specialLink( 'userlogout' );
} else {
$s .= $this->specialLink( 'userlogin' );
}
if ( $wgUser->isLoggedIn() && $wgEnableUploads ) {
$s .= $sep . $this->specialLink( 'upload' );
}
+
global $wgSiteSupportPage;
+
if( $wgSiteSupportPage ) {
$s .= $sep . '<a href="' . htmlspecialchars( $wgSiteSupportPage ) . '" class="internal">'
. wfMsg( 'sitesupport' ) . '</a>';
}
- $s .= $sep . $this->makeKnownLinkObj(
+ $s .= $sep . $this->link(
SpecialPage::getTitleFor( 'Specialpages' ),
- wfMsg( 'moredotdotdot' ) );
+ wfMsg( 'moredotdotdot' ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ );
$s .= $sep . "\n</div>\n";
return $s;
# and to avoid messing with the separator that is prepended to the next item
$s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>';
}
-
}
# "Post a comment" link
if( ( $this->mTitle->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
- $s .= '<br />' . $this->makeKnownLinkObj( $this->mTitle, wfMsg( 'postcomment' ), 'action=edit§ion=new' );
-
+ $s .= '<br />' . $this->link(
+ $this->mTitle,
+ wfMsg( 'postcomment' ),
+ array(),
+ array(
+ 'action' => 'edit',
+ 'section' => 'new'
+ ),
+ array( 'known', 'noclasses' )
+ );
+
#if( $tns%2 && $action!='edit' && !$wpPreview) {
#$s.= '<br />'.$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg('postcomment'),'action=edit§ion=new');
#}
if (count($newtalks) == 1 && $newtalks[0]["wiki"] === $wgDBname) {
$usertitle = $this->getUserPageTitle();
$usertalktitle = $usertitle->getTalkPage();
+
if( !$usertalktitle->equals( $this->mTitle ) ) {
- $ntl = wfMsg( 'youhavenewmessages',
- $this->makeKnownLinkObj(
- $usertalktitle,
- wfMsgHtml( 'newmessageslink' ),
- 'redirect=no'
- ),
- $this->makeKnownLinkObj(
- $usertalktitle,
- wfMsgHtml( 'newmessagesdifflink' ),
- 'diff=cur'
- )
+ $newmessageslink = $this->link(
+ $usertalktitle,
+ wfMsgHtml( 'newmessageslink' ),
+ array(),
+ array( 'redirect' => 'no' ),
+ array( 'known', 'noclasses' )
+ );
+
+ $newmessagesdifflink = $this->link(
+ $usertalktitle,
+ wfMsgHtml( 'newmessagesdifflink' ),
+ array(),
+ array( 'diff' => 'cur' ),
+ array( 'known', 'noclasses' )
);
+
+ $ntl = wfMsg(
+ 'youhavenewmessages',
+ $newmessageslink,
+ $newmessagesdifflink
+ );
+
# Disable Cache
$this->mOut->setSquidMaxage(0);
}