*/
protected $tabIndex = 1;
+ /**
+ * Numeric index of the help box
+ *
+ * @var int
+ */
+ protected $helpBoxId = 1;
+
/**
* Name of the page we're on
*
}
/**
- * 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 );
}
/**
$args = array_map( 'htmlspecialchars', $args );
$text = wfMessage( $msg, $args )->useDatabase( false )->plain();
$html = $this->parse( $text, true );
+ $id = 'helpBox-' . $this->helpBoxId++;
return "<div class=\"config-help-field-container\">\n" .
- "<span class=\"config-help-field-hint\" title=\"" .
+ "<input type=\"checkbox\" class=\"config-help-field-checkbox\" id=\"$id\" />" .
+ "<label class=\"config-help-field-hint\" for=\"$id\" title=\"" .
wfMessage( 'config-help-tooltip' )->escaped() . "\">" .
- wfMessage( 'config-help' )->escaped() . "</span>\n" .
+ wfMessage( 'config-help' )->escaped() . "</label>\n" .
"<div class=\"config-help-field-data\">" . $html . "</div>\n" .
"</div>\n";
}