$s .= Xml::closeElement( 'tr' );
return $s;
}
+
+ /**
+ * Get HTML for an info box with an icon.
+ *
+ * @param $text String: wikitext, get this with wfMsgNoTrans()
+ * @param $icon String: icon name, file in skins/common/images
+ * @param $alt String: alternate text for the icon
+ * @param $class String: additional class name to add to the wrapper div
+ *
+ * @return string
+ */
+ static function infoBox( $text, $icon, $alt, $class = false, $useStypePath = true ) {
+ global $wgStylePath;
+
+ if ( $useStypePath ) {
+ $icon = $wgStylePath.'/common/images/'.$icon;
+ }
+
+
+ $s = Xml::openElement( 'div', array( 'class' => "mw-infobox $class") );
+
+ $s .= Xml::openElement( 'div', array( 'class' => 'mw-infobox-left' ) ).
+ Html::element( 'img',
+ array(
+ 'src' => $icon,
+ 'alt' => $alt,
+ )
+ ).
+ Xml::closeElement( 'div' );
+
+ $s .= Xml::openElement( 'div', array( 'class' => 'mw-infobox-right' ) ).
+ $text.
+ Xml::closeElement( 'div' );
+ $s .= Xml::element( 'div', array( 'style' => 'clear: left;' ), ' ' );
+
+ $s .= Xml::closeElement( 'div' );
+
+ $s .= Xml::element( 'div', array( 'style' => 'clear: left;' ), ' ' );
+
+ return $s;
+ }
}
class XmlSelect {
*
* @return string
*/
- public function getInfoBox( $text, $icon = 'info-32.png', $class = false ) {
- $s =
- "<div class=\"config-info $class\">\n" .
- "<div class=\"config-info-left\">\n" .
- Html::element( 'img',
- array(
- 'src' => '../skins/common/images/' . $icon,
- 'alt' => wfMsg( 'config-information' ),
- )
- ) . "\n" .
- "</div>\n" .
- "<div class=\"config-info-right\">\n" .
- $this->parse( $text, true ) . "\n" .
- "</div>\n" .
- "<div style=\"clear: left;\"></div>\n" .
- "</div>\n";
- return $s;
+ public function getInfoBox( $text, $icon = false, $class = false ) {
+ $text = $this->parse( $text, true );
+ $icon = ( $icon == false ) ? '../skins/common/images/info-32.png' : '../skins/common/images/'.$icon;
+ $alt = wfMsg( 'config-information' );
+ return Xml::infoBox( $text, $icon, $alt, $class, false );
}
/**
clear: left;
}
-.config-warning-box {
- border: 2px solid #ff7f00;
- margin: 0.4em;
- clear: left;
-}
-
-.config-info-left {
- margin: 7px;
- float: left;
- width: 35px;
-}
-
-.config-info-right {
- margin: 0.5em 0.5em 0.5em 49px;
-}
-
.config-page-current {
font-weight: bold;
}
#config-live-log {
width: 70%;
-}
\ No newline at end of file
+}
border: none;
}
+/* general info/warning box for SP */
+.mw-infobox {
+ border: 2px solid #ff7f00;
+ margin: 0.4em;
+ clear: left;
+}
+
+.mw-infobox-left {
+ margin: 7px;
+ float: left;
+ width: 35px;
+}
+
+.mw-infobox-right {
+ margin: 0.5em 0.5em 0.5em 49px;
+}
+
/* Note on preview page */
.previewnote {
color: #c00;