r51572 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51571‎ | r51572 | r51573 >
Date:18:45, 7 June 2009
Author:siebrand
Status:ok
Tags:
Comment:
* replace use of deprecated makeKnownLinkObj() by linkKnown() in core special pages
* 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.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialAllmessages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialAllpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialAncientpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialBlockip.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialBrokenRedirects.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialConfirmemail.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialDeletedContributions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialDoubleRedirects.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialFewestrevisions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialImport.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialLinkSearch.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialListfiles.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialMergeHistory.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialMostlinked.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialMostrevisions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialMovepage.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialNewpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialPopularpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialPrefixindex.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialProtectedpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRevisiondelete.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialSearch.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialShortpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialSpecialpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUndelete.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUnusedtemplates.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUnwatchedpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialWatchlist.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialWhatlinkshere.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialNewpages.php
@@ -255,9 +255,24 @@
256256
257257 $title = Title::makeTitleSafe( $result->rc_namespace, $result->rc_title );
258258 $time = htmlspecialchars( $wgLang->timeAndDate( $result->rc_timestamp, true ) );
259 - $query = $this->patrollable( $result ) ? "rcid={$result->rc_id}&redirect=no" : 'redirect=no';
260 - $plink = $this->skin->makeKnownLinkObj( $title, '', $query );
261 - $hist = $this->skin->makeKnownLinkObj( $title, wfMsgHtml( 'hist' ), 'action=history' );
 259+
 260+ $query = array( 'redirect' => 'no' );
 261+
 262+ if( $this->patrollable( $result ) )
 263+ $query['rcid'] = $result->rc_id;
 264+
 265+ $plink = $this->skin->linkKnown(
 266+ $title,
 267+ null,
 268+ array(),
 269+ $query
 270+ );
 271+ $hist = $this->skin->linkKnown(
 272+ $title,
 273+ wfMsgHtml( 'hist' ),
 274+ array(),
 275+ array( 'action' => 'history' )
 276+ );
262277 $length = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ),
263278 $wgLang->formatNum( $result->length ) );
264279 $ulink = $this->skin->userLink( $result->rc_user, $result->rc_user_text ) . ' ' .
Index: trunk/phase3/includes/specials/SpecialShortpages.php
@@ -74,10 +74,15 @@
7575 if ( !$title ) {
7676 return '<!-- Invalid title ' . htmlspecialchars( "{$result->namespace}:{$result->title}" ). '-->';
7777 }
78 - $hlink = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'hist' ), 'action=history' );
 78+ $hlink = $skin->linkKnown(
 79+ $title,
 80+ wfMsgHtml( 'hist' ),
 81+ array(),
 82+ array( 'action' => 'history' )
 83+ );
7984 $plink = $this->isCached()
8085 ? $skin->link( $title )
81 - : $skin->makeKnownLinkObj( $title );
 86+ : $skin->linkKnown( $title );
8287 $size = wfMsgExt( 'nbytes', array( 'parsemag', 'escape' ), $wgLang->formatNum( htmlspecialchars( $result->value ) ) );
8388
8489 return $title->exists()
Index: trunk/phase3/includes/specials/SpecialDoubleRedirects.php
@@ -80,10 +80,20 @@
8181 $titleB = Title::makeTitle( $result->nsb, $result->tb );
8282 $titleC = Title::makeTitle( $result->nsc, $result->tc );
8383
84 - $linkA = $skin->makeKnownLinkObj( $titleA, '', 'redirect=no' );
 84+ $linkA = $skin->linkKnown(
 85+ $titleA,
 86+ null,
 87+ array(),
 88+ array( 'redirect' => 'no' )
 89+ );
8590 $edit = $skin->makeBrokenLinkObj( $titleA, "(".wfMsgHtml("qbedit").")" , 'redirect=no');
86 - $linkB = $skin->makeKnownLinkObj( $titleB, '', 'redirect=no' );
87 - $linkC = $skin->makeKnownLinkObj( $titleC );
 91+ $linkB = $skin->linkKnown(
 92+ $titleB,
 93+ null,
 94+ array(),
 95+ array( 'redirect' => 'no' )
 96+ );
 97+ $linkC = $skin->linkKnown( $titleC );
8898 $arr = $wgContLang->getArrow() . $wgContLang->getDirMark();
8999
90100 return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -632,7 +632,7 @@
633633 }
634634
635635 if( $file->exists() ) {
636 - $dlink = $sk->makeKnownLinkObj( $file->getTitle() );
 636+ $dlink = $sk->linkKnown( $file->getTitle() );
637637 if ( $file->allowInlineDisplay() ) {
638638 $dlink2 = $sk->makeImageLinkObj( $file->getTitle(), wfMsgExt( 'fileexists-thumb', 'parseinline' ),
639639 $file->getName(), $align, array(), false, true );
@@ -647,12 +647,17 @@
648648 $warning .= '<li>' . wfMsgExt( 'fileexists', array('parseinline','replaceafter'), $dlink ) . '</li>' . $dlink2;
649649
650650 } elseif( $file->getTitle()->getArticleID() ) {
651 - $lnk = $sk->makeKnownLinkObj( $file->getTitle(), '', 'redirect=no' );
 651+ $lnk = $sk->linkKnown(
 652+ $file->getTitle(),
 653+ null,
 654+ array(),
 655+ array( 'redirect' => 'no' )
 656+ );
652657 $warning .= '<li>' . wfMsgExt( 'filepageexists', array( 'parseinline', 'replaceafter' ), $lnk ) . '</li>';
653658 } elseif ( $file_lc && $file_lc->exists() ) {
654659 # Check if image with lowercase extension exists.
655660 # It's not forbidden but in 99% it makes no sense to upload the same filename with uppercase extension
656 - $dlink = $sk->makeKnownLinkObj( $nt_lc );
 661+ $dlink = $sk->linkKnown( $nt_lc );
657662 if ( $file_lc->allowInlineDisplay() ) {
658663 $dlink2 = $sk->makeImageLinkObj( $nt_lc, wfMsgExt( 'fileexists-thumb', 'parseinline' ),
659664 $nt_lc->getText(), $align, array(), false, true );
@@ -677,7 +682,7 @@
678683 $file_thb = wfLocalFile( $nt_thb );
679684 if ($file_thb->exists() ) {
680685 # Check if an image without leading '180px-' (or similiar) exists
681 - $dlink = $sk->makeKnownLinkObj( $nt_thb);
 686+ $dlink = $sk->linkKnown( $nt_thb );
682687 if ( $file_thb->allowInlineDisplay() ) {
683688 $dlink2 = $sk->makeImageLinkObj( $nt_thb,
684689 wfMsgExt( 'fileexists-thumb', 'parseinline' ),
@@ -713,8 +718,15 @@
714719 # If the file existed before and was deleted, warn the user of this
715720 # Don't bother doing so if the file exists now, however
716721 $ltitle = SpecialPage::getTitleFor( 'Log' );
717 - $llink = $sk->makeKnownLinkObj( $ltitle, wfMsgHtml( 'deletionlog' ),
718 - 'type=delete&page=' . $file->getTitle()->getPrefixedUrl() );
 722+ $llink = $sk->linkKnown(
 723+ $ltitle,
 724+ wfMsgHtml( 'deletionlog' ),
 725+ array(),
 726+ array(
 727+ 'type' => 'delete',
 728+ 'page' => $file->getTitle()->getPrefixedUrl()
 729+ )
 730+ );
719731 $warning .= '<li>' . wfMsgWikiHtml( 'filewasdeleted', $llink ) . '</li>';
720732 }
721733 return $warning;
@@ -992,7 +1004,7 @@
9931005 $link = wfMsgExt(
9941006 $wgUser->isAllowed( 'delete' ) ? 'thisisdeleted' : 'viewdeleted',
9951007 array( 'parse', 'replaceafter' ),
996 - $wgUser->getSkin()->makeKnownLinkObj(
 1008+ $wgUser->getSkin()->linkKnown(
9971009 SpecialPage::getTitleFor( 'Undelete', $title->getPrefixedText() ),
9981010 wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $count )
9991011 )
Index: trunk/phase3/includes/specials/SpecialFewestrevisions.php
@@ -55,14 +55,21 @@
5656 $nt = Title::makeTitleSafe( $result->namespace, $result->title );
5757 $text = $wgContLang->convert( $nt->getPrefixedText() );
5858
59 - $plink = $skin->makeKnownLinkObj( $nt, $text );
 59+ $plink = $skin->linkKnown(
 60+ $nt,
 61+ $text
 62+ );
6063
6164 $nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape' ),
6265 $wgLang->formatNum( $result->value ) );
6366 $redirect = $result->redirect ? ' - ' . wfMsgHtml( 'isredirect' ) : '';
64 - $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' ) . $redirect;
 67+ $nlink = $skin->linkKnown(
 68+ $nt,
 69+ $nl,
 70+ array(),
 71+ array( 'action' => 'history' )
 72+ ) . $redirect;
6573
66 -
6774 return wfSpecialList( $plink, $nlink );
6875 }
6976 }
Index: trunk/phase3/includes/specials/SpecialAllmessages.php
@@ -52,8 +52,8 @@
5353 $navText .= wfAllMessagesMakePhp( $messages );
5454 $wgOut->addHTML( $wgLang->pipeList( array(
5555 'PHP',
56 - '<a href="' . $title->escapeLocalUrl( 'ot=html' ) . '">HTML</a>',
57 - '<a href="' . $title->escapeLocalUrl( 'ot=xml' ) . '">XML</a>' .
 56+ '<a href="' . $title->escapeLocalUrl( array( 'ot' => 'html' ) ) . '">HTML</a>',
 57+ '<a href="' . $title->escapeLocalUrl( array( 'ot' => 'xml' ) ) . '">XML</a>' .
5858 '<pre>' . htmlspecialchars( $navText ) . '</pre>'
5959 ) ) );
6060 } else if ( $ot == 'xml' ) {
@@ -62,9 +62,9 @@
6363 echo wfAllMessagesMakeXml( $messages );
6464 } else {
6565 $wgOut->addHTML( $wgLang->pipeList( array(
66 - '<a href="' . $title->escapeLocalUrl( 'ot=php' ) . '">PHP</a>',
 66+ '<a href="' . $title->escapeLocalUrl( array( 'ot' => 'php' ) ) . '">PHP</a>',
6767 'HTML',
68 - '<a href="' . $title->escapeLocalUrl( 'ot=xml' ) . '">XML</a>'
 68+ '<a href="' . $title->escapeLocalUrl( array( 'ot' => 'xml' ) ) . '">XML</a>'
6969 ) ) );
7070 $wgOut->addWikiText( $navText );
7171 $wgOut->addHTML( wfAllMessagesMakeHTMLText( $messages ) );
@@ -188,14 +188,17 @@
189189 $mw = htmlspecialchars( $m['msg'] );
190190
191191 if( array_key_exists( $title, $pageExists[NS_MEDIAWIKI] ) ) {
192 - $pageLink = $sk->makeKnownLinkObj( $titleObj, "<span id=\"sp-allmessages-i-$i\">" .
193 - htmlspecialchars( $key ) . '</span>' );
 192+ // FIXME: the span should be taken care of in $customAttribs, shouldn't it?
 193+ $pageLink = $sk->linkKnown(
 194+ $titleObj,
 195+ "<span id=\"sp-allmessages-i-$i\">" . htmlspecialchars( $key ) . '</span>'
 196+ );
194197 } else {
195198 $pageLink = $sk->makeBrokenLinkObj( $titleObj, "<span id=\"sp-allmessages-i-$i\">" .
196199 htmlspecialchars( $key ) . '</span>' );
197200 }
198201 if( array_key_exists( $title, $pageExists[NS_MEDIAWIKI_TALK] ) ) {
199 - $talkLink = $sk->makeKnownLinkObj( $talkPage, htmlspecialchars( $talk ) );
 202+ $talkLink = $sk->linkKnown( $talkPage, htmlspecialchars( $talk ) );
200203 } else {
201204 $talkLink = $sk->makeBrokenLinkObj( $talkPage, htmlspecialchars( $talk ) );
202205 }
Index: trunk/phase3/includes/specials/SpecialSpecialpages.php
@@ -60,7 +60,7 @@
6161 $wgOut->addHTML( "<td width='30%' valign='top'><ul>\n" );
6262 foreach( $sortedPages as $desc => $specialpage ) {
6363 list( $title, $restricted ) = $specialpage;
64 - $link = $sk->makeKnownLinkObj( $title , htmlspecialchars( $desc ) );
 64+ $link = $sk->linkKnown( $title , htmlspecialchars( $desc ) );
6565 if( $restricted ) {
6666 $includesRestrictedPages = true;
6767 $wgOut->addHTML( "<li class='mw-specialpages-page mw-specialpagerestricted'><strong>{$link}</strong></li>\n" );
Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -157,26 +157,41 @@
158158 if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && IP::isIPAddress( $nt->getText() ) ) ) {
159159 # Block link
160160 if( $wgUser->isAllowed( 'block' ) )
161 - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Blockip',
162 - $nt->getDBkey() ), wfMsgHtml( 'blocklink' ) );
 161+ $tools[] = $sk->linkKnown(
 162+ SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ),
 163+ wfMsgHtml( 'blocklink' )
 164+ );
163165 # Block log link
164 - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ),
165 - wfMsgHtml( 'sp-contributions-blocklog' ), 'type=block&page=' . $nt->getPrefixedUrl() );
 166+ $tools[] = $sk->linkKnown(
 167+ SpecialPage::getTitleFor( 'Log' ),
 168+ wfMsgHtml( 'sp-contributions-blocklog' ),
 169+ array(),
 170+ array(
 171+ 'type' => 'block',
 172+ 'page' => $nt->getPrefixedUrl()
 173+ )
 174+ );
