Index: trunk/phase3/skins/common/config.css |
— | — | @@ -72,22 +72,6 @@ |
73 | 73 | clear: left; |
74 | 74 | } |
75 | 75 | |
76 | | -.config-warning-box { |
77 | | - border: 2px solid #ff7f00; |
78 | | - margin: 0.4em; |
79 | | - clear: left; |
80 | | -} |
81 | | - |
82 | | -.config-info-left { |
83 | | - margin: 7px; |
84 | | - float: left; |
85 | | - width: 35px; |
86 | | -} |
87 | | - |
88 | | -.config-info-right { |
89 | | - margin: 0.5em 0.5em 0.5em 49px; |
90 | | -} |
91 | | - |
92 | 76 | .config-page-current { |
93 | 77 | font-weight: bold; |
94 | 78 | } |
— | — | @@ -161,4 +145,4 @@ |
162 | 146 | |
163 | 147 | #config-live-log { |
164 | 148 | width: 70%; |
165 | | -} |
\ No newline at end of file |
| 149 | +} |
Index: trunk/phase3/skins/common/shared.css |
— | — | @@ -361,6 +361,23 @@ |
362 | 362 | border: none; |
363 | 363 | } |
364 | 364 | |
| 365 | +/* general info/warning box for SP */ |
| 366 | +.mw-infobox { |
| 367 | + border: 2px solid #ff7f00; |
| 368 | + margin: 0.4em; |
| 369 | + clear: left; |
| 370 | +} |
| 371 | + |
| 372 | +.mw-infobox-left { |
| 373 | + margin: 7px; |
| 374 | + float: left; |
| 375 | + width: 35px; |
| 376 | +} |
| 377 | + |
| 378 | +.mw-infobox-right { |
| 379 | + margin: 0.5em 0.5em 0.5em 49px; |
| 380 | +} |
| 381 | + |
365 | 382 | /* Note on preview page */ |
366 | 383 | .previewnote { |
367 | 384 | color: #c00; |
Index: trunk/phase3/includes/Xml.php |
— | — | @@ -765,6 +765,47 @@ |
766 | 766 | $s .= Xml::closeElement( 'tr' ); |
767 | 767 | return $s; |
768 | 768 | } |
| 769 | + |
| 770 | + /** |
| 771 | + * Get HTML for an info box with an icon. |
| 772 | + * |
| 773 | + * @param $text String: wikitext, get this with wfMsgNoTrans() |
| 774 | + * @param $icon String: icon name, file in skins/common/images |
| 775 | + * @param $alt String: alternate text for the icon |
| 776 | + * @param $class String: additional class name to add to the wrapper div |
| 777 | + * |
| 778 | + * @return string |
| 779 | + */ |
| 780 | + static function infoBox( $text, $icon, $alt, $class = false, $useStypePath = true ) { |
| 781 | + global $wgStylePath; |
| 782 | + |
| 783 | + if ( $useStypePath ) { |
| 784 | + $icon = $wgStylePath.'/common/images/'.$icon; |
| 785 | + } |
| 786 | + |
| 787 | + |
| 788 | + $s = Xml::openElement( 'div', array( 'class' => "mw-infobox $class") ); |
| 789 | + |
| 790 | + $s .= Xml::openElement( 'div', array( 'class' => 'mw-infobox-left' ) ). |
| 791 | + Html::element( 'img', |
| 792 | + array( |
| 793 | + 'src' => $icon, |
| 794 | + 'alt' => $alt, |
| 795 | + ) |
| 796 | + ). |
| 797 | + Xml::closeElement( 'div' ); |
| 798 | + |
| 799 | + $s .= Xml::openElement( 'div', array( 'class' => 'mw-infobox-right' ) ). |
| 800 | + $text. |
| 801 | + Xml::closeElement( 'div' ); |
| 802 | + $s .= Xml::element( 'div', array( 'style' => 'clear: left;' ), ' ' ); |
| 803 | + |
| 804 | + $s .= Xml::closeElement( 'div' ); |
| 805 | + |
| 806 | + $s .= Xml::element( 'div', array( 'style' => 'clear: left;' ), ' ' ); |
| 807 | + |
| 808 | + return $s; |
| 809 | + } |
769 | 810 | } |
770 | 811 | |
771 | 812 | class XmlSelect { |
Index: trunk/phase3/includes/installer/WebInstaller.php |
— | — | @@ -611,23 +611,11 @@ |
612 | 612 | * |
613 | 613 | * @return string |
614 | 614 | */ |
615 | | - public function getInfoBox( $text, $icon = 'info-32.png', $class = false ) { |
616 | | - $s = |
617 | | - "<div class=\"config-info $class\">\n" . |
618 | | - "<div class=\"config-info-left\">\n" . |
619 | | - Html::element( 'img', |
620 | | - array( |
621 | | - 'src' => '../skins/common/images/' . $icon, |
622 | | - 'alt' => wfMsg( 'config-information' ), |
623 | | - ) |
624 | | - ) . "\n" . |
625 | | - "</div>\n" . |
626 | | - "<div class=\"config-info-right\">\n" . |
627 | | - $this->parse( $text, true ) . "\n" . |
628 | | - "</div>\n" . |
629 | | - "<div style=\"clear: left;\"></div>\n" . |
630 | | - "</div>\n"; |
631 | | - return $s; |
| 615 | + public function getInfoBox( $text, $icon = false, $class = false ) { |
| 616 | + $text = $this->parse( $text, true ); |
| 617 | + $icon = ( $icon == false ) ? '../skins/common/images/info-32.png' : '../skins/common/images/'.$icon; |
| 618 | + $alt = wfMsg( 'config-information' ); |
| 619 | + return Xml::infoBox( $text, $icon, $alt, $class, false ); |
632 | 620 | } |
633 | 621 | |
634 | 622 | /** |