* valign Vertical alignment (baseline, sub, super, top, text-top, middle,
* bottom, text-bottom)
* alt Alternate text for image (i.e. alt attribute). Plain text.
+ * class HTML for image classes. Plain text.
* caption HTML for image caption.
* link-url URL to link to
* link-title Title object to link to
if ( !isset( $fp['title'] ) ) {
$fp['title'] = '';
}
+ if ( !isset( $fp['class'] ) ) {
+ $fp['class'] = '';
+ }
$prefix = $postfix = '';
$params = array(
'alt' => $fp['alt'],
'title' => $fp['title'],
- 'valign' => isset( $fp['valign'] ) ? $fp['valign'] : false ,
- 'img-class' => isset( $fp['border'] ) ? 'thumbborder' : false );
+ 'valign' => isset( $fp['valign'] ) ? $fp['valign'] : false,
+ 'img-class' => $fp['class'] );
+ if ( isset( $fp['border'] ) ) {
+ $params['img-class'] .= ( $params['img-class'] !== '' ) ? ' thumbborder' : 'thumbborder';
+ }
$params = self::getImageLinkMTOParams( $fp, $query, $parser ) + $params;
$s = $thumb->toHtml( $params );
$params = array(
'alt' => $fp['alt'],
'title' => $fp['title'],
- 'img-class' => 'thumbimage' );
+ 'img-class' => ( isset( $fp['class'] ) && $fp['class'] !== '' ) ? $fp['class'] . ' thumbimage' : 'thumbimage'
+ );
$params = self::getImageLinkMTOParams( $fp, $query ) + $params;
$s .= $thumb->toHtml( $params );
if ( isset( $fp['framed'] ) ) {
* Wraps the TOC in a table and provides the hide/collapse javascript.
*
* @param $toc String: html of the Table Of Contents
- * @param $lang mixed: Language code for the toc title
+ * @param $lang String|Language|false: Language for the toc title, defaults to user language
* @return String: full html of the TOC
*/
public static function tocList( $toc, $lang = false ) {
+ $lang = wfGetLangObj( $lang );
$title = wfMessage( 'toc' )->inLanguage( $lang )->escaped();
+
return
'<table id="toc" class="toc"><tr><td>'
. '<div id="toctitle"><h2>' . $title . "</h2></div>\n"
* @return String: HTML output
*/
public static function formatHiddenCategories( $hiddencats ) {
- global $wgLang;
wfProfileIn( __METHOD__ );
$outText = '';