r106111 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106110‎ | r106111 | r106112 >
Date:22:01, 13 December 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
fix insertion of My Contests link
Modified paths:
  • /trunk/extensions/Contest/Contest.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Contest/Contest.hooks.php
@@ -125,10 +125,6 @@
126126
127127 // Find the watchlist item and replace it by the my contests link and itself.
128128 if ( $wgUser->isLoggedIn() && $wgUser->getOption( 'contest_showtoplink' ) ) {
129 - $keys = array_keys( $personal_urls );
130 - $watchListLocation = array_search( 'watchlist', $keys );
131 - $watchListItem = $personal_urls[$keys[$watchListLocation]];
132 -
133129 $url = SpecialPage::getTitleFor( 'MyContests' )->getLinkUrl();
134130 $myContests = array(
135131 'text' => wfMsg( 'contest-toplink' ),
@@ -136,7 +132,9 @@
137133 'active' => ( $url == $title->getLinkUrl() )
138134 );
139135
140 - array_splice( $personal_urls, $watchListLocation, 1, array( $myContests, $watchListItem ) );
 136+ $insertUrls = array( 'mycontests' => $myContests );
 137+
 138+ $personal_urls = wfArrayInsertAfter( $personal_urls, $insertUrls, 'watchlist' );
141139 }
142140 }
143141

Follow-up revisions

RevisionCommit summaryAuthorDate
r106115Follow up to r106111; have the same position as beforejeroendedauw22:05, 13 December 2011

Status & tagging log