166175 }
167176 # Other logs link
168 - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ), wfMsg( 'sp-contributions-logs' ),
169 - 'user=' . $nt->getPartialUrl() );
 177+ $tools[] = $sk->linkKnown(
 178+ SpecialPage::getTitleFor( 'Log' ),
 179+ wfMsg( 'sp-contributions-logs' ),
 180+ array(),
 181+ array( 'user' => $nt->getPartialUrl() )
 182+ );
170183
171184 # Add link to deleted user contributions for priviledged users
172185 if( $wgUser->isAllowed( 'deletedhistory' ) ) {
173 - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'DeletedContributions',
174 - $nt->getDBkey() ), wfMsgHtml( 'sp-contributions-deleted' ) );
 186+ $tools[] = $sk->linkKnown(
 187+ SpecialPage::getTitleFor( 'DeletedContributions', $nt->getDBkey() ),
 188+ wfMsgHtml( 'sp-contributions-deleted' )
 189+ );
175190 }
176191
177192 # Add a link to change user rights for privileged users
178193 $userrightsPage = new UserrightsPage();
179194 if( 0 !== $id && $userrightsPage->userCanChangeRights( User::newFromId( $id ) ) ) {
180 - $tools[] = $sk->makeKnownLinkObj(
 195+ $tools[] = $sk->linkKnown(
181196 SpecialPage::getTitleFor( 'Userrights', $nt->getDBkey() ),
182197 wfMsgHtml( 'sp-contributions-userrights' )
183198 );
@@ -493,7 +508,12 @@
494509 if( $row->rev_id == $row->page_latest ) {
495510 $topmarktext .= '<span class="mw-uctop">' . $this->messages['uctop'] . '</span>';
496511 if( !$row->page_is_new ) {
497 - $difftext .= '(' . $sk->makeKnownLinkObj( $page, $this->messages['diff'], 'diff=0' ) . ')';
 512+ $difftext .= '(' . $sk->linkKnown(
 513+ $page,
 514+ $this->messages['diff'],
 515+ array(),
 516+ array( 'diff' => 0 )
 517+ ) . ')';
498518 # Add rollback link
499519 if( $page->quickUserCan( 'rollback') && $page->quickUserCan( 'edit' ) ) {
500520 $topmarktext .= ' '.$sk->generateRollback( $rev );
@@ -504,16 +524,33 @@
505525 }
506526 # Is there a visible previous revision?
507527 if( $rev->userCan(Revision::DELETED_TEXT) ) {
508 - $difftext = '(' . $sk->makeKnownLinkObj( $page, $this->messages['diff'],
509 - 'diff=prev&oldid='.$row->rev_id ) . ')';
 528+ $difftext = '(' . $sk->linkKnown(
 529+ $page,
 530+ $this->messages['diff'],
 531+ array(),
 532+ array(
 533+ 'diff' => 'prev',
 534+ 'oldid' => $row->rev_id
 535+ )
 536+ ) . ')';
510537 } else {
511538 $difftext = '(' . $this->messages['diff'] . ')';
512539 }
513 - $histlink = '('.$sk->makeKnownLinkObj( $page, $this->messages['hist'], 'action=history' ) . ')';
 540+ $histlink = '('.$sk->linkKnown(
 541+ $page,
 542+ $this->messages['hist'],
 543+ array(),
 544+ array( 'action' => 'history' )
 545+ ) . ')';
514546
515547 $comment = $wgContLang->getDirMark() . $sk->revComment( $rev, false, true );
516548 $date = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true );
517 - $d = $sk->makeKnownLinkObj( $page, htmlspecialchars($date), 'oldid='.intval($row->rev_id) );
 549+ $d = $sk->linkKnown(
 550+ $page,
 551+ htmlspecialchars($date),
 552+ array(),
 553+ array( 'oldid' => intval( $row->rev_id ) )
 554+ );
518555
519556 if( $this->target == 'newbies' ) {
520557 $userlink = ' . . ' . $sk->userLink( $row->rev_user, $row->rev_user_text );
Index: trunk/phase3/includes/specials/SpecialPopularpages.php
@@ -48,9 +48,15 @@
4949 function formatResult( $skin, $result ) {
5050 global $wgLang, $wgContLang;
5151 $title = Title::makeTitle( $result->namespace, $result->title );
52 - $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
53 - $nv = wfMsgExt( 'nviews', array( 'parsemag', 'escape'),
54 - $wgLang->formatNum( $result->value ) );
 52+ $link = $skin->linkKnown(
 53+ $title,
 54+ htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) )
 55+ );
 56+ $nv = wfMsgExt(
 57+ 'nviews',
 58+ array( 'parsemag', 'escape'),
 59+ $wgLang->formatNum( $result->value )
 60+ );
5561 return wfSpecialList($link, $nv);
5662 }
5763 }
Index: trunk/phase3/includes/specials/SpecialSearch.php
@@ -103,7 +103,7 @@
104104 wfRunHooks( 'SpecialSearchNogomatch', array( &$t ) );
105105 # If the feature is enabled, go straight to the edit page
106106 if( $wgGoToEdit ) {
107 - $wgOut->redirect( $t->getFullURL( 'action=edit' ) );
 107+ $wgOut->redirect( $t->getFullURL( array( 'action' => 'edit' ) ) );
108108 return;
109109 }
110110 }
@@ -165,17 +165,24 @@
166166 // did you mean... suggestions
167167 if( $textMatches && $textMatches->hasSuggestion() ) {
168168 $st = SpecialPage::getTitleFor( 'Search' );
 169+
169170 # mirror Go/Search behaviour of original request ..
170171 $didYouMeanParams = array( 'search' => $textMatches->getSuggestionQuery() );
 172+
171173 if($this->fulltext != NULL)
172174 $didYouMeanParams['fulltext'] = $this->fulltext;
173 - $stParams = wfArrayToCGI(
 175+
 176+ $stParams = array_merge(
174177 $didYouMeanParams,
175178 $this->powerSearchOptions()
176179 );
177 - $suggestLink = $sk->makeKnownLinkObj( $st,
 180+
 181+ $suggestLink = $sk->linkKnown(
 182+ $st,
178183 $textMatches->getSuggestionSnippet(),
179 - $stParams );
 184+ array(),
 185+ $stParams
 186+ );
180187
181188 $this->didYouMeanHtml = '<div class="searchdidyoumean">'.wfMsg('search-suggest',$suggestLink).'</div>';
182189 }
@@ -406,7 +413,10 @@
407414 $sk = $wgUser->getSkin();
408415 $t = $result->getTitle();
409416
410 - $link = $this->sk->makeKnownLinkObj( $t, $result->getTitleSnippet($terms));
 417+ $link = $this->sk->linkKnown(
 418+ $t,
 419+ $result->getTitleSnippet($terms)
 420+ );
411421
412422 //If page content is not readable, just return the title.
413423 //This is not quite safe, but better than showing excerpts from non-readable pages
@@ -430,15 +440,29 @@
431441 $sectionTitle = $result->getSectionTitle();
432442 $sectionText = $result->getSectionSnippet($terms);
433443 $redirect = '';
 444+
434445 if( !is_null($redirectTitle) )
435 - $redirect = "<span class='searchalttitle'>"
436 - .wfMsg('search-redirect',$this->sk->makeKnownLinkObj( $redirectTitle, $redirectText))
437 - ."</span>";
 446+ $redirect = "<span class='searchalttitle'>" .
 447+ wfMsg(
 448+ 'search-redirect',
 449+ $this->sk->linkKnown(
 450+ $redirectTitle,
 451+ $redirectText
 452+ )
 453+ ) .
 454+ "</span>";
 455+
438456 $section = '';
 457+
439458 if( !is_null($sectionTitle) )
440 - $section = "<span class='searchalttitle'>"
441 - .wfMsg('search-section', $this->sk->makeKnownLinkObj( $sectionTitle, $sectionText))
442 - ."</span>";
 459+ $section = "<span class='searchalttitle'>" .
 460+ wfMsg(
 461+ 'search-section', $this->sk->linkKnown(
 462+ $sectionTitle,
 463+ $sectionText
 464+ )
 465+ ) .
 466+ "</span>";
443467
444468 // format text extract
445469 $extract = "<div class='searchresult'>".$result->getTextSnippet($terms)."</div>";
@@ -457,20 +481,32 @@
458482 $byteSize = $result->getByteSize();
459483 $wordCount = $result->getWordCount();
460484 $timestamp = $result->getTimestamp();
461 - $size = wfMsgExt( 'search-result-size', array( 'parsemag', 'escape' ),
462 - $this->sk->formatSize( $byteSize ), $wordCount );
 485+ $size = wfMsgExt(
 486+ 'search-result-size',
 487+ array( 'parsemag', 'escape' ),
 488+ $this->sk->formatSize( $byteSize ),
 489+ $wordCount
 490+ );
463491 $date = $wgLang->timeanddate( $timestamp );
464492
465493 // link to related articles if supported
466494 $related = '';
467495 if( $result->hasRelated() ) {
468496 $st = SpecialPage::getTitleFor( 'Search' );
469 - $stParams = wfArrayToCGI( $this->powerSearchOptions(),
470 - array('search' => wfMsgForContent('searchrelated').':'.$t->getPrefixedText(),
471 - 'fulltext' => wfMsg('search') ));
 497+ $stParams = array_merge(
 498+ $this->powerSearchOptions(),
 499+ array(
 500+ 'search' => wfMsgForContent( 'searchrelated' ) . ':' . $t->getPrefixedText(),
 501+ 'fulltext' => wfMsg( 'search' )
 502+ )
 503+ );
472504
473 - $related = ' -- ' . $sk->makeKnownLinkObj( $st,
474 - wfMsg('search-relatedarticle'), $stParams );
 505+ $related = ' -- ' . $sk->linkKnown(
 506+ $st,
 507+ wfMsg('search-relatedarticle'),
 508+ array(),
 509+ $stParams
 510+ );
475511 }
476512
477513 // Include a thumbnail for media files...
@@ -567,16 +603,25 @@
568604
569605 $t = $result->getTitle();
570606
571 - $link = $this->sk->makeKnownLinkObj( $t, $result->getTitleSnippet($terms));
 607+ $link = $this->sk->linkKnown(
 608+ $t,
 609+ $result->getTitleSnippet($terms)
 610+ );
572611
573612 // format redirect if any
574613 $redirectTitle = $result->getRedirectTitle();
575614 $redirectText = $result->getRedirectSnippet($terms);
576615 $redirect = '';
577616 if( !is_null($redirectTitle) )
578 - $redirect = "<span class='searchalttitle'>"
579 - .wfMsg('search-redirect',$this->sk->makeKnownLinkObj( $redirectTitle, $redirectText))
580 - ."</span>";
 617+ $redirect = "<span class='searchalttitle'>" .
 618+ wfMsg(
 619+ 'search-redirect',
 620+ $this->sk->linkKnown(
 621+ $redirectTitle,
 622+ $redirectText
 623+ )
 624+ ) .
 625+ "</span>";
581626
582627 $out = "";
583628 // display project name
@@ -592,8 +637,15 @@
593638 }
594639 // "more results" link (special page stuff could be localized, but we might not know target lang)
595640 $searchTitle = Title::newFromText($t->getInterwiki().":Special:Search");
596 - $searchLink = $this->sk->makeKnownLinkObj( $searchTitle, wfMsg('search-interwiki-more'),
597 - wfArrayToCGI(array('search' => $query, 'fulltext' => 'Search')));
 641+ $searchLink = $this->sk->linkKnown(
 642+ $searchTitle,
 643+ wfMsg('search-interwiki-more'),
 644+ array(),
 645+ array(
 646+ 'search' => $query,
 647+ 'fulltext' => 'Search'
 648+ )
 649+ );
