Fix special page override

Bug: T204873
Change-Id: I463cbbbc5b6f284aa2794ceb2652911ef7053c2e
This commit is contained in:
Ed Sanders 2018-09-19 21:25:27 +01:00
parent 6944faff25
commit 327f600ca1

View file

@ -164,16 +164,19 @@ class SpecialCollabPad extends SpecialPage {
* @return bool Always true.
*/
public static function onSkinTemplateNavigationSpecialPage( SkinTemplate &$skin, array &$links ) {
$subPage = self::getSubPage( $skin->getTitle() );
$links['namespaces']['special']['text'] = $skin->msg( 'collabpad' )->text();
if ( $subPage ) {
$links['namespaces']['special']['href'] =
Title::newFromText( 'Special:CollabPad' )->getLocalURL();
$links['namespaces']['special']['class'] = '';
$title = $skin->getTitle();
if ( $title && $title->isSpecial( 'CollabPad' ) ) {
$subPage = self::getSubPage( $title );
$links['namespaces']['special']['text'] = $skin->msg( 'collabpad' )->text();
if ( $subPage ) {
$links['namespaces']['special']['href'] =
Title::newFromText( 'Special:CollabPad' )->getLocalURL();
$links['namespaces']['special']['class'] = '';
$links['namespaces']['pad']['text'] = $subPage->getPrefixedText();
$links['namespaces']['pad']['href'] = '';
$links['namespaces']['pad']['class'] = 'selected';
$links['namespaces']['pad']['text'] = $subPage->getPrefixedText();
$links['namespaces']['pad']['href'] = '';
$links['namespaces']['pad']['class'] = 'selected';
}
}
return true;
}