}
/**
- * Get HTML for an info box with an icon.
+ * Get HTML for an information message box with an icon.
*
- * @param string $text Wikitext, get this with wfMessage()->plain()
+ * @internal For use by the WebInstaller class.
+ * @param string $rawHtml HTML
* @param string $icon Path to icon file (used as 'src' attribute)
* @param string $alt Alternate text for the icon
* @param string $class Additional class name to add to the wrapper div
- *
- * @return string
+ * @return string HTML
*/
- static function infoBox( $text, $icon, $alt, $class = '' ) {
+ public static function infoBox( $rawHtml, $icon, $alt, $class = '' ) {
$s = self::openElement( 'div', [ 'class' => "mw-infobox $class" ] );
$s .= self::openElement( 'div', [ 'class' => 'mw-infobox-left' ] ) .
self::closeElement( 'div' );
$s .= self::openElement( 'div', [ 'class' => 'mw-infobox-right' ] ) .
- $text .
+ $rawHtml .
self::closeElement( 'div' );
$s .= self::element( 'div', [ 'style' => 'clear: left;' ], ' ' );
}
/**
- * Get HTML for an info box with an icon.
+ * Get HTML for an information message box with an icon.
*
- * @param string $text Wikitext, get this with wfMessage()->plain()
+ * @param string $text Wikitext to be parsed (from Message::plain).
* @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
+ * @return string HTML
*/
public function getInfoBox( $text, $icon = false, $class = false ) {
- $text = $this->parse( $text, true );
+ $html = $this->parse( $text, true );
$icon = ( $icon == false ) ?
'images/info-32.png' :
'images/' . $icon;
$alt = wfMessage( 'config-information' )->text();
- return Html::infoBox( $text, $icon, $alt, $class );
+ return Html::infoBox( $html, $icon, $alt, $class );
}
/**