598650 $out .= "</ul><div class='mw-search-interwiki-project'><span class='mw-search-interwiki-more'>
599651 {$searchLink}</span>{$caption}</div>\n<ul>";
600652 }
@@ -801,13 +853,23 @@
802854 $opt['redirs'] = $this->searchRedirects ? 1 : 0;
803855
804856 $st = SpecialPage::getTitleFor( 'Search' );
805 - $stParams = wfArrayToCGI( array( 'search' => $term, 'fulltext' => wfMsg( 'search' ) ), $opt );
 857+ $stParams = array_merge(
 858+ array(
 859+ 'search' => $term,
 860+ 'fulltext' => wfMsg( 'search' )
 861+ ),
 862+ $opt
 863+ );
806864
807 - return Xml::element( 'a',
808 - array( 'href'=> $st->getLocalURL( $stParams ), 'title' => $tooltip,
809 - 'onmousedown' => 'mwSearchHeaderClick(this);',
810 - 'onkeydown' => 'mwSearchHeaderClick(this);'),
811 - $label );
 865+ return Xml::element(
 866+ 'a',
 867+ array(
 868+ 'href' => $st->getLocalURL( $stParams ),
 869+ 'title' => $tooltip,
 870+ 'onmousedown' => 'mwSearchHeaderClick(this);',
 871+ 'onkeydown' => 'mwSearchHeaderClick(this);'),
 872+ $label
 873+ );
812874 }
813875
814876 /** Check if query starts with image: prefix */
@@ -929,7 +991,7 @@
930992 wfRunHooks( 'SpecialSearchNogomatch', array( &$t ) );
931993 # If the feature is enabled, go straight to the edit page
932994 if ( $wgGoToEdit ) {
933 - $wgOut->redirect( $t->getFullURL( 'action=edit' ) );
 995+ $wgOut->redirect( $t->getFullURL( array( 'action' => 'edit' ) ) );
934996 return;
935997 }
936998 }
@@ -974,14 +1036,17 @@
9751037 $didYouMeanParams = array( 'search' => $textMatches->getSuggestionQuery() );
9761038 if($this->fulltext != NULL)
9771039 $didYouMeanParams['fulltext'] = $this->fulltext;
978 - $stParams = wfArrayToCGI(
 1040+ $stParams = array_merge(
9791041 $didYouMeanParams,
9801042 $this->powerSearchOptions()
9811043 );
9821044
983 - $suggestLink = $sk->makeKnownLinkObj( $st,
 1045+ $suggestLink = $sk->linkKnown(
 1046+ $st,
9841047 $textMatches->getSuggestionSnippet(),
985 - $stParams );
 1048+ array(),
 1049+ $stParams
 1050+ );
9861051
9871052 $wgOut->addHTML('<div class="searchdidyoumean">'.wfMsg('search-suggest',$suggestLink).'</div>');
9881053 }
@@ -1208,7 +1273,10 @@
12091274 $t = $result->getTitle();
12101275 $sk = $wgUser->getSkin();
12111276
1212 - $link = $sk->makeKnownLinkObj( $t, $result->getTitleSnippet($terms));
 1277+ $link = $sk->linkKnown(
 1278+ $t,
 1279+ $result->getTitleSnippet($terms)
 1280+ );
12131281
12141282 //If page content is not readable, just return the title.
12151283 //This is not quite safe, but better than showing excerpts from non-readable pages
@@ -1234,14 +1302,26 @@
12351303 $sectionText = $result->getSectionSnippet($terms);
12361304 $redirect = '';
12371305 if( !is_null($redirectTitle) )
1238 - $redirect = "<span class='searchalttitle'>"
1239 - .wfMsg('search-redirect',$sk->makeKnownLinkObj( $redirectTitle, $redirectText))
1240 - ."</span>";
 1306+ $redirect = "<span class='searchalttitle'>" .
 1307+ wfMsg(
 1308+ 'search-redirect',
 1309+ $sk->linkKnown(
 1310+ $redirectTitle,
 1311+ $redirectText
 1312+ )
 1313+ ) .
 1314+ "</span>";
12411315 $section = '';
12421316 if( !is_null($sectionTitle) )
1243 - $section = "<span class='searchalttitle'>"
1244 - .wfMsg('search-section', $sk->makeKnownLinkObj( $sectionTitle, $sectionText))
1245 - ."</span>";
 1317+ $section = "<span class='searchalttitle'>" .
 1318+ wfMsg(
 1319+ 'search-section',
 1320+ $sk->linkKnown(
 1321+ $sectionTitle,
 1322+ $sectionText
 1323+ )
 1324+ ) .
 1325+ "</span>";
12461326
12471327 // format text extract
12481328 $extract = "<div class='searchresult'>".$result->getTextSnippet($terms)."</div>";
@@ -1269,12 +1349,20 @@
12701350 $related = '';
12711351 if( $result->hasRelated() ){
12721352 $st = SpecialPage::getTitleFor( 'Search' );
1273 - $stParams = wfArrayToCGI( $this->powerSearchOptions(),
1274 - array('search' => wfMsgForContent('searchrelated').':'.$t->getPrefixedText(),
1275 - 'fulltext' => wfMsg('search') ));
 1353+ $stParams = array_merge(
 1354+ $this->powerSearchOptions(),
 1355+ array(
 1356+ 'search' => wfMsgForContent( 'searchrelated' ) . ':' . $t->getPrefixedText(),
 1357+ 'fulltext' => wfMsg( 'search' )
 1358+ )
 1359+ );
12761360
1277 - $related = ' -- ' . $sk->makeKnownLinkObj( $st,
1278 - wfMsg('search-relatedarticle'), $stParams );
 1361+ $related = ' -- ' . $sk->linkKnown(
 1362+ $st,
 1363+ wfMsg('search-relatedarticle'),
 1364+ array(),
 1365+ $stParams
 1366+ );
12791367 }
12801368
12811369 // Include a thumbnail for media files...
@@ -1375,16 +1463,25 @@
13761464 $t = $result->getTitle();
13771465 $sk = $wgUser->getSkin();
13781466
1379 - $link = $sk->makeKnownLinkObj( $t, $result->getTitleSnippet($terms));
 1467+ $link = $sk->linkKnown(
 1468+ $t,
 1469+ $result->getTitleSnippet( $terms )
 1470+ );
