* use array type parameter instead of string to escapeLocalUrl(), getFullURL() and getFullUrl() for readability
* some code readability and indentation improvements
Linking this to r51559 for CodeReview as there is some discussion there, and these changes are very similar.
$navText .= wfAllMessagesMakePhp( $messages );
$wgOut->addHTML( $wgLang->pipeList( array(
'PHP',
- '<a href="' . $title->escapeLocalUrl( 'ot=html' ) . '">HTML</a>',
- '<a href="' . $title->escapeLocalUrl( 'ot=xml' ) . '">XML</a>' .
+ '<a href="' . $title->escapeLocalUrl( array( 'ot' => 'html' ) ) . '">HTML</a>',
+ '<a href="' . $title->escapeLocalUrl( array( 'ot' => 'xml' ) ) . '">XML</a>' .
'<pre>' . htmlspecialchars( $navText ) . '</pre>'
) ) );
} else if ( $ot == 'xml' ) {
echo wfAllMessagesMakeXml( $messages );
} else {
$wgOut->addHTML( $wgLang->pipeList( array(
- '<a href="' . $title->escapeLocalUrl( 'ot=php' ) . '">PHP</a>',
+ '<a href="' . $title->escapeLocalUrl( array( 'ot' => 'php' ) ) . '">PHP</a>',
'HTML',
- '<a href="' . $title->escapeLocalUrl( 'ot=xml' ) . '">XML</a>'
+ '<a href="' . $title->escapeLocalUrl( array( 'ot' => 'xml' ) ) . '">XML</a>'
) ) );
$wgOut->addWikiText( $navText );
$wgOut->addHTML( wfAllMessagesMakeHTMLText( $messages ) );
$mw = htmlspecialchars( $m['msg'] );
if( array_key_exists( $title, $pageExists[NS_MEDIAWIKI] ) ) {
- $pageLink = $sk->makeKnownLinkObj( $titleObj, "<span id=\"sp-allmessages-i-$i\">" .
- htmlspecialchars( $key ) . '</span>' );
+ // FIXME: the span should be taken care of in $customAttribs, shouldn't it?
+ $pageLink = $sk->linkKnown(
+ $titleObj,
+ "<span id=\"sp-allmessages-i-$i\">" . htmlspecialchars( $key ) . '</span>'
+ );
} else {
$pageLink = $sk->makeBrokenLinkObj( $titleObj, "<span id=\"sp-allmessages-i-$i\">" .
htmlspecialchars( $key ) . '</span>' );
}
if( array_key_exists( $title, $pageExists[NS_MEDIAWIKI_TALK] ) ) {
- $talkLink = $sk->makeKnownLinkObj( $talkPage, htmlspecialchars( $talk ) );
+ $talkLink = $sk->linkKnown( $talkPage, htmlspecialchars( $talk ) );
} else {
$talkLink = $sk->makeBrokenLinkObj( $talkPage, htmlspecialchars( $talk ) );
}
* @param string $to dbKey we are ending listing at.
*/
function namespaceForm( $namespace = NS_MAIN, $from = '', $to = '' ) {
- global $wgScript;
- $t = $this->getTitle();
-
- $out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) );
- $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
- $out .= Xml::hidden( 'title', $t->getPrefixedText() );
- $out .= Xml::openElement( 'fieldset' );
- $out .= Xml::element( 'legend', null, wfMsg( 'allpages' ) );
- $out .= Xml::openElement( 'table', array( 'id' => 'nsselect', 'class' => 'allpages' ) );
- $out .= "<tr>
- <td class='mw-label'>" .
- Xml::label( wfMsg( 'allpagesfrom' ), 'nsfrom' ) .
- "</td>
- <td class='mw-input'>" .
- Xml::input( 'from', 30, str_replace('_',' ',$from), array( 'id' => 'nsfrom' ) ) .
- "</td>
- </tr>
- <tr>
- <td class='mw-label'>" .
- Xml::label( wfMsg( 'allpagesto' ), 'nsto' ) .
- "</td>
- <td class='mw-input'>" .
- Xml::input( 'to', 30, str_replace('_',' ',$to), array( 'id' => 'nsto' ) ) .
- "</td>
- </tr>
- <tr>
- <td class='mw-label'>" .
- Xml::label( wfMsg( 'namespace' ), 'namespace' ) .
- "</td>
- <td class='mw-input'>" .
- Xml::namespaceSelector( $namespace, null ) . ' ' .
- Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .
- "</td>
- </tr>";
- $out .= Xml::closeElement( 'table' );
- $out .= Xml::closeElement( 'fieldset' );
- $out .= Xml::closeElement( 'form' );
- $out .= Xml::closeElement( 'div' );
- return $out;
+ global $wgScript;
+ $t = $this->getTitle();
+
+ $out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) );
+ $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
+ $out .= Xml::hidden( 'title', $t->getPrefixedText() );
+ $out .= Xml::openElement( 'fieldset' );
+ $out .= Xml::element( 'legend', null, wfMsg( 'allpages' ) );
+ $out .= Xml::openElement( 'table', array( 'id' => 'nsselect', 'class' => 'allpages' ) );
+ $out .= "<tr>
+ <td class='mw-label'>" .
+ Xml::label( wfMsg( 'allpagesfrom' ), 'nsfrom' ) .
+ " </td>
+ <td class='mw-input'>" .
+ Xml::input( 'from', 30, str_replace('_',' ',$from), array( 'id' => 'nsfrom' ) ) .
+ " </td>
+</tr>
+<tr>
+ <td class='mw-label'>" .
+ Xml::label( wfMsg( 'allpagesto' ), 'nsto' ) .
+ " </td>
+ <td class='mw-input'>" .
+ Xml::input( 'to', 30, str_replace('_',' ',$to), array( 'id' => 'nsto' ) ) .
+ " </td>
+</tr>
+<tr>
+ <td class='mw-label'>" .
+ Xml::label( wfMsg( 'namespace' ), 'namespace' ) .
+ " </td>
+ <td class='mw-input'>" .
+ Xml::namespaceSelector( $namespace, null ) . ' ' .
+ Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .
+ " </td>
+</tr>";
+ $out .= Xml::closeElement( 'table' );
+ $out .= Xml::closeElement( 'fieldset' );
+ $out .= Xml::closeElement( 'form' );
+ $out .= Xml::closeElement( 'div' );
+ return $out;
}
/**
$t = Title::makeTitle( $s->page_namespace, $s->page_title );
if( $t ) {
$link = ( $s->page_is_redirect ? '<div class="allpagesredirect">' : '' ) .
- $sk->makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false ) .
+ $sk->linkKnown( $t, htmlspecialchars( $t->getText() ) ) .
($s->page_is_redirect ? '</div>' : '' );
} else {
$link = '[[' . htmlspecialchars( $s->page_title ) . ']]';
# Do we put a previous link ?
if( isset( $prevTitle ) && $pt = $prevTitle->getText() ) {
- $q = 'from=' . $prevTitle->getPartialUrl()
- . ( $namespace ? '&namespace=' . $namespace : '' );
- $prevLink = $sk->makeKnownLinkObj( $self,
- wfMsgHTML( 'prevpage', htmlspecialchars( $pt ) ), $q );
+ $query = array( 'from' => $prevTitle->getPartialUrl() );
+
+ if( $namespace )
+ $query['namespace'] = $namespace;
+
+ $prevLink = $sk->linkKnown(
+ $self,
+ wfMsgHTML( 'prevpage', htmlspecialchars( $pt ) ),
+ array(),
+ $query
+ );
$out2 = $wgLang->pipeList( array( $out2, $prevLink ) );
}
if( $n == $this->maxPerPage && $s = $res->fetchObject() ) {
# $s is the first link of the next chunk
$t = Title::MakeTitle($namespace, $s->page_title);
- $q = 'from=' . $t->getPartialUrl()
- . ( $namespace ? '&namespace=' . $namespace : '' );
- $nextLink = $sk->makeKnownLinkObj( $self,
- wfMsgHtml( 'nextpage', htmlspecialchars( $t->getText() ) ), $q );
+ $query = array( 'from' => $t->getPartialUrl() );
+
+ if( $namespace )
+ $query['namespace'] = $namespace;
+
+ $nextLink = $sk->linkKnown(
+ $self,
+ wfMsgHtml( 'nextpage', htmlspecialchars( $t->getText() ) ),
+ array(),
+ $query
+ );
$out2 = $wgLang->pipeList( array( $out2, $nextLink ) );
}
$out2 .= "</td></tr></table>";
$d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true );
$title = Title::makeTitle( $result->namespace, $result->title );
- $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
+ $link = $skin->linkKnown(
+ $title,
+ htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) )
+ );
return wfSpecialList($link, htmlspecialchars($d) );
}
}
*/
private function getUnblockLink( $skin ) {
$list = SpecialPage::getTitleFor( 'Ipblocklist' );
+ $query = array( 'action' => 'unblock' );
+
if( $this->BlockAddress ) {
$addr = htmlspecialchars( strtr( $this->BlockAddress, '_', ' ' ) );
- return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-unblock-addr', $addr ),
- 'action=unblock&ip=' . urlencode( $this->BlockAddress ) );
+ $message = wfMsgHtml( 'ipb-unblock-addr', $addr );
+ $query['ip'] = $this->BlockAddress;
} else {
- return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-unblock' ), 'action=unblock' );
+ $message = wfMsgHtml( 'ipb-unblock' );
}
+ return $skin->linkKnown(
+ $list,
+ $message,
+ array(),
+ $query
+ );
}
/**
*/
private function getBlockListLink( $skin ) {
$list = SpecialPage::getTitleFor( 'Ipblocklist' );
+ $query = array();
+
if( $this->BlockAddress ) {
$addr = htmlspecialchars( strtr( $this->BlockAddress, '_', ' ' ) );
- return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-blocklist-addr', $addr ),
- 'ip=' . urlencode( $this->BlockAddress ) );
+ $message = wfMsgHtml( 'ipb-blocklist-addr', $addr );
+ $query['ip'] = $this->BlockAddress;
} else {
- return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-blocklist' ) );
+ $message = wfMsgHtml( 'ipb-blocklist' );
}
+
+ return $skin->linkKnown(
+ $list,
+ $message,
+ array(),
+ $query
+ );
}
/**
return '<s>' . $skin->link( $fromObj ) . '</s>';
}
- $from = $skin->makeKnownLinkObj( $fromObj ,'', 'redirect=no' );
- $edit = $skin->makeKnownLinkObj( $fromObj, wfMsgHtml( 'brokenredirects-edit' ), 'action=edit' );
+ $from = $skin->linkKnown(
+ $fromObj,
+ null,
+ array(),
+ array( 'redirect' => 'no' )
+ );
+ $edit = $skin->linkKnown(
+ $fromObj,
+ wfMsgHtml( 'brokenredirects-edit' ),
+ array(),
+ array( 'action' => 'edit' )
+ );
$to = $skin->makeBrokenLinkObj( $toObj );
$arr = $wgContLang->getArrow();
$out = "{$from} {$edit}";
if( $wgUser->isAllowed( 'delete' ) ) {
- $delete = $skin->makeKnownLinkObj( $fromObj, wfMsgHtml( 'brokenredirects-delete' ), 'action=delete' );
+ $delete = $skin->linkKnown(
+ $fromObj,
+ wfMsgHtml( 'brokenredirects-delete' ),
+ array(),
+ array( 'action' => 'delete' )
+ );
$out .= " {$delete}";
}
} else {
$title = SpecialPage::getTitleFor( 'Userlogin' );
$skin = $wgUser->getSkin();
- $llink = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'loginreqlink' ),
- 'returnto=' . $this->getTitle()->getPrefixedUrl() );
+ $llink = $skin->linkKnown(
+ $title,
+ wfMsgHtml( 'loginreqlink' ),
+ array(),
+ array( 'returnto' => $this->getTitle()->getPrefixedUrl() )
+ );
$wgOut->addHTML( wfMsgWikiHtml( 'confirmemail_needlogin', $llink ) );
}
} else {
if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && IP::isIPAddress( $nt->getText() ) ) ) {
# Block link
if( $wgUser->isAllowed( 'block' ) )
- $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Blockip',
- $nt->getDBkey() ), wfMsgHtml( 'blocklink' ) );
+ $tools[] = $sk->linkKnown(
+ SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ),
+ wfMsgHtml( 'blocklink' )
+ );
# Block log link
- $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ),
- wfMsgHtml( 'sp-contributions-blocklog' ), 'type=block&page=' . $nt->getPrefixedUrl() );
+ $tools[] = $sk->linkKnown(
+ SpecialPage::getTitleFor( 'Log' ),
+ wfMsgHtml( 'sp-contributions-blocklog' ),
+ array(),
+ array(
+ 'type' => 'block',
+ 'page' => $nt->getPrefixedUrl()
+ )
+ );
}
# Other logs link
- $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), wfMsg( 'sp-contributions-logs' ),
- 'user=' . $nt->getPartialUrl() );
+ $tools[] = $sk->linkKnown(
+ SpecialPage::getTitleFor( 'Log' ),
+ wfMsg( 'sp-contributions-logs' ),
+ array(),
+ array( 'user' => $nt->getPartialUrl() )
+ );
# Add link to deleted user contributions for priviledged users
if( $wgUser->isAllowed( 'deletedhistory' ) ) {
- $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'DeletedContributions',
- $nt->getDBkey() ), wfMsgHtml( 'sp-contributions-deleted' ) );
+ $tools[] = $sk->linkKnown(
+ SpecialPage::getTitleFor( 'DeletedContributions', $nt->getDBkey() ),
+ wfMsgHtml( 'sp-contributions-deleted' )
+ );
}
# Add a link to change user rights for privileged users
$userrightsPage = new UserrightsPage();
if( 0 !== $id && $userrightsPage->userCanChangeRights( User::newFromId( $id ) ) ) {
- $tools[] = $sk->makeKnownLinkObj(
+ $tools[] = $sk->linkKnown(
SpecialPage::getTitleFor( 'Userrights', $nt->getDBkey() ),
wfMsgHtml( 'sp-contributions-userrights' )
);
if( $row->rev_id == $row->page_latest ) {
$topmarktext .= '<span class="mw-uctop">' . $this->messages['uctop'] . '</span>';
if( !$row->page_is_new ) {
- $difftext .= '(' . $sk->makeKnownLinkObj( $page, $this->messages['diff'], 'diff=0' ) . ')';
+ $difftext .= '(' . $sk->linkKnown(
+ $page,
+ $this->messages['diff'],
+ array(),
+ array( 'diff' => 0 )
+ ) . ')';
# Add rollback link
if( $page->quickUserCan( 'rollback') && $page->quickUserCan( 'edit' ) ) {
$topmarktext .= ' '.$sk->generateRollback( $rev );
}
# Is there a visible previous revision?
if( $rev->userCan(Revision::DELETED_TEXT) ) {
- $difftext = '(' . $sk->makeKnownLinkObj( $page, $this->messages['diff'],
- 'diff=prev&oldid='.$row->rev_id ) . ')';
+ $difftext = '(' . $sk->linkKnown(
+ $page,
+ $this->messages['diff'],
+ array(),
+ array(
+ 'diff' => 'prev',
+ 'oldid' => $row->rev_id
+ )
+ ) . ')';
} else {
$difftext = '(' . $this->messages['diff'] . ')';
}
- $histlink = '('.$sk->makeKnownLinkObj( $page, $this->messages['hist'], 'action=history' ) . ')';
+ $histlink = '('.$sk->linkKnown(
+ $page,
+ $this->messages['hist'],
+ array(),
+ array( 'action' => 'history' )
+ ) . ')';
$comment = $wgContLang->getDirMark() . $sk->revComment( $rev, false, true );
$date = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true );
- $d = $sk->makeKnownLinkObj( $page, htmlspecialchars($date), 'oldid='.intval($row->rev_id) );
+ $d = $sk->linkKnown(
+ $page,
+ htmlspecialchars($date),
+ array(),
+ array( 'oldid' => intval( $row->rev_id ) )
+ );
if( $this->target == 'newbies' ) {
$userlink = ' . . ' . $sk->userLink( $row->rev_user, $row->rev_user_text );
$undelete = SpecialPage::getTitleFor( 'Undelete' );
$logs = SpecialPage::getTitleFor( 'Log' );
- $dellog = $sk->makeKnownLinkObj( $logs,
+ $dellog = $sk->linkKnown(
+ $logs,
$this->messages['deletionlog'],
- 'type=delete&page=' . $page->getPrefixedUrl() );
+ array(),
+ array(
+ 'type' => 'delete',
+ 'page' => $page->getPrefixedUrl()
+ )
+ );
- $reviewlink = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Undelete', $page->getPrefixedDBkey() ),
- $this->messages['undeletebtn'] );
+ $reviewlink = $sk->linkKnown(
+ SpecialPage::getTitleFor( 'Undelete', $page->getPrefixedDBkey() ),
+ $this->messages['undeletebtn']
+ );
- $link = $sk->makeKnownLinkObj( $undelete,
+ $link = $sk->linkKnown(
+ $undelete,
htmlspecialchars( $page->getPrefixedText() ),
- 'target=' . $page->getPrefixedUrl() .
- '×tamp=' . $rev->getTimestamp() );
+ array(),
+ array(
+ 'target' => $page->getPrefixedUrl(),
+ 'timestamp' => $rev->getTimestamp()
+ )
+ );
- $last = $sk->makeKnownLinkObj( $undelete,
+ $last = $sk->linkKnown(
+ $undelete,
$this->messages['diff'],
- "target=" . $page->getPrefixedUrl() .
- "×tamp=" . $rev->getTimestamp() .
- "&diff=prev" );
+ array(),
+ array(
+ 'target' => $page->getPrefixedUrl(),
+ 'timestamp' => $rev->getTimestamp(),
+ 'diff' => 'prev'
+ )
+ );
$comment = $sk->revComment( $rev );
$d = htmlspecialchars( $wgLang->timeanddate( $rev->getTimestamp(), true ) );
if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
$d = '<span class="history-deleted">' . $d . '</span>';
} else {
- $link = $sk->makeKnownLinkObj( $undelete, $d,
- 'target=' . $page->getPrefixedUrl() .
- '×tamp=' . $rev->getTimestamp() );
+ $link = $sk->linkKnown(
+ $undelete,
+ $d,
+ array(),
+ array(
+ 'target' => $page->getPrefixedUrl(),
+ 'timestamp' => $rev->getTimestamp()
+ )
+ );
}
$pagelink = $sk->link( $page );
if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && User::isIP( $nt->getText() ) ) ) {
# Block link
if( $wgUser->isAllowed( 'block' ) )
- $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ),
- wfMsgHtml( 'blocklink' ) );
+ $tools[] = $sk->linkKnown(
+ SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ),
+ wfMsgHtml( 'blocklink' )
+ );
# Block log link
- $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ),
- wfMsgHtml( 'sp-contributions-blocklog' ), 'type=block&page=' . $nt->getPrefixedUrl() );
+ $tools[] = $sk->linkKnown(
+ SpecialPage::getTitleFor( 'Log' ),
+ wfMsgHtml( 'sp-contributions-blocklog' ),
+ array(),
+ array(
+ 'type' => 'block',
+ 'page' => $nt->getPrefixedUrl()
+ )
+ );
}
# Other logs link
- $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ),
- wfMsgHtml( 'sp-contributions-logs' ), 'user=' . $nt->getPartialUrl() );
+ $tools[] = $sk->linkKnown(
+ SpecialPage::getTitleFor( 'Log' ),
+ wfMsgHtml( 'sp-contributions-logs' ),
+ array(),
+ array( 'user' => $nt->getPartialUrl() )
+ );
# Link to undeleted contributions
- $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Contributions', $nt->getDBkey() ),
- wfMsgHtml( 'contributions' ) );
-
+ $tools[] = $sk->linkKnown(
+ SpecialPage::getTitleFor( 'Contributions', $nt->getDBkey() ),
+ wfMsgHtml( 'contributions' )
+ );
+
wfRunHooks( 'ContributionsToolLinks', array( $id, $nt, &$tools ) );
$links = $wgLang->pipeList( $tools );
$titleB = Title::makeTitle( $result->nsb, $result->tb );
$titleC = Title::makeTitle( $result->nsc, $result->tc );
- $linkA = $skin->makeKnownLinkObj( $titleA, '', 'redirect=no' );
+ $linkA = $skin->linkKnown(
+ $titleA,
+ null,
+ array(),
+ array( 'redirect' => 'no' )
+ );
$edit = $skin->makeBrokenLinkObj( $titleA, "(".wfMsgHtml("qbedit").")" , 'redirect=no');
- $linkB = $skin->makeKnownLinkObj( $titleB, '', 'redirect=no' );
- $linkC = $skin->makeKnownLinkObj( $titleC );
+ $linkB = $skin->linkKnown(
+ $titleB,
+ null,
+ array(),
+ array( 'redirect' => 'no' )
+ );
+ $linkC = $skin->linkKnown( $titleC );
$arr = $wgContLang->getArrow() . $wgContLang->getDirMark();
return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
$nt = Title::makeTitleSafe( $result->namespace, $result->title );
$text = $wgContLang->convert( $nt->getPrefixedText() );
- $plink = $skin->makeKnownLinkObj( $nt, $text );
+ $plink = $skin->linkKnown(
+ $nt,
+ $text
+ );
$nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape' ),
$wgLang->formatNum( $result->value ) );
$redirect = $result->redirect ? ' - ' . wfMsgHtml( 'isredirect' ) : '';
- $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' ) . $redirect;
-
+ $nlink = $skin->linkKnown(
+ $nt,
+ $nl,
+ array(),
+ array( 'action' => 'history' )
+ ) . $redirect;
return wfSpecialList( $plink, $nlink );
}
if( !$wgUser->isAllowed( 'import' ) && !$wgUser->isAllowed( 'importupload' ) )
return $wgOut->permissionRequired( 'import' );
- $action = $this->getTitle()->getLocalUrl( 'action=submit' );
+ $action = $this->getTitle()->getLocalUrl( array( 'action' => 'submit' ) );
if( $wgUser->isAllowed( 'importupload' ) ) {
$wgOut->addWikiMsg( "importtext" );
* @ingroup SpecialPage
*/
class ImportReporter {
- private $reason=false;
+ private $reason=false;
function __construct( $importer, $upload, $interwiki , $reason=false ) {
$importer->setPageOutCallback( array( $this, 'reportPage' ) );
$contentCount = $wgContLang->formatNum( $successCount );
if( $successCount > 0 ) {
- $wgOut->addHTML( "<li>" . $skin->makeKnownLinkObj( $title ) . " " .
+ $wgOut->addHTML( "<li>" . $skin->linkKnown( $title ) . " " .
wfMsgExt( 'import-revision-count', array( 'parsemag', 'escape' ), $localCount ) .
"</li>\n"
);
$detail = wfMsgExt( 'import-logentry-upload-detail', array( 'content', 'parsemag' ),
$contentCount );
if ( $this->reason ) {
- $detail .= wfMsgForContent( 'colon-separator' ) . $this->reason;
+ $detail .= wfMsgForContent( 'colon-separator' ) . $this->reason;
}
$log->addEntry( 'upload', $title, $detail );
} else {
$detail = wfMsgExt( 'import-logentry-interwiki-detail', array( 'content', 'parsemag' ),
$contentCount, $interwiki );
if ( $this->reason ) {
- $detail .= wfMsgForContent( 'colon-separator' ) . $this->reason;
+ $detail .= wfMsgForContent( 'colon-separator' ) . $this->reason;
}
$log->addEntry( 'interwiki', $title, $detail );
}
function formatResult( $skin, $result ) {
$title = Title::makeTitle( $result->namespace, $result->title );
$url = $result->url;
- $pageLink = $skin->makeKnownLinkObj( $title );
+ $pageLink = $skin->linkKnown( $title );
$urlLink = $skin->makeExternalLink( $url, $url );
return wfMsgHtml( 'linksearch-line', $urlLink, $pageLink );
if ( $imgfile === null ) $imgfile = wfMsg( 'imgfile' );
$name = $this->mCurrentRow->img_name;
- $link = $this->getSkin()->makeKnownLinkObj( Title::makeTitle( NS_FILE, $name ), $value );
+ $link = $this->getSkin()->linkKnown( Title::makeTitle( NS_FILE, $name ), $value );
$image = wfLocalFile( $value );
$url = $image->getURL();
$download = Xml::element('a', array( 'href' => $url ), $imgfile );
$haveRevisions = $revisions && $revisions->getNumRows() > 0;
$titleObj = SpecialPage::getTitleFor( "Mergehistory" );
- $action = $titleObj->getLocalURL( "action=submit" );
+ $action = $titleObj->getLocalURL( array( 'action' => 'submit' ) );
# Start the form here
$top = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'merge' ) );
$wgOut->addHTML( $top );
$ts = wfTimestamp( TS_MW, $row->rev_timestamp );
$checkBox = Xml::radio( "mergepoint", $ts, false );
- $pageLink = $this->sk->makeKnownLinkObj( $rev->getTitle(),
- htmlspecialchars( $wgLang->timeanddate( $ts ) ), 'oldid=' . $rev->getId() );
+ $pageLink = $this->sk->linkKnown(
+ $rev->getTitle(),
+ htmlspecialchars( $wgLang->timeanddate( $ts ) ),
+ array(),
+ array( 'oldid' => $rev->getId() )
+ );
if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
$pageLink = '<span class="history-deleted">' . $pageLink . '</span>';
}
if( !$rev->userCan( Revision::DELETED_TEXT ) )
$last = $this->message['last'];
else if( isset($this->prevId[$row->rev_id]) )
- $last = $this->sk->makeKnownLinkObj( $rev->getTitle(), $this->message['last'],
- "diff=" . $row->rev_id . "&oldid=" . $this->prevId[$row->rev_id] );
+ $last = $this->sk->linkKnown(
+ $rev->getTitle(),
+ $this->message['last'],
+ array(),
+ array(
+ 'diff' => $row->rev_id,
+ 'oldid' => $this->prevId[$row->rev_id]
+ )
+ );
$userLink = $this->sk->revUserTools( $rev );
if( !$this->userCan($row, Revision::DELETED_TEXT) ) {
return '<span class="history-deleted">' . $wgLang->timeanddate( $ts, true ) . '</span>';
} else {
- $link = $this->sk->makeKnownLinkObj( $titleObj,
- $wgLang->timeanddate( $ts, true ), "target=$target×tamp=$ts" );
+ $link = $this->sk->linkKnown(
+ $titleObj,
+ $wgLang->timeanddate( $ts, true ),
+ array(),
+ array(
+ 'target' => $target,
+ 'timestamp' => $ts
+ )
+ );
if( $this->isDeleted($row, Revision::DELETED_TEXT) )
$link = '<span class="history-deleted">' . $link . '</span>';
return $link;
*/
function makeWlhLink( &$title, $caption, &$skin ) {
$wlh = SpecialPage::getTitleFor( 'Whatlinkshere', $title->getPrefixedDBkey() );
- return $skin->makeKnownLinkObj( $wlh, $caption );
+ return $skin->linkKnown( $wlh, $caption );
}
/**
$nt = Title::makeTitle( $result->namespace, $result->title );
$text = $wgContLang->convert( $nt->getPrefixedText() );
- $plink = $skin->makeKnownLinkObj( $nt, $text );
+ $plink = $skin->linkKnown( $nt, $text );
$nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape'),
$wgLang->formatNum( $result->value ) );
- $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' );
+ $nlink = $skin->linkKnown(
+ $nt,
+ $nl,
+ array(),
+ array( 'action' => 'history' )
+ );
return wfSpecialList($plink, $nlink);
}
# be longer than 255 characters.
$newSubpage = Title::makeTitleSafe( $newNs, $newPageName );
if( !$newSubpage ) {
- $oldLink = $skin->makeKnownLinkObj( $oldSubpage );
+ $oldLink = $skin->linkKnown( $oldSubpage );
$extraOutput []= wfMsgHtml( 'movepage-page-unmoved', $oldLink,
htmlspecialchars(Title::makeName( $newNs, $newPageName )));
continue;
# This was copy-pasted from Renameuser, bleh.
if ( $newSubpage->exists() && !$oldSubpage->isValidMoveTarget( $newSubpage ) ) {
- $link = $skin->makeKnownLinkObj( $newSubpage );
+ $link = $skin->linkKnown( $newSubpage );
$extraOutput []= wfMsgHtml( 'movepage-page-exists', $link );
} else {
$success = $oldSubpage->moveTo( $newSubpage, true, $this->reason, $createRedirect );
if ( $this->fixRedirects ) {
DoubleRedirectJob::fixRedirects( 'move', $oldSubpage, $newSubpage );
}
- $oldLink = $skin->makeKnownLinkObj( $oldSubpage, '', 'redirect=no' );
- $newLink = $skin->makeKnownLinkObj( $newSubpage );
+ $oldLink = $skin->linkKnown(
+ $oldSubpage,
+ null,
+ array(),
+ array( 'redirect' => 'no' )
+ );
+ $newLink = $skin->linkKnown( $newSubpage );
$extraOutput []= wfMsgHtml( 'movepage-page-moved', $oldLink, $newLink );
} else {
- $oldLink = $skin->makeKnownLinkObj( $oldSubpage );
+ $oldLink = $skin->linkKnown( $oldSubpage );
$newLink = $skin->link( $newSubpage );
$extraOutput []= wfMsgHtml( 'movepage-page-unmoved', $oldLink, $newLink );
}
$title = Title::makeTitleSafe( $result->rc_namespace, $result->rc_title );
$time = htmlspecialchars( $wgLang->timeAndDate( $result->rc_timestamp, true ) );
- $query = $this->patrollable( $result ) ? "rcid={$result->rc_id}&redirect=no" : 'redirect=no';
- $plink = $this->skin->makeKnownLinkObj( $title, '', $query );
- $hist = $this->skin->makeKnownLinkObj( $title, wfMsgHtml( 'hist' ), 'action=history' );
+
+ $query = array( 'redirect' => 'no' );
+
+ if( $this->patrollable( $result ) )
+ $query['rcid'] = $result->rc_id;
+
+ $plink = $this->skin->linkKnown(
+ $title,
+ null,
+ array(),
+ $query
+ );
+ $hist = $this->skin->linkKnown(
+ $title,
+ wfMsgHtml( 'hist' ),
+ array(),
+ array( 'action' => 'history' )
+ );
$length = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ),
$wgLang->formatNum( $result->length ) );
$ulink = $this->skin->userLink( $result->rc_user, $result->rc_user_text ) . ' ' .
function formatResult( $skin, $result ) {
global $wgLang, $wgContLang;
$title = Title::makeTitle( $result->namespace, $result->title );
- $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
- $nv = wfMsgExt( 'nviews', array( 'parsemag', 'escape'),
- $wgLang->formatNum( $result->value ) );
+ $link = $skin->linkKnown(
+ $title,
+ htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) )
+ );
+ $nv = wfMsgExt(
+ 'nviews',
+ array( 'parsemag', 'escape'),
+ $wgLang->formatNum( $result->value )
+ );
return wfSpecialList($link, $nv);
}
}
$t = Title::makeTitle( $s->page_namespace, $s->page_title );
if( $t ) {
$link = ($s->page_is_redirect ? '<div class="allpagesredirect">' : '' ) .
- $sk->makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false ) .
+ $sk->linkKnown(
+ $t,
+ htmlspecialchars( $t->getText() )
+ ) .
($s->page_is_redirect ? '</div>' : '' );
} else {
$link = '[[' . htmlspecialchars( $s->page_title ) . ']]';
$nsForm .
'</td>
<td id="mw-prefixindex-nav-form">' .
- $sk->makeKnownLinkObj( $self, wfMsgHtml( 'allpages' ) );
+ $sk->linkKnown( $self, wfMsgHtml( 'allpages' ) );
if( isset( $res ) && $res && ( $n == $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
- $namespaceparam = $namespace ? "&namespace=$namespace" : "";
+ $query = array(
+ 'from' => $s->page_title,
+ 'prefix' => $prefix
+ );
+
+ if( $namespace ) {
+ $query['namespace'] = $namespace;
+ }
+
$out2 = $wgLang->pipeList( array(
$out2,
- $sk->makeKnownLinkObj(
+ $sk->linkKnown(
$self,
wfMsgHtml( 'nextpage', str_replace( '_',' ', htmlspecialchars( $s->page_title ) ) ),
- "from=" . wfUrlEncode( $s->page_title ) .
- "&prefix=" . wfUrlEncode( $prefix ) . $namespaceparam )
+ array(),
+ $query
+ )
) );
}
$out2 .= "</td></tr>" .
# Show a link to the change protection form for allowed users otherwise a link to the protection log
if( $wgUser->isAllowed( 'protect' ) ) {
- $changeProtection = ' (' . $skin->makeKnownLinkObj( $title, wfMsgHtml( 'protect_change' ),
- 'action=unprotect' ) . ')';
+ $changeProtection = ' (' . $skin->linkKnown(
+ $title,
+ wfMsgHtml( 'protect_change' ),
+ array(),
+ array( 'action' => 'unprotect' )
+ ) . ')';
} else {
$ltitle = SpecialPage::getTitleFor( 'Log' );
- $changeProtection = ' (' . $skin->makeKnownLinkObj( $ltitle, wfMsgHtml( 'protectlogpage' ),
- 'type=protect&page=' . $title->getPrefixedUrl() ) . ')';
+ $changeProtection = ' (' . $skin->linkKnown(
+ $ltitle,
+ wfMsgHtml( 'protectlogpage' ),
+ array(),
+ array(
+ 'type' => 'protect',
+ 'page' => $title->getPrefixedUrl()
+ )
+ ) . ')';
}
wfProfileOut( __METHOD__ );
// First pass to load the log names
foreach( $wgRestrictionLevels as $type ) {
+ // Messages used can be 'restriction-level-sysop' and 'restriction-level-autoconfirmed'
if( $type !='' && $type !='*') {
$text = wfMsg("restriction-level-$type");
$m[$text] = $type;
if( $this->targetObj ) {
$links = array();
$logtitle = SpecialPage::getTitleFor( 'Log' );
- $links[] = $this->skin->makeKnownLinkObj( $logtitle, wfMsgHtml( 'viewpagelogs' ),
- wfArrayToCGI( array( 'page' => $this->targetObj->getPrefixedUrl() ) ) );
+ $links[] = $this->skin->linkKnown(
+ $logtitle,
+ wfMsgHtml( 'viewpagelogs' ),
+ array(),
+ array( 'page' => $this->targetObj->getPrefixedUrl() )
+ );
# Give a link to the page history
- $links[] = $this->skin->makeKnownLinkObj( $this->targetObj, wfMsgHtml( 'pagehist' ),
- wfArrayToCGI( array( 'action' => 'history' ) ) );
+ $links[] = $this->skin->linkKnown(
+ $this->targetObj,
+ wfMsgHtml( 'pagehist' ),
+ array(),
+ array( 'action' => 'history' )
+ );
# Link to deleted edits
if( $wgUser->isAllowed('undelete') ) {
$undelete = SpecialPage::getTitleFor( 'Undelete' );
- $links[] = $this->skin->makeKnownLinkObj( $undelete, wfMsgHtml( 'deletedhist' ),
- wfArrayToCGI( array( 'target' => $this->targetObj->getPrefixedDBkey() ) ) );
+ $links[] = $this->skin->linkKnown(
+ $undelete,
+ wfMsgHtml( 'deletedhist' ),
+ array(),
+ array( 'target' => $this->targetObj->getPrefixedDBkey() )
+ );
}
# Logs themselves don't have histories or archived revisions
$wgOut->setSubtitle( '<p>'.implode($links,' / ').'</p>' );
wfRunHooks( 'SpecialSearchNogomatch', array( &$t ) );
# If the feature is enabled, go straight to the edit page
if( $wgGoToEdit ) {
- $wgOut->redirect( $t->getFullURL( 'action=edit' ) );
+ $wgOut->redirect( $t->getFullURL( array( 'action' => 'edit' ) ) );
return;
}
}
// did you mean... suggestions
if( $textMatches && $textMatches->hasSuggestion() ) {
$st = SpecialPage::getTitleFor( 'Search' );
+
# mirror Go/Search behaviour of original request ..
$didYouMeanParams = array( 'search' => $textMatches->getSuggestionQuery() );
+
if($this->fulltext != NULL)
$didYouMeanParams['fulltext'] = $this->fulltext;
- $stParams = wfArrayToCGI(
+
+ $stParams = array_merge(
$didYouMeanParams,
$this->powerSearchOptions()
);
- $suggestLink = $sk->makeKnownLinkObj( $st,
+
+ $suggestLink = $sk->linkKnown(
+ $st,
$textMatches->getSuggestionSnippet(),
- $stParams );
+ array(),
+ $stParams
+ );
$this->didYouMeanHtml = '<div class="searchdidyoumean">'.wfMsg('search-suggest',$suggestLink).'</div>';
}
$sk = $wgUser->getSkin();
$t = $result->getTitle();
- $link = $this->sk->makeKnownLinkObj( $t, $result->getTitleSnippet($terms));
+ $link = $this->sk->linkKnown(
+ $t,
+ $result->getTitleSnippet($terms)
+ );
//If page content is not readable, just return the title.
//This is not quite safe, but better than showing excerpts from non-readable pages
$sectionTitle = $result->getSectionTitle();
$sectionText = $result->getSectionSnippet($terms);
$redirect = '';
+
if( !is_null($redirectTitle) )
- $redirect = "<span class='searchalttitle'>"
- .wfMsg('search-redirect',$this->sk->makeKnownLinkObj( $redirectTitle, $redirectText))
- ."</span>";
+ $redirect = "<span class='searchalttitle'>" .
+ wfMsg(
+ 'search-redirect',
+ $this->sk->linkKnown(
+ $redirectTitle,
+ $redirectText
+ )
+ ) .
+ "</span>";
+
$section = '';
+
if( !is_null($sectionTitle) )
- $section = "<span class='searchalttitle'>"
- .wfMsg('search-section', $this->sk->makeKnownLinkObj( $sectionTitle, $sectionText))
- ."</span>";
+ $section = "<span class='searchalttitle'>" .
+ wfMsg(
+ 'search-section', $this->sk->linkKnown(
+ $sectionTitle,
+ $sectionText
+ )
+ ) .
+ "</span>";
// format text extract
$extract = "<div class='searchresult'>".$result->getTextSnippet($terms)."</div>";
$byteSize = $result->getByteSize();
$wordCount = $result->getWordCount();
$timestamp = $result->getTimestamp();
- $size = wfMsgExt( 'search-result-size', array( 'parsemag', 'escape' ),
- $this->sk->formatSize( $byteSize ), $wordCount );
+ $size = wfMsgExt(
+ 'search-result-size',
+ array( 'parsemag', 'escape' ),
+ $this->sk->formatSize( $byteSize ),
+ $wordCount
+ );
$date = $wgLang->timeanddate( $timestamp );
// link to related articles if supported
$related = '';
if( $result->hasRelated() ) {
$st = SpecialPage::getTitleFor( 'Search' );
- $stParams = wfArrayToCGI( $this->powerSearchOptions(),
- array('search' => wfMsgForContent('searchrelated').':'.$t->getPrefixedText(),
- 'fulltext' => wfMsg('search') ));
+ $stParams = array_merge(
+ $this->powerSearchOptions(),
+ array(
+ 'search' => wfMsgForContent( 'searchrelated' ) . ':' . $t->getPrefixedText(),
+ 'fulltext' => wfMsg( 'search' )
+ )
+ );
- $related = ' -- ' . $sk->makeKnownLinkObj( $st,
- wfMsg('search-relatedarticle'), $stParams );
+ $related = ' -- ' . $sk->linkKnown(
+ $st,
+ wfMsg('search-relatedarticle'),
+ array(),
+ $stParams
+ );
}
// Include a thumbnail for media files...
$t = $result->getTitle();
- $link = $this->sk->makeKnownLinkObj( $t, $result->getTitleSnippet($terms));
+ $link = $this->sk->linkKnown(
+ $t,
+ $result->getTitleSnippet($terms)
+ );
// format redirect if any
$redirectTitle = $result->getRedirectTitle();
$redirectText = $result->getRedirectSnippet($terms);
$redirect = '';
if( !is_null($redirectTitle) )
- $redirect = "<span class='searchalttitle'>"
- .wfMsg('search-redirect',$this->sk->makeKnownLinkObj( $redirectTitle, $redirectText))
- ."</span>";
+ $redirect = "<span class='searchalttitle'>" .
+ wfMsg(
+ 'search-redirect',
+ $this->sk->linkKnown(
+ $redirectTitle,
+ $redirectText
+ )
+ ) .
+ "</span>";
$out = "";
// display project name
}
// "more results" link (special page stuff could be localized, but we might not know target lang)
$searchTitle = Title::newFromText($t->getInterwiki().":Special:Search");
- $searchLink = $this->sk->makeKnownLinkObj( $searchTitle, wfMsg('search-interwiki-more'),
- wfArrayToCGI(array('search' => $query, 'fulltext' => 'Search')));
+ $searchLink = $this->sk->linkKnown(
+ $searchTitle,
+ wfMsg('search-interwiki-more'),
+ array(),
+ array(
+ 'search' => $query,
+ 'fulltext' => 'Search'
+ )
+ );
$out .= "</ul><div class='mw-search-interwiki-project'><span class='mw-search-interwiki-more'>
{$searchLink}</span>{$caption}</div>\n<ul>";
}
$opt['redirs'] = $this->searchRedirects ? 1 : 0;
$st = SpecialPage::getTitleFor( 'Search' );
- $stParams = wfArrayToCGI( array( 'search' => $term, 'fulltext' => wfMsg( 'search' ) ), $opt );
+ $stParams = array_merge(
+ array(
+ 'search' => $term,
+ 'fulltext' => wfMsg( 'search' )
+ ),
+ $opt
+ );
- return Xml::element( 'a',
- array( 'href'=> $st->getLocalURL( $stParams ), 'title' => $tooltip,
- 'onmousedown' => 'mwSearchHeaderClick(this);',
- 'onkeydown' => 'mwSearchHeaderClick(this);'),
- $label );
+ return Xml::element(
+ 'a',
+ array(
+ 'href' => $st->getLocalURL( $stParams ),
+ 'title' => $tooltip,
+ 'onmousedown' => 'mwSearchHeaderClick(this);',
+ 'onkeydown' => 'mwSearchHeaderClick(this);'),
+ $label
+ );
}
/** Check if query starts with image: prefix */
wfRunHooks( 'SpecialSearchNogomatch', array( &$t ) );
# If the feature is enabled, go straight to the edit page
if ( $wgGoToEdit ) {
- $wgOut->redirect( $t->getFullURL( 'action=edit' ) );
+ $wgOut->redirect( $t->getFullURL( array( 'action' => 'edit' ) ) );
return;
}
}
$didYouMeanParams = array( 'search' => $textMatches->getSuggestionQuery() );
if($this->fulltext != NULL)
$didYouMeanParams['fulltext'] = $this->fulltext;
- $stParams = wfArrayToCGI(
+ $stParams = array_merge(
$didYouMeanParams,
$this->powerSearchOptions()
);
- $suggestLink = $sk->makeKnownLinkObj( $st,
+ $suggestLink = $sk->linkKnown(
+ $st,
$textMatches->getSuggestionSnippet(),
- $stParams );
+ array(),
+ $stParams
+ );
$wgOut->addHTML('<div class="searchdidyoumean">'.wfMsg('search-suggest',$suggestLink).'</div>');
}
$t = $result->getTitle();
$sk = $wgUser->getSkin();
- $link = $sk->makeKnownLinkObj( $t, $result->getTitleSnippet($terms));
+ $link = $sk->linkKnown(
+ $t,
+ $result->getTitleSnippet($terms)
+ );
//If page content is not readable, just return the title.
//This is not quite safe, but better than showing excerpts from non-readable pages
$sectionText = $result->getSectionSnippet($terms);
$redirect = '';
if( !is_null($redirectTitle) )
- $redirect = "<span class='searchalttitle'>"
- .wfMsg('search-redirect',$sk->makeKnownLinkObj( $redirectTitle, $redirectText))
- ."</span>";
+ $redirect = "<span class='searchalttitle'>" .
+ wfMsg(
+ 'search-redirect',
+ $sk->linkKnown(
+ $redirectTitle,
+ $redirectText
+ )
+ ) .
+ "</span>";
$section = '';
if( !is_null($sectionTitle) )
- $section = "<span class='searchalttitle'>"
- .wfMsg('search-section', $sk->makeKnownLinkObj( $sectionTitle, $sectionText))
- ."</span>";
+ $section = "<span class='searchalttitle'>" .
+ wfMsg(
+ 'search-section',
+ $sk->linkKnown(
+ $sectionTitle,
+ $sectionText
+ )
+ ) .
+ "</span>";
// format text extract
$extract = "<div class='searchresult'>".$result->getTextSnippet($terms)."</div>";
$related = '';
if( $result->hasRelated() ){
$st = SpecialPage::getTitleFor( 'Search' );
- $stParams = wfArrayToCGI( $this->powerSearchOptions(),
- array('search' => wfMsgForContent('searchrelated').':'.$t->getPrefixedText(),
- 'fulltext' => wfMsg('search') ));
+ $stParams = array_merge(
+ $this->powerSearchOptions(),
+ array(
+ 'search' => wfMsgForContent( 'searchrelated' ) . ':' . $t->getPrefixedText(),
+ 'fulltext' => wfMsg( 'search' )
+ )
+ );
- $related = ' -- ' . $sk->makeKnownLinkObj( $st,
- wfMsg('search-relatedarticle'), $stParams );
+ $related = ' -- ' . $sk->linkKnown(
+ $st,
+ wfMsg('search-relatedarticle'),
+ array(),
+ $stParams
+ );
}
// Include a thumbnail for media files...
$t = $result->getTitle();
$sk = $wgUser->getSkin();
- $link = $sk->makeKnownLinkObj( $t, $result->getTitleSnippet($terms));
+ $link = $sk->linkKnown(
+ $t,
+ $result->getTitleSnippet( $terms )
+ );
// format redirect if any
$redirectTitle = $result->getRedirectTitle();
$redirectText = $result->getRedirectSnippet($terms);
$redirect = '';
if( !is_null($redirectTitle) )
- $redirect = "<span class='searchalttitle'>"
- .wfMsg('search-redirect',$sk->makeKnownLinkObj( $redirectTitle, $redirectText))
- ."</span>";
+ $redirect = "<span class='searchalttitle'>" .
+ wfMsg(
+ 'search-redirect',
+ $sk->linkKnown(
+ $redirectTitle,
+ $redirectText
+ )
+ ) .
+ "</span>";
$out = "";
// display project name
}
// "more results" link (special page stuff could be localized, but we might not know target lang)
$searchTitle = Title::newFromText($t->getInterwiki().":Special:Search");
- $searchLink = $sk->makeKnownLinkObj( $searchTitle, wfMsg('search-interwiki-more'),
- wfArrayToCGI(array('search' => $query, 'fulltext' => 'Search')));
+ $searchLink = $sk->linkKnown(
+ $searchTitle,
+ wfMsg( 'search-interwiki-more' ),
+ array(),
+ array(
+ 'search' => $query,
+ 'fulltext' => 'Search'
+ )
+ );
$out .= "</ul><div class='mw-search-interwiki-project'><span class='mw-search-interwiki-more'>{$searchLink}</span>{$caption}</div>\n<ul>";
}
if ( !$title ) {
return '<!-- Invalid title ' . htmlspecialchars( "{$result->namespace}:{$result->title}" ). '-->';
}
- $hlink = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'hist' ), 'action=history' );
+ $hlink = $skin->linkKnown(
+ $title,
+ wfMsgHtml( 'hist' ),
+ array(),
+ array( 'action' => 'history' )
+ );
$plink = $this->isCached()
? $skin->link( $title )
- : $skin->makeKnownLinkObj( $title );
+ : $skin->linkKnown( $title );
$size = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), $wgLang->formatNum( htmlspecialchars( $result->value ) ) );
return $title->exists()
$wgOut->addHTML( "<td width='30%' valign='top'><ul>\n" );
foreach( $sortedPages as $desc => $specialpage ) {
list( $title, $restricted ) = $specialpage;
- $link = $sk->makeKnownLinkObj( $title , htmlspecialchars( $desc ) );
+ $link = $sk->linkKnown( $title , htmlspecialchars( $desc ) );
if( $restricted ) {
$includesRestrictedPages = true;
$wgOut->addHTML( "<li class='mw-specialpages-page mw-specialpagerestricted'><strong>{$link}</strong></li>\n" );
$wgOut->addHTML( "<ul>\n" );
while( $row = $result->fetchObject() ) {
$title = Title::makeTitleSafe( $row->ar_namespace, $row->ar_title );
- $link = $sk->makeKnownLinkObj( $undelete, htmlspecialchars( $title->getPrefixedText() ),
- 'target=' . $title->getPrefixedUrl() );
+ $link = $sk->linkKnown(
+ $undelete,
+ htmlspecialchars( $title->getPrefixedText() ),
+ array(),
+ array( 'target' => $title->getPrefixedUrl() )
+ );
$revs = wfMsgExt( 'undeleterevisions',
array( 'parseinline' ),
$wgLang->formatNum( $row->count ) );
$wgOut->setPageTitle( wfMsg( 'undeletepage' ) );
- $link = $skin->makeKnownLinkObj(
+ $link = $skin->linkKnown(
SpecialPage::getTitleFor( 'Undelete', $this->mTargetObj->getPrefixedDBkey() ),
htmlspecialchars( $this->mTargetObj->getPrefixedText() )
);
Xml::openElement( 'div' ) .
Xml::openElement( 'form', array(
'method' => 'post',
- 'action' => $self->getLocalURL( "action=submit" ) ) ) .
+ 'action' => $self->getLocalURL( array( 'action' => 'submit' ) ) ) ) .
Xml::element( 'input', array(
'type' => 'hidden',
'name' => 'target',
if ( $this->mAllowed ) {
$titleObj = SpecialPage::getTitleFor( "Undelete" );
- $action = $titleObj->getLocalURL( "action=submit" );
+ $action = $titleObj->getLocalURL( array( 'action' => 'submit' ) );
# Start the form here
$top = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'undelete' ) );
$wgOut->addHTML( $top );
if( !$rev->userCan( Revision::DELETED_TEXT ) ) {
$last = wfMsgHtml('diff');
} else if( $remaining > 0 || ($earliestLiveTime && $ts > $earliestLiveTime) ) {
- $last = $sk->makeKnownLinkObj( $titleObj, wfMsgHtml('diff'),
- "target=" . $this->mTargetObj->getPrefixedUrl() . "×tamp=$ts&diff=prev" );
+ $last = $sk->linkKnown(
+ $titleObj,
+ wfMsgHtml('diff'),
+ array(),
+ array(
+ 'target' => $this->mTargetObj->getPrefixedUrl(),
+ 'timestamp' => $ts,
+ 'diff' => 'prev'
+ )
+ );
} else {
$last = wfMsgHtml('diff');
}
if( !$rev->userCan(Revision::DELETED_TEXT) ) {
return '<span class="history-deleted">' . $time . '</span>';
} else {
- $link = $sk->makeKnownLinkObj( $titleObj, $time,
- "target=".$this->mTargetObj->getPrefixedUrl()."×tamp=$ts" );
+ $link = $sk->linkKnown(
+ $titleObj,
+ $time,
+ array(),
+ array(
+ 'target' => $this->mTargetObj->getPrefixedUrl(),
+ 'timestamp' => $ts
+ )
+ );
if( $rev->isDeleted(Revision::DELETED_TEXT) )
$link = '<span class="history-deleted">' . $link . '</span>';
return $link;
if( !$file->userCan(File::DELETED_FILE) ) {
return '<span class="history-deleted">' . $wgLang->timeanddate( $ts, true ) . '</span>';
} else {
- $link = $sk->makeKnownLinkObj( $titleObj, $wgLang->timeanddate( $ts, true ),
- "target=".$this->mTargetObj->getPrefixedUrl().
- "&file=$key" .
- "&token=" . urlencode( $wgUser->editToken( $key ) ) );
+ $link = $sk->linkKnown(
+ $titleObj,
+ $wgLang->timeanddate( $ts, true ),
+ array(),
+ array(
+ 'target' => $this->mTargetObj->getPrefixedUrl(),
+ 'file' => $key,
+ 'token' => $wgUser->editToken( $key )
+ )
+ );
if( $file->isDeleted(File::DELETED_FILE) )
$link = '<span class="history-deleted">' . $link . '</span>';
return $link;
$wgUser, $this->mComment) );
$skin = $wgUser->getSkin();
- $link = $skin->makeKnownLinkObj( $this->mTargetObj );
+ $link = $skin->linkKnown( $this->mTargetObj );
$wgOut->addHTML( wfMsgWikiHtml( 'undeletedpage', $link ) );
} else {
$wgOut->showFatalError( wfMsg( "cannotundelete" ) );
function formatResult( $skin, $result ) {
$title = Title::makeTitle( NS_TEMPLATE, $result->title );
- $pageLink = $skin->makeKnownLinkObj( $title, '', 'redirect=no' );
- $wlhLink = $skin->makeKnownLinkObj(
+ $pageLink = $skin->linkKnown(
+ $title,
+ null,
+ array(),
+ array( 'redirect' => 'no' )
+ );
+ $wlhLink = $skin->linkKnown(
SpecialPage::getTitleFor( 'Whatlinkshere' ),
wfMsgHtml( 'unusedtemplateswlh' ),
- 'target=' . $title->getPrefixedUrl() );
+ array(),
+ array( 'target' => $title->getPrefixedUrl() )
+ );
return wfSpecialList( $pageLink, $wlhLink );
}
$nt = Title::makeTitle( $result->namespace, $result->title );
$text = $wgContLang->convert( $nt->getPrefixedText() );
- $plink = $skin->makeKnownLinkObj( $nt, htmlspecialchars( $text ) );
- $wlink = $skin->makeKnownLinkObj( $nt, wfMsgHtml( 'watch' ), 'action=watch' );
+ $plink = $skin->linkKnown(
+ $nt,
+ htmlspecialchars( $text )
+ );
+ $wlink = $skin->linkKnown(
+ $nt,
+ wfMsgHtml( 'watch' ),
+ array(),
+ array( 'action' => 'watch'
+ );
return wfSpecialList( $plink, $wlink );
}
}
if( $file->exists() ) {
- $dlink = $sk->makeKnownLinkObj( $file->getTitle() );
+ $dlink = $sk->linkKnown( $file->getTitle() );
if ( $file->allowInlineDisplay() ) {
$dlink2 = $sk->makeImageLinkObj( $file->getTitle(), wfMsgExt( 'fileexists-thumb', 'parseinline' ),
$file->getName(), $align, array(), false, true );
$warning .= '<li>' . wfMsgExt( 'fileexists', array('parseinline','replaceafter'), $dlink ) . '</li>' . $dlink2;
} elseif( $file->getTitle()->getArticleID() ) {
- $lnk = $sk->makeKnownLinkObj( $file->getTitle(), '', 'redirect=no' );
+ $lnk = $sk->linkKnown(
+ $file->getTitle(),
+ null,
+ array(),
+ array( 'redirect' => 'no' )
+ );
$warning .= '<li>' . wfMsgExt( 'filepageexists', array( 'parseinline', 'replaceafter' ), $lnk ) . '</li>';
} elseif ( $file_lc && $file_lc->exists() ) {
# Check if image with lowercase extension exists.
# It's not forbidden but in 99% it makes no sense to upload the same filename with uppercase extension
- $dlink = $sk->makeKnownLinkObj( $nt_lc );
+ $dlink = $sk->linkKnown( $nt_lc );
if ( $file_lc->allowInlineDisplay() ) {
$dlink2 = $sk->makeImageLinkObj( $nt_lc, wfMsgExt( 'fileexists-thumb', 'parseinline' ),
$nt_lc->getText(), $align, array(), false, true );
$file_thb = wfLocalFile( $nt_thb );
if ($file_thb->exists() ) {
# Check if an image without leading '180px-' (or similiar) exists
- $dlink = $sk->makeKnownLinkObj( $nt_thb);
+ $dlink = $sk->linkKnown( $nt_thb );
if ( $file_thb->allowInlineDisplay() ) {
$dlink2 = $sk->makeImageLinkObj( $nt_thb,
wfMsgExt( 'fileexists-thumb', 'parseinline' ),
# If the file existed before and was deleted, warn the user of this
# Don't bother doing so if the file exists now, however
$ltitle = SpecialPage::getTitleFor( 'Log' );
- $llink = $sk->makeKnownLinkObj( $ltitle, wfMsgHtml( 'deletionlog' ),
- 'type=delete&page=' . $file->getTitle()->getPrefixedUrl() );
+ $llink = $sk->linkKnown(
+ $ltitle,
+ wfMsgHtml( 'deletionlog' ),
+ array(),
+ array(
+ 'type' => 'delete',
+ 'page' => $file->getTitle()->getPrefixedUrl()
+ )
+ );
$warning .= '<li>' . wfMsgWikiHtml( 'filewasdeleted', $llink ) . '</li>';
}
return $warning;
$link = wfMsgExt(
$wgUser->isAllowed( 'delete' ) ? 'thisisdeleted' : 'viewdeleted',
array( 'parse', 'replaceafter' ),
- $wgUser->getSkin()->makeKnownLinkObj(
+ $wgUser->getSkin()->linkKnown(
SpecialPage::getTitleFor( 'Undelete', $title->getPrefixedText() ),
wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $count )
)
function makeLanguageSelectorLink( $text, $lang ) {
global $wgUser;
$self = SpecialPage::getTitleFor( 'Userlogin' );
- $attr[] = 'uselang=' . $lang;
+ $attr = array( 'uselang' => $lang );
if( $this->mType == 'signup' )
- $attr[] = 'type=signup';
+ $attr['type'] = 'signup';
if( $this->mReturnTo )
- $attr[] = 'returnto=' . $this->mReturnTo;
+ $attr['returnto'] = $this->mReturnTo;
$skin = $wgUser->getSkin();
- return $skin->makeKnownLinkObj( $self, htmlspecialchars( $text ), implode( '&', $attr ) );
+ return $skin->linkKnown(
+ $self,
+ htmlspecialchars( $text ),
+ array(),
+ $attr
+ );
}
}
# Anons don't get a watchlist
if( $wgUser->isAnon() ) {
$wgOut->setPageTitle( wfMsg( 'watchnologin' ) );
- $llink = $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Userlogin' ),
- wfMsgHtml( 'loginreqlink' ), 'returnto=' . $specialTitle->getPrefixedUrl() );
+ $llink = $skin->linkKnown(
+ SpecialPage::getTitleFor( 'Userlogin' ),
+ wfMsgHtml( 'loginreqlink' ),
+ array(),
+ array( 'returnto' => $specialTitle->getPrefixedUrl() )
+ );
$wgOut->addHTML( wfMsgWikiHtml( 'watchlistanontext', $llink ) );
return;
}
$hideLinktext = wfMsgHtml( 'hide' );
# Hide/show minor edits
$label = $hideMinor ? $showLinktext : $hideLinktext;
- $linkBits = wfArrayToCGI( array( 'hideMinor' => 1 - (int)$hideMinor ), $nondefaults );
- $links[] = wfMsgHtml( 'rcshowhideminor', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) );
+ $linkBits = array_merge(
+ array( 'hideMinor' => 1 - (int)$hideMinor ),
+ $nondefaults
+ );
+ $links[] = wfMsgHtml(
+ 'rcshowhideminor',
+ $skin->linkKnown(
+ $thisTitle,
+ $label,
+ array(),
+ $linkBits
+ )
+ );
# Hide/show bot edits
$label = $hideBots ? $showLinktext : $hideLinktext;
- $linkBits = wfArrayToCGI( array( 'hideBots' => 1 - (int)$hideBots ), $nondefaults );
- $links[] = wfMsgHtml( 'rcshowhidebots', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) );
+ $linkBits = array_merge(
+ array( 'hideBots' => 1 - (int)$hideBots ),
+ $nondefaults
+ );
+ $links[] = wfMsgHtml(
+ 'rcshowhidebots',
+ $skin->linkKnown(
+ $thisTitle,
+ $label,
+ array(),
+ $linkBits
+ )
+ );
# Hide/show anonymous edits
$label = $hideAnons ? $showLinktext : $hideLinktext;
- $linkBits = wfArrayToCGI( array( 'hideAnons' => 1 - (int)$hideAnons ), $nondefaults );
- $links[] = wfMsgHtml( 'rcshowhideanons', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) );
+ $linkBits = array_merge(
+ array( 'hideAnons' => 1 - (int)$hideAnons ),
+ $nondefaults
+ );
+ $links[] = wfMsgHtml(
+ 'rcshowhideanons',
+ $skin->linkKnown(
+ $thisTitle,
+ $label,
+ array(),
+ $linkBits
+ )
+ );
# Hide/show logged in edits
$label = $hideLiu ? $showLinktext : $hideLinktext;
- $linkBits = wfArrayToCGI( array( 'hideLiu' => 1 - (int)$hideLiu ), $nondefaults );
- $links[] = wfMsgHtml( 'rcshowhideliu', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) );
+ $linkBits = array_merge(
+ array( 'hideLiu' => 1 - (int)$hideLiu ),
+ $nondefaults
+ );
+ $links[] = wfMsgHtml(
+ 'rcshowhideliu',
+ $skin->linkKnown(
+ $thisTitle,
+ $label,
+ array(),
+ $linkBits
+ )
+ );
# Hide/show own edits
$label = $hideOwn ? $showLinktext : $hideLinktext;
- $linkBits = wfArrayToCGI( array( 'hideOwn' => 1 - (int)$hideOwn ), $nondefaults );
- $links[] = wfMsgHtml( 'rcshowhidemine', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) );
+ $linkBits = array_merge(
+ array( 'hideOwn' => 1 - (int)$hideOwn ),
+ $nondefaults
+ );
+ $links[] = wfMsgHtml(
+ 'rcshowhidemine',
+ $skin->linkKnown(
+ $thisTitle,
+ $label,
+ array(),
+ $linkBits
+ )
+ );
# Hide/show patrolled edits
if( $wgUser->useRCPatrol() ) {
$label = $hidePatrolled ? $showLinktext : $hideLinktext;
- $linkBits = wfArrayToCGI( array( 'hidePatrolled' => 1 - (int)$hidePatrolled ), $nondefaults );
- $links[] = wfMsgHtml( 'rcshowhidepatr', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) );
+ $linkBits = array_merge(
+ array( 'hidePatrolled' => 1 - (int)$hidePatrolled ),
+ $nondefaults
+ );
+ $links[] = wfMsgHtml(
+ 'rcshowhidepatr',
+ $skin->linkKnown(
+ $thisTitle,
+ $label,
+ array(),
+ $linkBits
+ )
+ );
}
# Namespace filter and put the whole form together.
}
}
- $suppressRedirect = $row->page_is_redirect ? 'redirect=no' : '';
- $link = $this->skin->makeKnownLinkObj( $nt, '', $suppressRedirect );
+ if( $row->page_is_redirect ) {
+ $query = array( 'redirect' => 'no' );
+ } else {
+ $query = array();
+ }
+
+ $link = $this->skin->linkKnown(
+ $nt,
+ null,
+ array(),
+ $query
+ );
// Display properties (redirect or template)
$propsText = '';
$title = SpecialPage::getTitleFor( 'Whatlinkshere' );
$targetText = $target->getPrefixedUrl();
- return $this->skin->makeKnownLinkObj( $title, $text, 'target=' . $targetText );
+ return $this->skin->linkKnown(
+ $title,
+ $text,
+ array(),
+ array( 'target' => $targetText )
+ );
}
function makeSelfLink( $text, $query ) {
- return $this->skin->makeKnownLinkObj( $this->selfTitle, $text, $query );
+ return $this->skin->linkKnown(
+ $this->selfTitle,
+ $text,
+ array(),
+ $query
+ );
}
function getPrevNext( $prevId, $nextId ) {
if ( 0 != $prevId ) {
$overrides = array( 'from' => $this->opts->getValue( 'back' ) );
- $prev = $this->makeSelfLink( $prev, wfArrayToCGI( $overrides, $changed ) );
+ $prev = $this->makeSelfLink( $prev, array_merge( $overrides, $changed ) );
}
if ( 0 != $nextId ) {
$overrides = array( 'from' => $nextId, 'back' => $prevId );
- $next = $this->makeSelfLink( $next, wfArrayToCGI( $overrides, $changed ) );
+ $next = $this->makeSelfLink( $next, array_merge( $overrides, $changed ) );
}
$limitLinks = array();
foreach ( $this->limits as $limit ) {
$prettyLimit = $wgLang->formatNum( $limit );
$overrides = array( 'limit' => $limit );
- $limitLinks[] = $this->makeSelfLink( $prettyLimit, wfArrayToCGI( $overrides, $changed ) );
+ $limitLinks[] = $this->makeSelfLink( $prettyLimit, array_merge( $overrides, $changed ) );
}
$nums = $wgLang->pipeList( $limitLinks );
$chosen = $this->opts->getValue( $type );
$msg = wfMsgHtml( "whatlinkshere-{$type}", $chosen ? $show : $hide );
$overrides = array( $type => !$chosen );
- $links[] = $this->makeSelfLink( $msg, wfArrayToCGI( $overrides, $changed ) );
+ $links[] = $this->makeSelfLink( $msg, array_merge( $overrides, $changed ) );
}
return Xml::fieldset( wfMsg( 'whatlinkshere-filters' ), $wgLang->pipeList( $links ) );
}