get( 'CiteThisPageAdditionalNamespaces' ); return $title->isContentPage() || ( isset( $additionalNamespaces[$title->getNamespace()] ) && $additionalNamespaces[$title->getNamespace()] ); } /** @inheritDoc */ public function onSidebarBeforeOutput( $skin, &$sidebar ): void { $out = $skin->getOutput(); $title = $out->getTitle(); if ( !self::shouldAddLink( $title, $out->getConfig() ) ) { return; } $revid = $out->getRevisionId(); if ( $revid === 0 || empty( $revid ) ) { return; } $specialPage = SpecialPage::getTitleFor( 'CiteThisPage' ); $citeURL = $specialPage->getLocalURL( [ 'page' => $title->getPrefixedDBkey(), 'id' => $revid, 'wpFormIdentifier' => 'titleform' ] ); $citeThisPageLink = [ 'id' => 't-cite', 'href' => $citeURL, 'icon' => 'quotes', 'text' => $skin->msg( 'citethispage-link' )->text(), // Message keys: 'tooltip-citethispage', 'accesskey-citethispage' 'single-id' => 'citethispage', ]; // Append link $sidebar['TOOLBOX']['citethispage'] = $citeThisPageLink; } }