13801471
13811472 // format redirect if any
13821473 $redirectTitle = $result->getRedirectTitle();
13831474 $redirectText = $result->getRedirectSnippet($terms);
13841475 $redirect = '';
13851476 if( !is_null($redirectTitle) )
1386 - $redirect = "<span class='searchalttitle'>"
1387 - .wfMsg('search-redirect',$sk->makeKnownLinkObj( $redirectTitle, $redirectText))
1388 - ."</span>";
 1477+ $redirect = "<span class='searchalttitle'>" .
 1478+ wfMsg(
 1479+ 'search-redirect',
 1480+ $sk->linkKnown(
 1481+ $redirectTitle,
 1482+ $redirectText
 1483+ )
 1484+ ) .
 1485+ "</span>";
13891486
13901487 $out = "";
13911488 // display project name
@@ -1400,8 +1497,15 @@
14011498 }
14021499 // "more results" link (special page stuff could be localized, but we might not know target lang)
14031500 $searchTitle = Title::newFromText($t->getInterwiki().":Special:Search");
1404 - $searchLink = $sk->makeKnownLinkObj( $searchTitle, wfMsg('search-interwiki-more'),
1405 - wfArrayToCGI(array('search' => $query, 'fulltext' => 'Search')));
 1501+ $searchLink = $sk->linkKnown(
 1502+ $searchTitle,
 1503+ wfMsg( 'search-interwiki-more' ),
 1504+ array(),
 1505+ array(
 1506+ 'search' => $query,
 1507+ 'fulltext' => 'Search'
 1508+ )
 1509+ );
