r86234 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86233‎ | r86234 | r86235 >
Date:20:01, 16 April 2011
Author:happy-melon
Status:resolved (Comments)
Tags:
Comment:
Update Skin.php to not call the now-separate Linker methods via $this->foo().
Modified paths:
  • /trunk/phase3/includes/Skin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Skin.php
@@ -474,6 +474,11 @@
475475 */
476476 abstract function setupSkinUserCss( OutputPage $out );
477477
 478+ /**
 479+ * TODO: document
 480+ * @param $title Title
 481+ * @return String
 482+ */
478483 function getPageClasses( $title ) {
479484 $numeric = 'ns-' . $title->getNamespace();
480485
@@ -542,7 +547,7 @@
543548
544549 $msg = wfMsgExt( 'pagecategories', array( 'parsemag', 'escapenoentities' ), count( $allCats['normal'] ) );
545550 $s .= '<div id="mw-normal-catlinks">' .
546 - $this->link( Title::newFromText( wfMsgForContent( 'pagecategorieslink' ) ), $msg )
 551+ Linker::link( Title::newFromText( wfMsgForContent( 'pagecategorieslink' ) ), $msg )
547552 . $colon . $t . '</div>';
548553 }
549554
@@ -585,10 +590,9 @@
586591 /**
587592 * Render the array as a serie of links.
588593 * @param $tree Array: categories tree returned by Title::getParentCategoryTree
589 - * @param &skin Object: skin passed by reference
590594 * @return String separated by &gt;, terminate with "\n"
591595 */
592 - function drawCategoryBrowser( $tree, &$skin ) {
 596+ function drawCategoryBrowser( $tree ) {
593597 $return = '';
594598
595599 foreach ( $tree as $element => $parent ) {
@@ -597,12 +601,12 @@
598602 $return .= "\n";
599603 } else {
600604 # grab the others elements
601 - $return .= $this->drawCategoryBrowser( $parent, $skin ) . ' &gt; ';
 605+ $return .= $this->drawCategoryBrowser( $parent ) . ' &gt; ';
602606 }
603607
604608 # add our current element to the list
605609 $eltitle = Title::newFromText( $element );
606 - $return .= $skin->link( $eltitle, $eltitle->getText() );
 610+ $return .= Linker::link( $eltitle, $eltitle->getText() );
607611 }
608612
609613 return $return;
@@ -769,7 +773,7 @@
770774
771775 return wfMsg(
772776 $msg,
773 - $this->link(
 777+ Linker::link(
774778 SpecialPage::getTitleFor( 'Undelete', $this->getTitle()->getPrefixedDBkey() ),
775779 wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $this->getContext()->getLang()->formatNum( $n ) ),
776780 array(),
@@ -878,9 +882,9 @@
879883
880884 if ( $wgRightsPage ) {
881885 $title = Title::newFromText( $wgRightsPage );
882 - $link = $this->linkKnown( $title, $wgRightsText );
 886+ $link = Linker::linkKnown( $title, $wgRightsText );
883887 } elseif ( $wgRightsUrl ) {
884 - $link = $this->makeExternalLink( $wgRightsUrl, $wgRightsText );
 888+ $link = Linker::makeExternalLink( $wgRightsUrl, $wgRightsText );
885889 } elseif ( $wgRightsText ) {
886890 $link = $wgRightsText;
887891 } else {
@@ -1014,7 +1018,7 @@
10151019 * @return string
10161020 */
10171021 function mainPageLink() {
1018 - $s = $this->link(
 1022+ $s = Linker::link(
10191023 Title::newMainPage(),
10201024 wfMsg( 'mainpage' ),
10211025 array(),
@@ -1036,7 +1040,7 @@
10371041 // but we make the link target be the one site-wide page.
10381042 $title = Title::newFromText( wfMsgForContent( $page ) );
10391043
1040 - return $this->linkKnown(
 1044+ return Linker::linkKnown(
10411045 $title,
10421046 wfMsgExt( $desc, array( 'parsemag', 'escapenoentities' ) )
10431047 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r90865Follow-up r86234, and more parameter documentation.happy-melon23:40, 26 June 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   01:27, 21 June 2011

I still see $tempout = explode( "\n", $this->drawCategoryBrowser( $parenttree, $this ) ); in the code.

Status & tagging log