* Returns an HTML link element in a string styled as a button
* (when $wgUseMediaWikiUIEverywhere is enabled).
*
- * @param string $contents The raw HTML contents of the element: *not*
- * escaped!
+ * @param string $text The text of the element. Will be escaped (not raw HTML)
* @param array $attrs Associative array of attributes, e.g., [
* 'href' => 'https://www.mediawiki.org/' ]. See expandAttributes() for
* further documentation.
* @see https://tools.wmflabs.org/styleguide/desktop/index.html for guidance on available modifiers
* @return string Raw HTML
*/
- public static function linkButton( $contents, array $attrs, array $modifiers = [] ) {
+ public static function linkButton( $text, array $attrs, array $modifiers = [] ) {
return self::element( 'a',
self::buttonAttributes( $attrs, $modifiers ),
- $contents
+ $text
);
}
}
/**
- * 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;' ], ' ' );