14061510 $out .= "</ul><div class='mw-search-interwiki-project'><span class='mw-search-interwiki-more'>{$searchLink}</span>{$caption}</div>\n<ul>";
14071511 }
14081512
Index: trunk/phase3/includes/specials/SpecialProtectedpages.php
@@ -95,12 +95,23 @@
9696
9797 # Show a link to the change protection form for allowed users otherwise a link to the protection log
9898 if( $wgUser->isAllowed( 'protect' ) ) {
99 - $changeProtection = ' (' . $skin->makeKnownLinkObj( $title, wfMsgHtml( 'protect_change' ),
100 - 'action=unprotect' ) . ')';
 99+ $changeProtection = ' (' . $skin->linkKnown(
 100+ $title,
 101+ wfMsgHtml( 'protect_change' ),
 102+ array(),
 103+ array( 'action' => 'unprotect' )
 104+ ) . ')';
101105 } else {
102106 $ltitle = SpecialPage::getTitleFor( 'Log' );
103 - $changeProtection = ' (' . $skin->makeKnownLinkObj( $ltitle, wfMsgHtml( 'protectlogpage' ),
104 - 'type=protect&page=' . $title->getPrefixedUrl() ) . ')';
 107+ $changeProtection = ' (' . $skin->linkKnown(
 108+ $ltitle,
 109+ wfMsgHtml( 'protectlogpage' ),
 110+ array(),
 111+ array(
 112+ 'type' => 'protect',
 113+ 'page' => $title->getPrefixedUrl()
 114+ )
 115+ ) . ')';
105116 }
106117
107118 wfProfileOut( __METHOD__ );
@@ -223,6 +234,7 @@
224235
225236 // First pass to load the log names
226237 foreach( $wgRestrictionLevels as $type ) {
 238+ // Messages used can be 'restriction-level-sysop' and 'restriction-level-autoconfirmed'
227239 if( $type !='' && $type !='*') {
228240 $text = wfMsg("restriction-level-$type");
229241 $m[$text] = $type;
Index: trunk/phase3/includes/specials/SpecialMostlinked.php
@@ -62,7 +62,7 @@
6363 */
6464 function makeWlhLink( &$title, $caption, &$skin ) {
6565 $wlh = SpecialPage::getTitleFor( 'Whatlinkshere', $title->getPrefixedDBkey() );
66 - return $skin->makeKnownLinkObj( $wlh, $caption );
 66+ return $skin->linkKnown( $wlh, $caption );
6767 }
6868
6969 /**
Index: trunk/phase3/includes/specials/SpecialLinkSearch.php
@@ -151,7 +151,7 @@
152152 function formatResult( $skin, $result ) {
153153 $title = Title::makeTitle( $result->namespace, $result->title );
154154 $url = $result->url;
155 - $pageLink = $skin->makeKnownLinkObj( $title );
 155+ $pageLink = $skin->linkKnown( $title );
156156 $urlLink = $skin->makeExternalLink( $url, $url );
157157
158158 return wfMsgHtml( 'linksearch-line', $urlLink, $pageLink );
Index: trunk/phase3/includes/specials/SpecialBrokenRedirects.php
@@ -64,15 +64,30 @@
6565 return '<s>' . $skin->link( $fromObj ) . '</s>';
6666 }
6767
68 - $from = $skin->makeKnownLinkObj( $fromObj ,'', 'redirect=no' );
69 - $edit = $skin->makeKnownLinkObj( $fromObj, wfMsgHtml( 'brokenredirects-edit' ), 'action=edit' );
 68+ $from = $skin->linkKnown(
 69+ $fromObj,
 70+ null,
 71+ array(),
 72+ array( 'redirect' => 'no' )
 73+ );
 74+ $edit = $skin->linkKnown(
 75+ $fromObj,
 76+ wfMsgHtml( 'brokenredirects-edit' ),
 77+ array(),
 78+ array( 'action' => 'edit' )
 79+ );
7080 $to = $skin->makeBrokenLinkObj( $toObj );
7181 $arr = $wgContLang->getArrow();
7282
7383 $out = "{$from} {$edit}";
7484
7585 if( $wgUser->isAllowed( 'delete' ) ) {
76 - $delete = $skin->makeKnownLinkObj( $fromObj, wfMsgHtml( 'brokenredirects-delete' ), 'action=delete' );
 86+ $delete = $skin->linkKnown(
 87+ $fromObj,
 88+ wfMsgHtml( 'brokenredirects-delete' ),
 89+ array(),
 90+ array( 'action' => 'delete' )
 91+ );
7792 $out .= " {$delete}";
7893 }
7994
Index: trunk/phase3/includes/specials/SpecialWatchlist.php
@@ -21,8 +21,12 @@
2222 # Anons don't get a watchlist
2323 if( $wgUser->isAnon() ) {
2424 $wgOut->setPageTitle( wfMsg( 'watchnologin' ) );
25 - $llink = $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Userlogin' ),
26 - wfMsgHtml( 'loginreqlink' ), 'returnto=' . $specialTitle->getPrefixedUrl() );
 25+ $llink = $skin->linkKnown(
 26+ SpecialPage::getTitleFor( 'Userlogin' ),
 27+ wfMsgHtml( 'loginreqlink' ),
 28+ array(),
 29+ array( 'returnto' => $specialTitle->getPrefixedUrl() )
 30+ );
2731 $wgOut->addHTML( wfMsgWikiHtml( 'watchlistanontext', $llink ) );
2832 return;
2933 }
@@ -256,34 +260,100 @@
257261 $hideLinktext = wfMsgHtml( 'hide' );
258262 # Hide/show minor edits
259263 $label = $hideMinor ? $showLinktext : $hideLinktext;
260 - $linkBits = wfArrayToCGI( array( 'hideMinor' => 1 - (int)$hideMinor ), $nondefaults );
261 - $links[] = wfMsgHtml( 'rcshowhideminor', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) );
 264+ $linkBits = array_merge(
 265+ array( 'hideMinor' => 1 - (int)$hideMinor ),
 266+ $nondefaults
 267+ );
 268+ $links[] = wfMsgHtml(
 269+ 'rcshowhideminor',
 270+ $skin->linkKnown(
 271+ $thisTitle,
 272+ $label,
 273+ array(),
 274+ $linkBits
 275+ )
 276+ );
262277
263278 # Hide/show bot edits
264279 $label = $hideBots ? $showLinktext : $hideLinktext;
265 - $linkBits = wfArrayToCGI( array( 'hideBots' => 1 - (int)$hideBots ), $nondefaults );
266 - $links[] = wfMsgHtml( 'rcshowhidebots', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) );
 280+ $linkBits = array_merge(
 281+ array( 'hideBots' => 1 - (int)$hideBots ),
 282+ $nondefaults
 283+ );
 284+ $links[] = wfMsgHtml(
 285+ 'rcshowhidebots',
 286+ $skin->linkKnown(
 287+ $thisTitle,
 288+ $label,
 289+ array(),
 290+ $linkBits
 291+ )
 292+ );
267293
268294 # Hide/show anonymous edits
269295 $label = $hideAnons ? $showLinktext : $hideLinktext;
270 - $linkBits = wfArrayToCGI( array( 'hideAnons' => 1 - (int)$hideAnons ), $nondefaults );
271 - $links[] = wfMsgHtml( 'rcshowhideanons', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) );
 296+ $linkBits = array_merge(
 297+ array( 'hideAnons' => 1 - (int)$hideAnons ),
 298+ $nondefaults
 299+ );
 300+ $links[] = wfMsgHtml(
 301+ 'rcshowhideanons',
 302+ $skin->linkKnown(
 303+ $thisTitle,
 304+ $label,
 305+ array(),
 306+ $linkBits
 307+ )
 308+ );
272309
273310 # Hide/show logged in edits
274311 $label = $hideLiu ? $showLinktext : $hideLinktext;
275 - $linkBits = wfArrayToCGI( array( 'hideLiu' => 1 - (int)$hideLiu ), $nondefaults );
276 - $links[] = wfMsgHtml( 'rcshowhideliu', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) );
 312+ $linkBits = array_merge(
 313+ array( 'hideLiu' => 1 - (int)$hideLiu ),
 314+ $nondefaults
 315+ );
 316+ $links[] = wfMsgHtml(
 317+ 'rcshowhideliu',
 318+ $skin->linkKnown(
 319+ $thisTitle,
 320+ $label,
 321+ array(),
 322+ $linkBits
 323+ )
 324+ );
277325
278326 # Hide/show own edits
279327 $label = $hideOwn ? $showLinktext : $hideLinktext;
280 - $linkBits = wfArrayToCGI( array( 'hideOwn' => 1 - (int)$hideOwn ), $nondefaults );
281 - $links[] = wfMsgHtml( 'rcshowhidemine', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) );
 328+ $linkBits = array_merge(
 329+ array( 'hideOwn' => 1 - (int)$hideOwn ),
 330+ $nondefaults
 331+ );
 332+ $links[] = wfMsgHtml(
 333+ 'rcshowhidemine',
 334+ $skin->linkKnown(
 335+ $thisTitle,
 336+ $label,
 337+ array(),
 338+ $linkBits
 339+ )
 340+ );
282341
283342 # Hide/show patrolled edits
284343 if( $wgUser->useRCPatrol() ) {
285344 $label = $hidePatrolled ? $showLinktext : $hideLinktext;
286 - $linkBits = wfArrayToCGI( array( 'hidePatrolled' => 1 - (int)$hidePatrolled ), $nondefaults );
287 - $links[] = wfMsgHtml( 'rcshowhidepatr', $skin->makeKnownLinkObj( $thisTitle, $label, $linkBits ) );
 345+ $linkBits = array_merge(
 346+ array( 'hidePatrolled' => 1 - (int)$hidePatrolled ),
 347+ $nondefaults
 348+ );
 349+ $links[] = wfMsgHtml(
 350+ 'rcshowhidepatr',
 351+ $skin->linkKnown(
 352+ $thisTitle,
 353+ $label,
 354+ array(),
 355+ $linkBits
 356+ )
 357+ );
288358 }
289359
290360 # Namespace filter and put the whole form together.
Index: trunk/phase3/includes/specials/SpecialImport.php
@@ -136,7 +136,7 @@
137137 if( !$wgUser->isAllowed( 'import' ) && !$wgUser->isAllowed( 'importupload' ) )
138138 return $wgOut->permissionRequired( 'import' );
139139
140 - $action = $this->getTitle()->getLocalUrl( 'action=submit' );
 140+ $action = $this->getTitle()->getLocalUrl( array( 'action' => 'submit' ) );
141141
142142 if( $wgUser->isAllowed( 'importupload' ) ) {
143143 $wgOut->addWikiMsg( "importtext" );
@@ -273,7 +273,7 @@
274274 * @ingroup SpecialPage
275275 */
276276 class ImportReporter {
277 - private $reason=false;
 277+ private $reason=false;
278278
279279 function __construct( $importer, $upload, $interwiki , $reason=false ) {
280280 $importer->setPageOutCallback( array( $this, 'reportPage' ) );
@@ -299,7 +299,7 @@
300300 $contentCount = $wgContLang->formatNum( $successCount );
301301
302302 if( $successCount > 0 ) {
303 - $wgOut->addHTML( "<li>" . $skin->makeKnownLinkObj( $title ) . " " .
 303+ $wgOut->addHTML( "<li>" . $skin->linkKnown( $title ) . " " .
304304 wfMsgExt( 'import-revision-count', array( 'parsemag', 'escape' ), $localCount ) .
305305 "</li>\n"
306306 );
@@ -309,7 +309,7 @@
310310 $detail = wfMsgExt( 'import-logentry-upload-detail', array( 'content', 'parsemag' ),
311311 $contentCount );
312312 if ( $this->reason ) {
313 - $detail .= wfMsgForContent( 'colon-separator' ) . $this->reason;
 313+ $detail .= wfMsgForContent( 'colon-separator' ) . $this->reason;
314314 }
315315 $log->addEntry( 'upload', $title, $detail );
316316 } else {
@@ -318,7 +318,7 @@
319319 $detail = wfMsgExt( 'import-logentry-interwiki-detail', array( 'content', 'parsemag' ),
320320 $contentCount, $interwiki );
321321 if ( $this->reason ) {
322 - $detail .= wfMsgForContent( 'colon-separator' ) . $this->reason;
 322+ $detail .= wfMsgForContent( 'colon-separator' ) . $this->reason;
323323 }
324324 $log->addEntry( 'interwiki', $title, $detail );
325325 }
Index: trunk/phase3/includes/specials/SpecialPrefixindex.php
@@ -136,7 +136,10 @@
137137 $t = Title::makeTitle( $s->page_namespace, $s->page_title );
138138 if( $t ) {
139139 $link = ($s->page_is_redirect ? '<div class="allpagesredirect">' : '' ) .
140 - $sk->makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false ) .
 140+ $sk->linkKnown(
 141+ $t,
 142+ htmlspecialchars( $t->getText() )
 143+ ) .
141144 ($s->page_is_redirect ? '</div>' : '' );
142145 } else {
143146 $link = '[[' . htmlspecialchars( $s->page_title ) . ']]';
@@ -170,17 +173,26 @@
171174 $nsForm .
172175 '</td>
173176 <td id="mw-prefixindex-nav-form">' .
174 - $sk->makeKnownLinkObj( $self, wfMsgHtml( 'allpages' ) );
 177+ $sk->linkKnown( $self, wfMsgHtml( 'allpages' ) );
175178
176179 if( isset( $res ) && $res && ( $n == $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
177 - $namespaceparam = $namespace ? "&namespace=$namespace" : "";
 180+ $query = array(
 181+ 'from' => $s->page_title,
 182+ 'prefix' => $prefix
 183+ );
 184+
 185+ if( $namespace ) {
 186+ $query['namespace'] = $namespace;
 187+ }
 188+
178189 $out2 = $wgLang->pipeList( array(
179190 $out2,
180 - $sk->makeKnownLinkObj(
 191+ $sk->linkKnown(
181192 $self,
182193 wfMsgHtml( 'nextpage', str_replace( '_',' ', htmlspecialchars( $s->page_title ) ) ),
183 - "from=" . wfUrlEncode( $s->page_title ) .
184 - "&prefix=" . wfUrlEncode( $prefix ) . $namespaceparam )
 194+ array(),
 195+ $query
 196+ )
185197 ) );
186198 }
187199 $out2 .= "</td></tr>" .
Index: trunk/phase3/includes/specials/SpecialDeletedContributions.php
@@ -126,23 +126,41 @@
127127 $undelete = SpecialPage::getTitleFor( 'Undelete' );
128128
129129 $logs = SpecialPage::getTitleFor( 'Log' );
130 - $dellog = $sk->makeKnownLinkObj( $logs,
 130+ $dellog = $sk->linkKnown(
 131+ $logs,
131132 $this->messages['deletionlog'],
132 - 'type=delete&page=' . $page->getPrefixedUrl() );
 133+ array(),
 134+ array(
 135+ 'type' => 'delete',
 136+ 'page' => $page->getPrefixedUrl()
 137+ )
 138+ );
133139
134 - $reviewlink = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Undelete', $page->getPrefixedDBkey() ),
135 - $this->messages['undeletebtn'] );
 140+ $reviewlink = $sk->linkKnown(
 141+ SpecialPage::getTitleFor( 'Undelete', $page->getPrefixedDBkey() ),
 142+ $this->messages['undeletebtn']
 143+ );
136144
137 - $link = $sk->makeKnownLinkObj( $undelete,
 145+ $link = $sk->linkKnown(
 146+ $undelete,
138147 htmlspecialchars( $page->getPrefixedText() ),
139 - 'target=' . $page->getPrefixedUrl() .
140 - '&timestamp=' . $rev->getTimestamp() );
 148+ array(),
 149+ array(
 150+ 'target' => $page->getPrefixedUrl(),
 151+ 'timestamp' => $rev->getTimestamp()
 152+ )
 153+ );
141154
142 - $last = $sk->makeKnownLinkObj( $undelete,
 155+ $last = $sk->linkKnown(
 156+ $undelete,
143157 $this->messages['diff'],
144 - "target=" . $page->getPrefixedUrl() .
145 - "&timestamp=" . $rev->getTimestamp() .
146 - "&diff=prev" );
 158+ array(),
 159+ array(
 160+ 'target' => $page->getPrefixedUrl(),
 161+ 'timestamp' => $rev->getTimestamp(),
 162+ 'diff' => 'prev'
 163+ )
 164+ );
147165
148166 $comment = $sk->revComment( $rev );
149167 $d = htmlspecialchars( $wgLang->timeanddate( $rev->getTimestamp(), true ) );
@@ -150,9 +168,15 @@
151169 if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
152170 $d = '<span class="history-deleted">' . $d . '</span>';
153171 } else {
154 - $link = $sk->makeKnownLinkObj( $undelete, $d,
155 - 'target=' . $page->getPrefixedUrl() .
156 - '&timestamp=' . $rev->getTimestamp() );
 172+ $link = $sk->linkKnown(
 173+ $undelete,
 174+ $d,
 175+ array(),
 176+ array(
 177+ 'target' => $page->getPrefixedUrl(),
 178+ 'timestamp' => $rev->getTimestamp()
 179+ )
 180+ );
157181 }
158182
159183 $pagelink = $sk->link( $page );
@@ -312,19 +336,34 @@
313337 if( ( $id != 0 && $wgSysopUserBans ) || ( $id == 0 && User::isIP( $nt->getText() ) ) ) {
314338 # Block link
315339 if( $wgUser->isAllowed( 'block' ) )
316 - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ),
317 - wfMsgHtml( 'blocklink' ) );
 340+ $tools[] = $sk->linkKnown(
 341+ SpecialPage::getTitleFor( 'Blockip', $nt->getDBkey() ),
 342+ wfMsgHtml( 'blocklink' )
 343+ );
318344 # Block log link
319 - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ),
320 - wfMsgHtml( 'sp-contributions-blocklog' ), 'type=block&page=' . $nt->getPrefixedUrl() );
 345+ $tools[] = $sk->linkKnown(
 346+ SpecialPage::getTitleFor( 'Log' ),
 347+ wfMsgHtml( 'sp-contributions-blocklog' ),
 348+ array(),
 349+ array(
 350+ 'type' => 'block',
 351+ 'page' => $nt->getPrefixedUrl()
 352+ )
 353+ );
321354 }
322355 # Other logs link
323 - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Log' ),
324 - wfMsgHtml( 'sp-contributions-logs' ), 'user=' . $nt->getPartialUrl() );
 356+ $tools[] = $sk->linkKnown(
 357+ SpecialPage::getTitleFor( 'Log' ),
 358+ wfMsgHtml( 'sp-contributions-logs' ),
 359+ array(),
 360+ array( 'user' => $nt->getPartialUrl() )
 361+ );
