parent::__construct();
$this->output = new WebInstallerOutput( $this );
$this->request = $request;
-
- // Add parser hooks
- $parser = MediaWikiServices::getInstance()->getParser();
- $parser->setHook( 'doclink', [ $this, 'docLink' ] );
}
/**
# Special case for Creative Commons partner chooser box.
if ( $this->request->getVal( 'SubmitCC' ) ) {
+ /** @var WebInstallerOptions $page */
$page = $this->getPageByName( 'Options' );
+ '@phan-var WebInstallerOptions $page';
$this->output->useShortHeader();
$this->output->allowFrames();
$page->submitCC();
}
if ( $this->request->getVal( 'ShowCC' ) ) {
+ /** @var WebInstallerOptions $page */
$page = $this->getPageByName( 'Options' );
+ '@phan-var WebInstallerOptions $page';
$this->output->useShortHeader();
$this->output->allowFrames();
$this->output->addHTML( $page->getCCDoneBox() );
}
/**
- * Helper for Installer::docLink()
+ * Helper for WebInstallerOutput
*
+ * @internal For use by WebInstallerOutput
* @param string $page
- *
* @return string
*/
- protected function getDocUrl( $page ) {
+ public function getDocUrl( $page ) {
$query = [ 'page' => $page ];
if ( in_array( $this->currentPageName, $this->pageSequence ) ) {
}
/**
- * Extension tag hook for a documentation link.
+ * Helper for sidebar links.
*
+ * @internal For use in WebInstallerOutput class
+ * @param string $url
* @param string $linkText
- * @param string[] $attribs
- * @param Parser $parser Unused
- *
- * @return string
+ * @return string HTML
*/
- public function docLink( $linkText, $attribs, $parser ) {
- $url = $this->getDocUrl( $attribs['href'] );
-
- return Html::element( 'a', [ 'href' => $url ], $linkText );
+ public function makeLinkItem( $url, $linkText ) {
+ return Html::rawElement( 'li', [],
+ Html::element( 'a', [ 'href' => $url ], $linkText )
+ );
}
/**