r93288 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93287‎ | r93288 | r93289 >
Date:17:20, 27 July 2011
Author:robin
Status:ok
Tags:
Comment:
SkinLegacy:
* fix Fatal error: Call to undefined method CologneBlueTemplate::makeExternalLink()
* Use static Linker functions for all other link functions
CologneBlue: check if browseLinks is an array (in a rare case it isn't, which returns a Warning, see e.g. r91432#c19211)
Modified paths:
  • /trunk/phase3/includes/SkinLegacy.php (modified) (history)
  • /trunk/phase3/skins/CologneBlue.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/CologneBlue.php
@@ -235,10 +235,12 @@
236236 }
237237 $s .= "\n<h6>" . htmlspecialchars( $h ) . "</h6>";
238238 }
239 - foreach ( $browseLinks as $link ) {
240 - if ( $link['text'] != '-' ) {
241 - $s .= "<a href=\"{$link['href']}\">" .
242 - htmlspecialchars( $link['text'] ) . '</a>' . $sep;
 239+ if( is_array( $browseLinks ) ) {
 240+ foreach ( $browseLinks as $link ) {
 241+ if ( $link['text'] != '-' ) {
 242+ $s .= "<a href=\"{$link['href']}\">" .
 243+ htmlspecialchars( $link['text'] ) . '</a>' . $sep;
 244+ }
243245 }
244246 }
245247 $barnumber++;
Index: trunk/phase3/includes/SkinLegacy.php
@@ -252,7 +252,7 @@
253253
254254 $s = array(
255255 $this->getSkin()->mainPageLink(),
256 - $this->getSkin()->specialLink( 'Recentchanges' )
 256+ Linker::specialLink( 'Recentchanges' )
257257 );
258258
259259 if ( $wgOut->isArticleRelated() ) {
@@ -505,7 +505,7 @@
506506 }
507507
508508 if ( 'history' == $action || isset( $diff ) || isset( $oldid ) ) {
509 - $s[] .= $this->getSkin()->link(
 509+ $s[] .= Linker::link(
510510 $this->getSkin()->getTitle(),
511511 wfMsg( 'currentrev' ),
512512 array(),
@@ -518,7 +518,7 @@
519519 # do not show "You have new messages" text when we are viewing our
520520 # own talk page
521521 if ( !$this->getSkin()->getTitle()->equals( $wgUser->getTalkPage() ) ) {
522 - $tl = $this->getSkin()->link(
 522+ $tl = Linker::link(
523523 $wgUser->getTalkPage(),
524524 wfMsgHtml( 'newmessageslink' ),
525525 array(),
@@ -526,7 +526,7 @@
527527 array( 'known', 'noclasses' )
528528 );
529529
530 - $dl = $this->getSkin()->link(
 530+ $dl = Linker::link(
531531 $wgUser->getTalkPage(),
532532 wfMsgHtml( 'newmessagesdifflink' ),
533533 array(),
@@ -615,7 +615,7 @@
616616 $t = wfMsg( 'viewsource' );
617617 }
618618
619 - $s = $this->getSkin()->link(
 619+ $s = Linker::link(
620620 $this->getSkin()->getTitle(),
621621 $t,
622622 array(),
@@ -635,7 +635,7 @@
636636 if ( $this->getSkin()->getTitle()->getArticleId() && ( !$diff ) && $wgUser->isAllowed( 'delete' ) ) {
637637 $t = wfMsg( 'deletethispage' );
638638
639 - $s = $this->getSkin()->link(
 639+ $s = Linker::link(
640640 $this->getSkin()->getTitle(),
641641 $t,
642642 array(),
@@ -663,7 +663,7 @@
664664 $query = array( 'action' => 'protect' );
665665 }
666666
667 - $s = $this->getSkin()->link(
 667+ $s = Linker::link(
668668 $this->getSkin()->getTitle(),
669669 $text,
670670 array(),
@@ -701,7 +701,7 @@
702702 $id = 'mw-watch-link' . $this->mWatchLinkNum;
703703 }
704704
705 - $s = $this->getSkin()->link(
 705+ $s = Linker::link(
706706 $title,
707707 $text,
708708 array( 'id' => $id ),
@@ -717,7 +717,7 @@
718718
719719 function moveThisPage() {
720720 if ( $this->getSkin()->getTitle()->quickUserCan( 'move' ) ) {
721 - return $this->getSkin()->link(
 721+ return Linker::link(
722722 SpecialPage::getTitleFor( 'Movepage' ),
723723 wfMsg( 'movethispage' ),
724724 array(),
@@ -731,7 +731,7 @@
732732 }
733733
734734 function historyLink() {
735 - return $this->getSkin()->link(
 735+ return Linker::link(
736736 $this->getSkin()->getTitle(),
737737 wfMsgHtml( 'history' ),
738738 array( 'rel' => 'archives' ),
@@ -740,7 +740,7 @@
741741 }
742742
743743 function whatLinksHere() {
744 - return $this->getSkin()->link(
 744+ return Linker::link(
745745 SpecialPage::getTitleFor( 'Whatlinkshere', $this->getSkin()->getTitle()->getPrefixedDBkey() ),
746746 wfMsgHtml( 'whatlinkshere' ),
747747 array(),
@@ -750,7 +750,7 @@
751751 }
752752
753753 function userContribsLink() {
754 - return $this->getSkin()->link(
 754+ return Linker::link(
755755 SpecialPage::getTitleFor( 'Contributions', $this->getSkin()->getTitle()->getDBkey() ),
756756 wfMsgHtml( 'contributions' ),
757757 array(),
@@ -760,7 +760,7 @@
761761 }
762762
763763 function emailUserLink() {
764 - return $this->getSkin()->link(
 764+ return Linker::link(
765765 SpecialPage::getTitleFor( 'Emailuser', $this->getSkin()->getTitle()->getDBkey() ),
766766 wfMsg( 'emailuser' ),
767767 array(),
@@ -775,7 +775,7 @@
776776 if ( !$wgOut->isArticleRelated() ) {
777777 return '(' . wfMsg( 'notanarticle' ) . ')';
778778 } else {
779 - return $this->getSkin()->link(
 779+ return Linker::link(
780780 SpecialPage::getTitleFor( 'Recentchangeslinked', $this->getSkin()->getTitle()->getPrefixedDBkey() ),
781781 wfMsg( 'recentchangeslinked-toolbox' ),
782782 array(),
@@ -836,7 +836,7 @@
837837 $text = wfMsg( 'talkpage' );
838838 }
839839
840 - $s = $this->getSkin()->link( $link, $text, array(), array(), $linkOptions );
 840+ $s = Linker::link( $link, $text, array(), array(), $linkOptions );
841841
842842 return $s;
843843 }
@@ -859,7 +859,7 @@
860860 $title = $this->getSkin()->getTitle()->getTalkPage();
861861 }
862862
863 - return $this->getSkin()->link(
 863+ return Linker::link(
864864 $title,
865865 wfMsg( 'postcomment' ),
866866 array(),
@@ -876,9 +876,9 @@
877877
878878 if ( $wgUploadNavigationUrl ) {
879879 # Using an empty class attribute to avoid automatic setting of "external" class
880 - return $this->makeExternalLink( $wgUploadNavigationUrl, wfMsgHtml( 'upload' ), false, null, array( 'class' => '' ) );
 880+ return Linker::makeExternalLink( $wgUploadNavigationUrl, wfMsgHtml( 'upload' ), false, null, array( 'class' => '' ) );
881881 } else {
882 - return $this->getSkin()->link(
 882+ return Linker::link(
883883 SpecialPage::getTitleFor( 'Upload' ),
884884 wfMsgHtml( 'upload' ),
885885 array(),
@@ -899,7 +899,7 @@
900900 if ( $this->getSkin()->showIPinHeader() ) {
901901 $name = wfGetIP();
902902
903 - $talkLink = $this->getSkin()->link( $wgUser->getTalkPage(),
 903+ $talkLink = Linker::link( $wgUser->getTalkPage(),
904904 $wgLang->getNsText( NS_TALK ) );
905905
906906 $ret .= "$name ($talkLink)";
@@ -917,30 +917,30 @@
918918 $loginlink = $wgUser->isAllowed( 'createaccount' )
919919 ? 'nav-login-createaccount'
920920 : 'login';
921 - $ret .= "\n<br />" . $this->getSkin()->link(
 921+ $ret .= "\n<br />" . Linker::link(
922922 SpecialPage::getTitleFor( 'Userlogin' ),
923923 wfMsg( $loginlink ), array(), $query
924924 );
925925 } else {
926926 $returnTo = $this->getSkin()->getTitle()->getPrefixedDBkey();
927 - $talkLink = $this->getSkin()->link( $wgUser->getTalkPage(),
 927+ $talkLink = Linker::link( $wgUser->getTalkPage(),
928928 $wgLang->getNsText( NS_TALK ) );
929929
930 - $ret .= $this->getSkin()->link( $wgUser->getUserPage(),
 930+ $ret .= Linker::link( $wgUser->getUserPage(),
931931 htmlspecialchars( $wgUser->getName() ) );
932932 $ret .= " ($talkLink)<br />";
933933 $ret .= $wgLang->pipeList( array(
934 - $this->getSkin()->link(
 934+ Linker::link(
935935 SpecialPage::getTitleFor( 'Userlogout' ), wfMsg( 'logout' ),
936936 array(), array( 'returnto' => $returnTo )
937937 ),
938 - $this->getSkin()->specialLink( 'Preferences' ),
 938+ Linker::specialLink( 'Preferences' ),
939939 ) );
940940 }
941941
942942 $ret = $wgLang->pipeList( array(
943943 $ret,
944 - $this->getSkin()->link(
 944+ Linker::link(
945945 Title::newFromText( wfMsgForContent( 'helppage' ) ),
946946 wfMsg( 'help' )
947947 ),

Follow-up revisions

RevisionCommit summaryAuthorDate
r93289(from trunk r93288) fix Fatal error: Call to undefined method CologneBlueTemp...robin17:27, 27 July 2011
r96842REL1_18: MFT r93288, r94212, r96261, r96263, r96384reedy14:42, 12 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r91432(see bug 29712) Removing the defaultUserOptionOverrides in MessagesXx.php bec...robin01:26, 5 July 2011

Status & tagging log