325362 # Link to undeleted contributions
326 - $tools[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'Contributions', $nt->getDBkey() ),
327 - wfMsgHtml( 'contributions' ) );
328 -
 363+ $tools[] = $sk->linkKnown(
 364+ SpecialPage::getTitleFor( 'Contributions', $nt->getDBkey() ),
 365+ wfMsgHtml( 'contributions' )
 366+ );
 367+
329368 wfRunHooks( 'ContributionsToolLinks', array( $id, $nt, &$tools ) );
330369
331370 $links = $wgLang->pipeList( $tools );
Index: trunk/phase3/includes/specials/SpecialAncientpages.php
@@ -56,7 +56,10 @@
5757
5858 $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true );
5959 $title = Title::makeTitle( $result->namespace, $result->title );
60 - $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
 60+ $link = $skin->linkKnown(
 61+ $title,
 62+ htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) )
 63+ );
6164 return wfSpecialList($link, htmlspecialchars($d) );
6265 }
6366 }
Index: trunk/phase3/includes/specials/SpecialUnwatchedpages.php
@@ -44,8 +44,16 @@
4545 $nt = Title::makeTitle( $result->namespace, $result->title );
4646 $text = $wgContLang->convert( $nt->getPrefixedText() );
4747
48 - $plink = $skin->makeKnownLinkObj( $nt, htmlspecialchars( $text ) );
49 - $wlink = $skin->makeKnownLinkObj( $nt, wfMsgHtml( 'watch' ), 'action=watch' );
 48+ $plink = $skin->linkKnown(
 49+ $nt,
 50+ htmlspecialchars( $text )
 51+ );
 52+ $wlink = $skin->linkKnown(
 53+ $nt,
 54+ wfMsgHtml( 'watch' ),
 55+ array(),
 56+ array( 'action' => 'watch'
 57+ );
5058
5159 return wfSpecialList( $plink, $wlink );
5260 }
Index: trunk/phase3/includes/specials/SpecialMovepage.php
@@ -463,7 +463,7 @@
464464 # be longer than 255 characters.
465465 $newSubpage = Title::makeTitleSafe( $newNs, $newPageName );
466466 if( !$newSubpage ) {
467 - $oldLink = $skin->makeKnownLinkObj( $oldSubpage );
 467+ $oldLink = $skin->linkKnown( $oldSubpage );
468468 $extraOutput []= wfMsgHtml( 'movepage-page-unmoved', $oldLink,
469469 htmlspecialchars(Title::makeName( $newNs, $newPageName )));
470470 continue;
@@ -471,7 +471,7 @@
472472
473473 # This was copy-pasted from Renameuser, bleh.
474474 if ( $newSubpage->exists() && !$oldSubpage->isValidMoveTarget( $newSubpage ) ) {
475 - $link = $skin->makeKnownLinkObj( $newSubpage );
 475+ $link = $skin->linkKnown( $newSubpage );
476476 $extraOutput []= wfMsgHtml( 'movepage-page-exists', $link );
477477 } else {
478478 $success = $oldSubpage->moveTo( $newSubpage, true, $this->reason, $createRedirect );
@@ -479,11 +479,16 @@
480480 if ( $this->fixRedirects ) {
481481 DoubleRedirectJob::fixRedirects( 'move', $oldSubpage, $newSubpage );
482482 }
483 - $oldLink = $skin->makeKnownLinkObj( $oldSubpage, '', 'redirect=no' );
484 - $newLink = $skin->makeKnownLinkObj( $newSubpage );
 483+ $oldLink = $skin->linkKnown(
 484+ $oldSubpage,
 485+ null,
 486+ array(),
 487+ array( 'redirect' => 'no' )
 488+ );
 489+ $newLink = $skin->linkKnown( $newSubpage );
485490 $extraOutput []= wfMsgHtml( 'movepage-page-moved', $oldLink, $newLink );
486491 } else {
487 - $oldLink = $skin->makeKnownLinkObj( $oldSubpage );
 492+ $oldLink = $skin->linkKnown( $oldSubpage );
488493 $newLink = $skin->link( $newSubpage );
489494 $extraOutput []= wfMsgHtml( 'movepage-page-unmoved', $oldLink, $newLink );
490495 }
Index: trunk/phase3/includes/specials/SpecialConfirmemail.php
@@ -35,8 +35,12 @@
3636 } else {
3737 $title = SpecialPage::getTitleFor( 'Userlogin' );
3838 $skin = $wgUser->getSkin();
39 - $llink = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'loginreqlink' ),
40 - 'returnto=' . $this->getTitle()->getPrefixedUrl() );
 39+ $llink = $skin->linkKnown(
 40+ $title,
 41+ wfMsgHtml( 'loginreqlink' ),
 42+ array(),
 43+ array( 'returnto' => $this->getTitle()->getPrefixedUrl() )
 44+ );
4145 $wgOut->addHTML( wfMsgWikiHtml( 'confirmemail_needlogin', $llink ) );
4246 }
4347 } else {
Index: trunk/phase3/includes/specials/SpecialMergeHistory.php
@@ -155,7 +155,7 @@
156156 $haveRevisions = $revisions && $revisions->getNumRows() > 0;
157157
158158 $titleObj = SpecialPage::getTitleFor( "Mergehistory" );
159 - $action = $titleObj->getLocalURL( "action=submit" );
 159+ $action = $titleObj->getLocalURL( array( 'action' => 'submit' ) );
160160 # Start the form here
161161 $top = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'merge' ) );
162162 $wgOut->addHTML( $top );
@@ -228,8 +228,12 @@
229229 $ts = wfTimestamp( TS_MW, $row->rev_timestamp );
230230 $checkBox = Xml::radio( "mergepoint", $ts, false );
231231
232 - $pageLink = $this->sk->makeKnownLinkObj( $rev->getTitle(),
233 - htmlspecialchars( $wgLang->timeanddate( $ts ) ), 'oldid=' . $rev->getId() );
 232+ $pageLink = $this->sk->linkKnown(
 233+ $rev->getTitle(),
 234+ htmlspecialchars( $wgLang->timeanddate( $ts ) ),
 235+ array(),
 236+ array( 'oldid' => $rev->getId() )
 237+ );
234238 if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
235239 $pageLink = '<span class="history-deleted">' . $pageLink . '</span>';
236240 }
@@ -238,8 +242,15 @@
239243 if( !$rev->userCan( Revision::DELETED_TEXT ) )
240244 $last = $this->message['last'];
241245 else if( isset($this->prevId[$row->rev_id]) )
242 - $last = $this->sk->makeKnownLinkObj( $rev->getTitle(), $this->message['last'],
243 - "diff=" . $row->rev_id . "&oldid=" . $this->prevId[$row->rev_id] );
 246+ $last = $this->sk->linkKnown(
 247+ $rev->getTitle(),
 248+ $this->message['last'],
 249+ array(),
 250+ array(
 251+ 'diff' => $row->rev_id,
 252+ 'oldid' => $this->prevId[$row->rev_id]
 253+ )
 254+ );
