X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FHtml.php;h=ea2ce07a32976d1c9468573e69316b3f085ddd36;hb=748c5eae2fd5d897c94c48771161c259941a7488;hp=d0f9fc64e9bab6a1533c9928326696730455c606;hpb=882b19db2e71a8315781e4a437641106427ff0c7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Html.php b/includes/Html.php index d0f9fc64e9..ea2ce07a32 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -154,8 +154,7 @@ class Html { * 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. @@ -163,10 +162,10 @@ class Html { * @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 ); } @@ -705,7 +704,7 @@ class Html { * Return the HTML for a message box. * @since 1.31 * @param string $html of contents of box - * @param string $className corresponding to box + * @param string|array $className corresponding to box * @param string $heading (optional) * @return string of HTML representing a box. */ @@ -719,32 +718,38 @@ class Html { /** * Return a warning box. * @since 1.31 + * @since 1.34 $className optional parameter added * @param string $html of contents of box + * @param string $className (optional) corresponding to box * @return string of HTML representing a warning box. */ - public static function warningBox( $html ) { - return self::messageBox( $html, 'warningbox' ); + public static function warningBox( $html, $className = '' ) { + return self::messageBox( $html, [ 'warningbox', $className ] ); } /** * Return an error box. * @since 1.31 + * @since 1.34 $className optional parameter added * @param string $html of contents of error box * @param string $heading (optional) + * @param string $className (optional) corresponding to box * @return string of HTML representing an error box. */ - public static function errorBox( $html, $heading = '' ) { - return self::messageBox( $html, 'errorbox', $heading ); + public static function errorBox( $html, $heading = '', $className = '' ) { + return self::messageBox( $html, [ 'errorbox', $className ], $heading ); } /** * Return a success box. * @since 1.31 + * @since 1.34 $className optional parameter added * @param string $html of contents of box + * @param string $className (optional) corresponding to box * @return string of HTML representing a success box. */ - public static function successBox( $html ) { - return self::messageBox( $html, 'successbox' ); + public static function successBox( $html, $className = '' ) { + return self::messageBox( $html, [ 'successbox', $className ] ); } /** @@ -1006,7 +1011,7 @@ class Html { /** * Get HTML for an information message box with an icon. * - * @internal For use by the WebInstaller class. + * @internal For use by the WebInstaller class only. * @param string $rawHtml HTML * @param string $icon Path to icon file (used as 'src' attribute) * @param string $alt Alternate text for the icon