r90580 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90579‎ | r90580 | r90581 >
Date:12:03, 22 June 2011
Author:reedy
Status:deferred (Comments)
Tags:
Comment:
Followup r87593, fix calls to removed methods
Modified paths:
  • /trunk/extensions/Asksql/Asksql_body.php (modified) (history)
  • /trunk/extensions/ImageTagging/ImageTagging_body.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/MV_ImageGallery.php (modified) (history)
  • /trunk/extensions/TalkHere/TalkHere.php (modified) (history)
  • /trunk/extensions/WikiForum/WikiForumClass.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/Editor.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiForum/WikiForumClass.php
@@ -2341,8 +2341,8 @@
23422342
23432343 if( $username ) {
23442344 $sk = $wgUser->getSkin();
2345 - $retVal = $sk->makeLink(
2346 - $wgContLang->getNsText( NS_USER ) . ':' . $username,
 2345+ $retVal = $sk->makeLinkObj(
 2346+ Title::newFromText( $wgContLang->getNsText( NS_USER ) . ':' . $username ),
23472347 htmlspecialchars( $username )
23482348 );
23492349
Index: trunk/extensions/TalkHere/TalkHere.php
@@ -47,7 +47,7 @@
4848 $html = $out->getHTML();
4949
5050 if ( $returnto ) { //re-target cancel link
51 - $cancel = $sk->makeLink( $returnto, wfMsgExt('cancel', array('parseinline')) );
 51+ $cancel = $sk->makeLinkObj( Title::newFromText( $returnto ), wfMsgExt('cancel', array( 'parseinline' ) ) );
5252 $html = preg_replace( '!<a[^<>]+>[^<>]+</a>( *\| *<a target=["\']helpwindow["\'])!smi', $cancel . '\1', $html );
5353 }
5454 else {
Index: trunk/extensions/Wikidata/OmegaWiki/Editor.php
@@ -2107,7 +2107,7 @@
21082108 $wgUser;
21092109
21102110 if ( $value != "" )
2111 - return $wgUser->getSkin()->makeLink( "User:" . $value, $value );
 2111+ return $wgUser->getSkin()->makeLinkObj( Title::newFromText( "User:" . $value ), $value );
21122112 else
21132113 return "";
21142114 }
Index: trunk/extensions/MetavidWiki/includes/MV_ImageGallery.php
@@ -1,10 +1,10 @@
22 <?php
33 /*
44 * MV_ImageGallery.php Created on Oct 22, 2007
5 - *
 5+ *
66 * All Metavid Wiki code is Released Under the GPL2
77 * for more info visit http://metavid.org/wiki/Code
8 - *
 8+ *
99 * @author Michael Dale
1010 * @email dale@ucsc.edu
1111 * @url http://metavid.org
@@ -37,20 +37,19 @@
3838 foreach ( $this->mImages as $pair ) {
3939 $nt = $pair[0];
4040 $text = $pair[1];
41 -
 41+
4242 # Give extensions a chance to select the file revision for us
4343 $time = false;
4444 wfRunHooks( 'BeforeGalleryFindFile', array( &$this, &$nt, &$time ) );
4545
4646 $img = wfFindFile( $nt, array( 'time' => $time ) );
47 -
48 -
 47+
4948 if ( $nt->getNamespace() == MV_NS_MVD ||
5049 $nt->getNamespace() == MV_NS_STREAM ||
5150 $nt->getNamespace() == MV_NS_SEQUENCE ) { // @@todo fix sequence embed
52 - // $vpad = floor( ( 1.25*$this->mHeights - $thumb->height ) /2 ) - 2;
 51+ // $vpad = floor( ( 1.25*$this->mHeights - $thumb->height ) /2 ) - 2;
5352 $mvTitle = new MV_Title( $nt );
54 -
 53+
5554 // remap MVD namespace links into the Stream view (so contextual metadata is present)
5655 if ( $nt->getNamespace() == MV_NS_MVD ) {
5756 $nt = Title::MakeTitle( MV_NS_STREAM, ucfirst( $mvTitle->getStreamName() ) . '/' . $mvTitle->getTimeRequest() );
@@ -62,7 +61,7 @@
6362 '<div class="thumb" style="padding: 4px 0; width: ' . htmlspecialchars( $this->mWidths + 5 ) . 'px;">'
6463 # Auto-margin centering for block-level elements. Needed now that we have video
6564 # handlers since they may emit block-level elements as opposed to simple <img> tags.
66 - # ref http://css-discuss.incutio.com/?page=CenteringBlockElement
 65+ # ref http://css-discuss.incutio.com/?page=CenteringBlockElement
6766 . '<div style="margin-left: auto; margin-right: auto; width: ' . htmlspecialchars( $this->mWidths ) . 'px;">'
6867 . $sk->makeKnownLinkObj( $nt, '<img title="'. htmlspecialchars($mvTitle->getStreamNameText()) .'"'
6968 . ' width="160" height="120" src="'.$mvTitle->getStreamImageURL('160x120') . '">')
@@ -76,7 +75,7 @@
7776 $nb = '';
7877 $textlink = '';
7978 } else {
80 -
 79+
8180 if ( $nt->getNamespace() != NS_IMAGE || !$img ) {
8281 # We're dealing with a non-image, spit out the name and be done with it.
8382 $thumbhtml = "\n\t\t\t" . '<div style="height: ' . ( $this->mHeights * 1.25 + 2 ) . 'px;">'
@@ -91,7 +90,7 @@
9291 . htmlspecialchars( $img->getLastError() ) . '</div>';
9392 } else {
9493 $vpad = floor( ( 1.25 * $this->mHeights - $thumb->height ) / 2 ) - 2;
95 -
 94+
9695 $thumbhtml = "\n\t\t\t" .
9796 '<div class="thumb" style="padding: ' . htmlspecialchars( $vpad ) . 'px 0; width: ' . htmlspecialchars( $this->mWidths + 30 ) . 'px;">'
9897 # Auto-margin centering for block-level elements. Needed now that we have video
@@ -99,15 +98,12 @@
10099 # ref http://css-discuss.incutio.com/?page=CenteringBlockElement
101100 . '<div style="margin-left: auto; margin-right: auto; width: ' . htmlspecialchars( $this->mWidths ) . 'px;">'
102101 . $thumb->toHtml( array( 'desc-link' => true ) ) . '</div></div>';
103 -
 102+
104103 // Call parser transform hook
105104 if ( $this->mParser && $img->getHandler() ) {
106105 $img->getHandler()->parserTransformHook( $this->mParser, $img );
107106 }
108107 }
109 -
110 - // TODO
111 - // $ul = $sk->makeLink( $wgContLang->getNsText( MWNamespace::getUser() ) . ":{$ut}", $ut );
112108
113109 if ( $this->mShowBytes ) {
114110 if ( $img ) {
@@ -120,7 +116,7 @@
121117 } else {
122118 $nb = '';
123119 }
124 -
 120+
125121 $textlink = $this->mShowFilename ?
126122 $sk->makeKnownLinkObj( $nt, htmlspecialchars( $wgLang->truncate( $nt->getText(), 20 ) ) ) . "<br />\n" :
127123 '' ;
Index: trunk/extensions/ImageTagging/ImageTagging_body.php
@@ -1,6 +1,6 @@
22 <?php
33 /**
4 - * TaggedImages class
 4+ * TaggedImages class
55 *
66 * @file
77 * @ingroup Extensions
@@ -235,7 +235,7 @@
236236 * - the size of the image
237237 */
238238 function toHTML() {
239 - global $wgLang, $wgUser, $wgOut;
 239+ global $wgLang, $wgUser;
240240
241241 $sk = $wgUser->getSkin();
242242
@@ -261,9 +261,6 @@
262262 continue;
263263 }
264264
265 - // TODO - getUser() doesn't exist, do you mean NS_USER?
266 - // $ul = $sk->makeLink( $wgContLang->getNsText( MWNamespace::getUser() ) . ":{$ut}", $ut );
267 -
268265 $nb = '';
269266 $textlink = $this->mShowFilename ?
270267 $sk->makeKnownLinkObj( $nt, htmlspecialchars( $wgLang->truncate( $nt->getText(), 20 ) ) ) . "<br />\n" :
Index: trunk/extensions/Asksql/Asksql_body.php
@@ -13,8 +13,8 @@
1414 function execute( $par ) {
1515 global $wgAllowSysopQueries, $wgUser, $wgRequest, $wgOut;
1616
17 -
1817
 18+
1919 if ( !$wgAllowSysopQueries ) {
2020 throw new ErrorPageError( 'nosuchspecialpage', 'nospecialpagetext' );
2121 }
@@ -141,8 +141,9 @@
142142 } else {
143143 $link = "$sTitle";
144144 }
 145+ $title = Title::newFromText( $link );
145146 $skin = $wgUser->getSkin();
146 - $link = $skin->makeLink( $link );
 147+ $link = $skin->makeLinkObj( $title );
147148 $r .= "* [[$link]]<br />\n";
148149 }
149150 } else {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r87593Documentation...reedy22:53, 6 May 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   01:45, 24 June 2011

MW_EditPageAjax.php is still using makeKnownLink().

Status & tagging log