* moved infobox to Html (r88109#c16937)
authorJure Kajzer <freakolowsky@users.mediawiki.org>
Wed, 1 Jun 2011 13:57:50 +0000 (13:57 +0000)
committerJure Kajzer <freakolowsky@users.mediawiki.org>
Wed, 1 Jun 2011 13:57:50 +0000 (13:57 +0000)
includes/Html.php
includes/Xml.php
includes/installer/WebInstaller.php

index ce90a44..aca5392 100644 (file)
@@ -653,4 +653,47 @@ class Html {
                                return false;
                }
        }
+       
+       /**
+        * 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
+        * @param $useStylePath
+        *
+        * @return string
+        */
+       static function infoBox( $text, $icon, $alt, $class = false, $useStylePath = true ) {
+               global $wgStylePath;
+               
+               if ( $useStylePath ) {
+                       $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;
+       }
+       
 }
index f965516..e25d436 100644 (file)
@@ -804,48 +804,6 @@ class Xml {
                $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
-        * @param $useStylePath
-        *
-        * @return string
-        */
-       static function infoBox( $text, $icon, $alt, $class = false, $useStylePath = true ) {
-               global $wgStylePath;
-               
-               if ( $useStylePath ) {
-                       $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 {
index ebea68b..d79e338 100644 (file)
@@ -615,7 +615,7 @@ class WebInstaller extends Installer {
                $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 );
+               return Html::infoBox( $text, $icon, $alt, $class, false );
        }
 
        /**