244255
245256 $userLink = $this->sk->revUserTools( $rev );
246257
@@ -261,8 +272,15 @@
262273 if( !$this->userCan($row, Revision::DELETED_TEXT) ) {
263274 return '<span class="history-deleted">' . $wgLang->timeanddate( $ts, true ) . '</span>';
264275 } else {
265 - $link = $this->sk->makeKnownLinkObj( $titleObj,
266 - $wgLang->timeanddate( $ts, true ), "target=$target&timestamp=$ts" );
 276+ $link = $this->sk->linkKnown(
 277+ $titleObj,
 278+ $wgLang->timeanddate( $ts, true ),
 279+ array(),
 280+ array(
 281+ 'target' => $target,
 282+ 'timestamp' => $ts
 283+ )
 284+ );
267285 if( $this->isDeleted($row, Revision::DELETED_TEXT) )
268286 $link = '<span class="history-deleted">' . $link . '</span>';
269287 return $link;
Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php
@@ -186,16 +186,28 @@
187187 if( $this->targetObj ) {
188188 $links = array();
189189 $logtitle = SpecialPage::getTitleFor( 'Log' );
190 - $links[] = $this->skin->makeKnownLinkObj( $logtitle, wfMsgHtml( 'viewpagelogs' ),
191 - wfArrayToCGI( array( 'page' => $this->targetObj->getPrefixedUrl() ) ) );
 190+ $links[] = $this->skin->linkKnown(
 191+ $logtitle,
 192+ wfMsgHtml( 'viewpagelogs' ),
 193+ array(),
 194+ array( 'page' => $this->targetObj->getPrefixedUrl() )
 195+ );
192196 # Give a link to the page history
193 - $links[] = $this->skin->makeKnownLinkObj( $this->targetObj, wfMsgHtml( 'pagehist' ),
194 - wfArrayToCGI( array( 'action' => 'history' ) ) );
 197+ $links[] = $this->skin->linkKnown(
 198+ $this->targetObj,
 199+ wfMsgHtml( 'pagehist' ),
 200+ array(),
 201+ array( 'action' => 'history' )
 202+ );
195203 # Link to deleted edits
196204 if( $wgUser->isAllowed('undelete') ) {
197205 $undelete = SpecialPage::getTitleFor( 'Undelete' );
198 - $links[] = $this->skin->makeKnownLinkObj( $undelete, wfMsgHtml( 'deletedhist' ),
199 - wfArrayToCGI( array( 'target' => $this->targetObj->getPrefixedDBkey() ) ) );
 206+ $links[] = $this->skin->linkKnown(
 207+ $undelete,
 208+ wfMsgHtml( 'deletedhist' ),
 209+ array(),
 210+ array( 'target' => $this->targetObj->getPrefixedDBkey() )
 211+ );
200212 }
201213 # Logs themselves don't have histories or archived revisions
202214 $wgOut->setSubtitle( '<p>'.implode($links,' / ').'</p>' );
Index: trunk/phase3/includes/specials/SpecialUnusedtemplates.php
@@ -33,11 +33,18 @@
3434
3535 function formatResult( $skin, $result ) {
3636 $title = Title::makeTitle( NS_TEMPLATE, $result->title );
37 - $pageLink = $skin->makeKnownLinkObj( $title, '', 'redirect=no' );
38 - $wlhLink = $skin->makeKnownLinkObj(
 37+ $pageLink = $skin->linkKnown(
 38+ $title,
 39+ null,
 40+ array(),
 41+ array( 'redirect' => 'no' )
 42+ );
 43+ $wlhLink = $skin->linkKnown(
3944 SpecialPage::getTitleFor( 'Whatlinkshere' ),
4045 wfMsgHtml( 'unusedtemplateswlh' ),
41 - 'target=' . $title->getPrefixedUrl() );
 46+ array(),
 47+ array( 'target' => $title->getPrefixedUrl() )
 48+ );
4249 return wfSpecialList( $pageLink, $wlhLink );
4350 }
4451
Index: trunk/phase3/includes/specials/SpecialBlockip.php
@@ -668,13 +668,21 @@
669669 */
670670 private function getUnblockLink( $skin ) {
671671 $list = SpecialPage::getTitleFor( 'Ipblocklist' );
 672+ $query = array( 'action' => 'unblock' );
 673+
672674 if( $this->BlockAddress ) {
673675 $addr = htmlspecialchars( strtr( $this->BlockAddress, '_', ' ' ) );
674 - return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-unblock-addr', $addr ),
675 - 'action=unblock&ip=' . urlencode( $this->BlockAddress ) );
 676+ $message = wfMsgHtml( 'ipb-unblock-addr', $addr );
 677+ $query['ip'] = $this->BlockAddress;
676678 } else {
677 - return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-unblock' ), 'action=unblock' );
 679+ $message = wfMsgHtml( 'ipb-unblock' );
678680 }
 681+ return $skin->linkKnown(
 682+ $list,
 683+ $message,
 684+ array(),
 685+ $query
 686+ );
679687 }
680688
681689 /**
@@ -685,13 +693,22 @@
686694 */
687695 private function getBlockListLink( $skin ) {
688696 $list = SpecialPage::getTitleFor( 'Ipblocklist' );
 697+ $query = array();
 698+
689699 if( $this->BlockAddress ) {
690700 $addr = htmlspecialchars( strtr( $this->BlockAddress, '_', ' ' ) );
691 - return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-blocklist-addr', $addr ),
692 - 'ip=' . urlencode( $this->BlockAddress ) );
 701+ $message = wfMsgHtml( 'ipb-blocklist-addr', $addr );
 702+ $query['ip'] = $this->BlockAddress;
693703 } else {
694 - return $skin->makeKnownLinkObj( $list, wfMsgHtml( 'ipb-blocklist' ) );
 704+ $message = wfMsgHtml( 'ipb-blocklist' );
695705 }
 706+
 707+ return $skin->linkKnown(
 708+ $list,
 709+ $message,
 710+ array(),
 711+ $query
 712+ );
696713 }
697714
698715 /**
Index: trunk/phase3/includes/specials/SpecialMostrevisions.php
@@ -42,11 +42,16 @@
4343 $nt = Title::makeTitle( $result->namespace, $result->title );
4444 $text = $wgContLang->convert( $nt->getPrefixedText() );
4545
46 - $plink = $skin->makeKnownLinkObj( $nt, $text );
 46+ $plink = $skin->linkKnown( $nt, $text );
4747
4848 $nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape'),
4949 $wgLang->formatNum( $result->value ) );
50 - $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' );
 50+ $nlink = $skin->linkKnown(
 51+ $nt,
 52+ $nl,
 53+ array(),
 54+ array( 'action' => 'history' )
 55+ );
5156
5257 return wfSpecialList($plink, $nlink);
5358 }
Index: trunk/phase3/includes/specials/SpecialAllpages.php
@@ -70,45 +70,45 @@
7171 * @param string $to dbKey we are ending listing at.
7272 */
7373 function namespaceForm( $namespace = NS_MAIN, $from = '', $to = '' ) {
74 - global $wgScript;
75 - $t = $this->getTitle();
76 -
77 - $out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) );
78 - $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
79 - $out .= Xml::hidden( 'title', $t->getPrefixedText() );
80 - $out .= Xml::openElement( 'fieldset' );
81 - $out .= Xml::element( 'legend', null, wfMsg( 'allpages' ) );
82 - $out .= Xml::openElement( 'table', array( 'id' => 'nsselect', 'class' => 'allpages' ) );
83 - $out .= "<tr>
84 - <td class='mw-label'>" .
85 - Xml::label( wfMsg( 'allpagesfrom' ), 'nsfrom' ) .
86 - "</td>
87 - <td class='mw-input'>" .
88 - Xml::input( 'from', 30, str_replace('_',' ',$from), array( 'id' => 'nsfrom' ) ) .
89 - "</td>
90 - </tr>
91 - <tr>
92 - <td class='mw-label'>" .
93 - Xml::label( wfMsg( 'allpagesto' ), 'nsto' ) .
94 - "</td>
95 - <td class='mw-input'>" .
96 - Xml::input( 'to', 30, str_replace('_',' ',$to), array( 'id' => 'nsto' ) ) .
97 - "</td>
98 - </tr>
99 - <tr>
100 - <td class='mw-label'>" .
101 - Xml::label( wfMsg( 'namespace' ), 'namespace' ) .
102 - "</td>
103 - <td class='mw-input'>" .
104 - Xml::namespaceSelector( $namespace, null ) . ' ' .
105 - Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .
106 - "</td>
107 - </tr>";
108 - $out .= Xml::closeElement( 'table' );
109 - $out .= Xml::closeElement( 'fieldset' );
110 - $out .= Xml::closeElement( 'form' );
111 - $out .= Xml::closeElement( 'div' );
112 - return $out;
 74+ global $wgScript;
 75+ $t = $this->getTitle();
 76+
 77+ $out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) );
 78+ $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
 79+ $out .= Xml::hidden( 'title', $t->getPrefixedText() );
 80+ $out .= Xml::openElement( 'fieldset' );
 81+ $out .= Xml::element( 'legend', null, wfMsg( 'allpages' ) );
 82+ $out .= Xml::openElement( 'table', array( 'id' => 'nsselect', 'class' => 'allpages' ) );
 83+ $out .= "<tr>
 84+ <td class='mw-label'>" .
 85+ Xml::label( wfMsg( 'allpagesfrom' ), 'nsfrom' ) .
 86+ " </td>
 87+ <td class='mw-input'>" .
 88+ Xml::input( 'from', 30, str_replace('_',' ',$from), array( 'id' => 'nsfrom' ) ) .
 89+ " </td>
 90+</tr>
 91+<tr>
 92+ <td class='mw-label'>" .
 93+ Xml::label( wfMsg( 'allpagesto' ), 'nsto' ) .
 94+ " </td>
 95+ <td class='mw-input'>" .
 96+ Xml::input( 'to', 30, str_replace('_',' ',$to), array( 'id' => 'nsto' ) ) .
 97+ " </td>
 98+</tr>
 99+<tr>
 100+ <td class='mw-label'>" .
 101+ Xml::label( wfMsg( 'namespace' ), 'namespace' ) .
 102+ " </td>
 103+ <td class='mw-input'>" .
 104+ Xml::namespaceSelector( $namespace, null ) . ' ' .
 105+ Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .
 106+ " </td>
 107+</tr>";
 108+ $out .= Xml::closeElement( 'table' );
 109+ $out .= Xml::closeElement( 'fieldset' );
 110+ $out .= Xml::closeElement( 'form' );
 111+ $out .= Xml::closeElement( 'div' );
 112+ return $out;
