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() );
);
}
$text = $msg->useDatabase( false )->plain();
- $this->output->addHTML( $this->getErrorBox( $text ) );
+ $box = Html::errorBox( $text, '', 'config-error-box' );
+ $this->output->addHTML( $box );
}
/**
/**
* Get HTML for an error box with an icon.
*
+ * @deprecated since 1.34 Use Html::errorBox() instead.
* @param string $text Wikitext, get this with wfMessage()->plain()
*
* @return string
*/
public function getErrorBox( $text ) {
+ wfDeprecated( __METHOD__, '1.34' );
return $this->getInfoBox( $text, 'critical-32.png', 'config-error-box' );
}
/**
* Get HTML for a warning box with an icon.
*
+ * @deprecated since 1.34 Use Html::warningBox() instead.
* @param string $text Wikitext, get this with wfMessage()->plain()
*
* @return string
*/
public function getWarningBox( $text ) {
+ wfDeprecated( __METHOD__, '1.34' );
return $this->getInfoBox( $text, 'warning-32.png', 'config-warning-box' );
}
/**
* Get HTML for an information message box with an icon.
*
+ * @deprecated since 1.34.
* @param string|HtmlArmor $text Wikitext to be parsed (from Message::plain) or raw HTML.
* @param string|bool $icon Icon name, file in mw-config/images. Default: false
* @param string|bool $class Additional class name to add to the wrapper div. Default: false.
* @return string HTML
*/
public function getInfoBox( $text, $icon = false, $class = false ) {
+ wfDeprecated( __METHOD__, '1.34' );
$html = ( $text instanceof HtmlArmor ) ?
HtmlArmor::getHtml( $text ) :
$this->parse( $text, true );
$text = $status->getWikiText();
if ( $status->isOK() ) {
- $box = $this->getWarningBox( $text );
+ $box = Html::warningBox( $text, 'config-warning-box' );
} else {
- $box = $this->getErrorBox( $text );
+ $box = Html::errorBox( $text, '', 'config-error-box' );
}
$this->output->addHTML( $box );
}
/**
- * Helper for Installer::docLink()
+ * Helper for WebInstallerOutput
*
* @internal For use by WebInstallerOutput
* @param string $page
return $this->getUrl( $query );
}
- /**
- * Extension tag hook for a documentation link.
- *
- * @param string $linkText
- * @param string[] $attribs
- * @param Parser $parser Unused
- *
- * @return string
- */
- public function docLink( $linkText, $attribs, $parser ) {
- $url = $this->getDocUrl( $attribs['href'] );
-
- return Html::element( 'a', [ 'href' => $url ], $linkText );
- }
-
/**
* Helper for sidebar links.
*