Index: trunk/extensions/Contest/Contest.hooks.php |
— | — | @@ -125,10 +125,6 @@ |
126 | 126 | |
127 | 127 | // Find the watchlist item and replace it by the my contests link and itself. |
128 | 128 | 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 | | - |
133 | 129 | $url = SpecialPage::getTitleFor( 'MyContests' )->getLinkUrl(); |
134 | 130 | $myContests = array( |
135 | 131 | 'text' => wfMsg( 'contest-toplink' ), |
— | — | @@ -136,7 +132,9 @@ |
137 | 133 | 'active' => ( $url == $title->getLinkUrl() ) |
138 | 134 | ); |
139 | 135 | |
140 | | - array_splice( $personal_urls, $watchListLocation, 1, array( $myContests, $watchListItem ) ); |
| 136 | + $insertUrls = array( 'mycontests' => $myContests ); |
| 137 | + |
| 138 | + $personal_urls = wfArrayInsertAfter( $personal_urls, $insertUrls, 'watchlist' ); |
141 | 139 | } |
142 | 140 | } |
143 | 141 | |