113113 }
114114
115115 /**
@@ -307,7 +307,7 @@
308308 $t = Title::makeTitle( $s->page_namespace, $s->page_title );
309309 if( $t ) {
310310 $link = ( $s->page_is_redirect ? '<div class="allpagesredirect">' : '' ) .
311 - $sk->makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false ) .
 311+ $sk->linkKnown( $t, htmlspecialchars( $t->getText() ) ) .
312312 ($s->page_is_redirect ? '</div>' : '' );
313313 } else {
314314 $link = '[[' . htmlspecialchars( $s->page_title ) . ']]';
@@ -384,20 +384,34 @@
385385
386386 # Do we put a previous link ?
387387 if( isset( $prevTitle ) && $pt = $prevTitle->getText() ) {
388 - $q = 'from=' . $prevTitle->getPartialUrl()
389 - . ( $namespace ? '&namespace=' . $namespace : '' );
390 - $prevLink = $sk->makeKnownLinkObj( $self,
391 - wfMsgHTML( 'prevpage', htmlspecialchars( $pt ) ), $q );
 388+ $query = array( 'from' => $prevTitle->getPartialUrl() );
 389+
 390+ if( $namespace )
 391+ $query['namespace'] = $namespace;
 392+
 393+ $prevLink = $sk->linkKnown(
 394+ $self,
 395+ wfMsgHTML( 'prevpage', htmlspecialchars( $pt ) ),
 396+ array(),
 397+ $query
 398+ );
392399 $out2 = $wgLang->pipeList( array( $out2, $prevLink ) );
393400 }
394401
395402 if( $n == $this->maxPerPage && $s = $res->fetchObject() ) {
396403 # $s is the first link of the next chunk
397404 $t = Title::MakeTitle($namespace, $s->page_title);
398 - $q = 'from=' . $t->getPartialUrl()
399 - . ( $namespace ? '&namespace=' . $namespace : '' );
400 - $nextLink = $sk->makeKnownLinkObj( $self,
401 - wfMsgHtml( 'nextpage', htmlspecialchars( $t->getText() ) ), $q );
 405+ $query = array( 'from' => $t->getPartialUrl() );
 406+
 407+ if( $namespace )
 408+ $query['namespace'] = $namespace;
 409+
 410+ $nextLink = $sk->linkKnown(
 411+ $self,
 412+ wfMsgHtml( 'nextpage', htmlspecialchars( $t->getText() ) ),
 413+ array(),
 414+ $query
 415+ );
402416 $out2 = $wgLang->pipeList( array( $out2, $nextLink ) );
403417 }
404418 $out2 .= "</td></tr></table>";
Index: trunk/phase3/includes/specials/SpecialListfiles.php
@@ -133,7 +133,7 @@
134134 if ( $imgfile === null ) $imgfile = wfMsg( 'imgfile' );
135135
136136 $name = $this->mCurrentRow->img_name;
137 - $link = $this->getSkin()->makeKnownLinkObj( Title::makeTitle( NS_FILE, $name ), $value );
 137+ $link = $this->getSkin()->linkKnown( Title::makeTitle( NS_FILE, $name ), $value );
138138 $image = wfLocalFile( $value );
139139 $url = $image->getURL();
140140 $download = Xml::element('a', array( 'href' => $url ), $imgfile );
Index: trunk/phase3/includes/specials/SpecialUndelete.php
@@ -677,8 +677,12 @@
678678 $wgOut->addHTML( "<ul>\n" );
679679 while( $row = $result->fetchObject() ) {
680680 $title = Title::makeTitleSafe( $row->ar_namespace, $row->ar_title );
681 - $link = $sk->makeKnownLinkObj( $undelete, htmlspecialchars( $title->getPrefixedText() ),
682 - 'target=' . $title->getPrefixedUrl() );
 681+ $link = $sk->linkKnown(
 682+ $undelete,
 683+ htmlspecialchars( $title->getPrefixedText() ),
 684+ array(),
 685+ array( 'target' => $title->getPrefixedUrl() )
 686+ );
683687 $revs = wfMsgExt( 'undeleterevisions',
684688 array( 'parseinline' ),
685689 $wgLang->formatNum( $row->count ) );
@@ -718,7 +722,7 @@
719723
720724 $wgOut->setPageTitle( wfMsg( 'undeletepage' ) );
721725
722 - $link = $skin->makeKnownLinkObj(
 726+ $link = $skin->linkKnown(
723727 SpecialPage::getTitleFor( 'Undelete', $this->mTargetObj->getPrefixedDBkey() ),
724728 htmlspecialchars( $this->mTargetObj->getPrefixedText() )
725729 );
@@ -770,7 +774,7 @@
771775 Xml::openElement( 'div' ) .
772776 Xml::openElement( 'form', array(
773777 'method' => 'post',
774 - 'action' => $self->getLocalURL( "action=submit" ) ) ) .
 778+ 'action' => $self->getLocalURL( array( 'action' => 'submit' ) ) ) ) .
775779 Xml::element( 'input', array(
776780 'type' => 'hidden',
777781 'name' => 'target',
@@ -987,7 +991,7 @@
988992
989993 if ( $this->mAllowed ) {
990994 $titleObj = SpecialPage::getTitleFor( "Undelete" );
991 - $action = $titleObj->getLocalURL( "action=submit" );
 995+ $action = $titleObj->getLocalURL( array( 'action' => 'submit' ) );
992996 # Start the form here
993997 $top = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $action, 'id' => 'undelete' ) );
994998 $wgOut->addHTML( $top );
@@ -1111,8 +1115,16 @@
11121116 if( !$rev->userCan( Revision::DELETED_TEXT ) ) {
11131117 $last = wfMsgHtml('diff');
11141118 } else if( $remaining > 0 || ($earliestLiveTime && $ts > $earliestLiveTime) ) {
1115 - $last = $sk->makeKnownLinkObj( $titleObj, wfMsgHtml('diff'),
1116 - "target=" . $this->mTargetObj->getPrefixedUrl() . "&timestamp=$ts&diff=prev" );
 1119+ $last = $sk->linkKnown(
 1120+ $titleObj,
 1121+ wfMsgHtml('diff'),
 1122+ array(),
 1123+ array(
 1124+ 'target' => $this->mTargetObj->getPrefixedUrl(),
 1125+ 'timestamp' => $ts,
 1126+ 'diff' => 'prev'
 1127+ )
 1128+ );
11171129 } else {
11181130 $last = wfMsgHtml('diff');
11191131 }
@@ -1201,8 +1213,15 @@
12021214 if( !$rev->userCan(Revision::DELETED_TEXT) ) {
12031215 return '<span class="history-deleted">' . $time . '</span>';
12041216 } else {
1205 - $link = $sk->makeKnownLinkObj( $titleObj, $time,
1206 - "target=".$this->mTargetObj->getPrefixedUrl()."&timestamp=$ts" );
 1217+ $link = $sk->linkKnown(
 1218+ $titleObj,
 1219+ $time,
 1220+ array(),
 1221+ array(
 1222+ 'target' => $this->mTargetObj->getPrefixedUrl(),
 1223+ 'timestamp' => $ts
 1224+ )
 1225+ );
12071226 if( $rev->isDeleted(Revision::DELETED_TEXT) )
12081227 $link = '<span class="history-deleted">' . $link . '</span>';
12091228 return $link;
@@ -1219,10 +1238,16 @@
12201239 if( !$file->userCan(File::DELETED_FILE) ) {
12211240 return '<span class="history-deleted">' . $wgLang->timeanddate( $ts, true ) . '</span>';
12221241 } else {
1223 - $link = $sk->makeKnownLinkObj( $titleObj, $wgLang->timeanddate( $ts, true ),
1224 - "target=".$this->mTargetObj->getPrefixedUrl().
1225 - "&file=$key" .
1226 - "&token=" . urlencode( $wgUser->editToken( $key ) ) );
 1242+ $link = $sk->linkKnown(
 1243+ $titleObj,
 1244+ $wgLang->timeanddate( $ts, true ),
 1245+ array(),
 1246+ array(
 1247+ 'target' => $this->mTargetObj->getPrefixedUrl(),
 1248+ 'file' => $key,
 1249+ 'token' => $wgUser->editToken( $key )
 1250+ )
 1251+ );
12271252 if( $file->isDeleted(File::DELETED_FILE) )
12281253 $link = '<span class="history-deleted">' . $link . '</span>';
12291254 return $link;
@@ -1281,7 +1306,7 @@
12821307 $wgUser, $this->mComment) );
12831308
12841309 $skin = $wgUser->getSkin();
1285 - $link = $skin->makeKnownLinkObj( $this->mTargetObj );
 1310+ $link = $skin->linkKnown( $this->mTargetObj );
12861311 $wgOut->addHTML( wfMsgWikiHtml( 'undeletedpage', $link ) );
12871312 } else {
12881313 $wgOut->showFatalError( wfMsg( "cannotundelete" ) );
Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -1005,12 +1005,17 @@
10061006 function makeLanguageSelectorLink( $text, $lang ) {
10071007 global $wgUser;
10081008 $self = SpecialPage::getTitleFor( 'Userlogin' );
1009 - $attr[] = 'uselang=' . $lang;
 1009+ $attr = array( 'uselang' => $lang );
10101010 if( $this->mType == 'signup' )
1011 - $attr[] = 'type=signup';
 1011+ $attr['type'] = 'signup';
10121012 if( $this->mReturnTo )
1013 - $attr[] = 'returnto=' . $this->mReturnTo;
 1013+ $attr['returnto'] = $this->mReturnTo;
10141014 $skin = $wgUser->getSkin();
1015 - return $skin->makeKnownLinkObj( $self, htmlspecialchars( $text ), implode( '&', $attr ) );
 1015+ return $skin->linkKnown(
 1016+ $self,
 1017+ htmlspecialchars( $text ),
 1018+ array(),
 1019+ $attr
 1020+ );
10161021 }
10171022 }
Index: trunk/phase3/includes/specials/SpecialWhatlinkshere.php
@@ -258,9 +258,19 @@
259259 }
260260 }
261261
262 - $suppressRedirect = $row->page_is_redirect ? 'redirect=no' : '';
263 - $link = $this->skin->makeKnownLinkObj( $nt, '', $suppressRedirect );
 262+ if( $row->page_is_redirect ) {
 263+ $query = array( 'redirect' => 'no' );
 264+ } else {
 265+ $query = array();
 266+ }
264267
 268+ $link = $this->skin->linkKnown(
 269+ $nt,
 270+ null,
 271+ array(),
 272+ $query
 273+ );
 274+
265275 // Display properties (redirect or template)
266276 $propsText = '';
267277 $props = array();
@@ -294,11 +304,21 @@
295305 $title = SpecialPage::getTitleFor( 'Whatlinkshere' );
296306
297307 $targetText = $target->getPrefixedUrl();
298 - return $this->skin->makeKnownLinkObj( $title, $text, 'target=' . $targetText );
 308+ return $this->skin->linkKnown(
 309+ $title,
 310+ $text,
 311+ array(),
 312+ array( 'target' => $targetText )
 313+ );
299314 }
300315
301316 function makeSelfLink( $text, $query ) {
302 - return $this->skin->makeKnownLinkObj( $this->selfTitle, $text, $query );
 317+ return $this->skin->linkKnown(
 318+ $this->selfTitle,
 319+ $text,
 320+ array(),
 321+ $query
 322+ );
303323 }
304324
305325 function getPrevNext( $prevId, $nextId ) {
@@ -313,18 +333,18 @@
314334
315335 if ( 0 != $prevId ) {
316336 $overrides = array( 'from' => $this->opts->getValue( 'back' ) );
317 - $prev = $this->makeSelfLink( $prev, wfArrayToCGI( $overrides, $changed ) );
 337+ $prev = $this->makeSelfLink( $prev, array_merge( $overrides, $changed ) );
318338 }
319339 if ( 0 != $nextId ) {
320340 $overrides = array( 'from' => $nextId, 'back' => $prevId );
321 - $next = $this->makeSelfLink( $next, wfArrayToCGI( $overrides, $changed ) );
 341+ $next = $this->makeSelfLink( $next, array_merge( $overrides, $changed ) );
322342 }
323343
324344 $limitLinks = array();
325345 foreach ( $this->limits as $limit ) {
326346 $prettyLimit = $wgLang->formatNum( $limit );
327347 $overrides = array( 'limit' => $limit );
328 - $limitLinks[] = $this->makeSelfLink( $prettyLimit, wfArrayToCGI( $overrides, $changed ) );
 348+ $limitLinks[] = $this->makeSelfLink( $prettyLimit, array_merge( $overrides, $changed ) );
329349 }
330350
331351 $nums = $wgLang->pipeList( $limitLinks );
@@ -391,7 +411,7 @@
392412 $chosen = $this->opts->getValue( $type );
393413 $msg = wfMsgHtml( "whatlinkshere-{$type}", $chosen ? $show : $hide );
394414 $overrides = array( $type => !$chosen );
395 - $links[] = $this->makeSelfLink( $msg, wfArrayToCGI( $overrides, $changed ) );
 415+ $links[] = $this->makeSelfLink( $msg, array_merge( $overrides, $changed ) );
396416 }
397417 return Xml::fieldset( wfMsg( 'whatlinkshere-filters' ), $wgLang->pipeList( $links ) );
398418 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r51573Follow-up to r51572: fix parse errorsiebrand19:08, 7 June 2009
r51574Follow-up to r51572. SpecialSearch.php was a bit broken, because methods like...siebrand19:49, 7 June 2009
r52772* (bug 19442) Show/hide options on watchlist only work once...nikerabbit09:11, 5 July 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r51559* replace some use of deprecated makeKnownLinkObj() by link() in core...siebrand22:42, 6 June 2009

Status & tagging log