Index: branches/CentralNotice-SpecialPage-Integration/SpecialNoticeTranslate.php |
— | — | @@ -81,13 +81,18 @@ |
82 | 82 | // Build HTML |
83 | 83 | $htmlOut = Xml::openElement( 'form', array( 'method' => 'post' ) ); |
84 | 84 | $htmlOut .= Xml::fieldset( wfMsgHtml( "centralnotice-translate-heading" ) ); |
85 | | - $htmlOut .= Xml::openElement( 'table', array ( 'cellpadding' => 9 ) ); |
| 85 | + $htmlOut .= Xml::openElement( 'table', |
| 86 | + array ( |
| 87 | + 'cellpadding' => 9, |
| 88 | + 'width' => '100%' |
| 89 | + ) |
| 90 | + ); |
86 | 91 | |
87 | 92 | // Headers |
88 | | - $htmlOut .= Xml::element( 'th' ); |
89 | | - $htmlOut .= Xml::element( 'th', null, wfMsg ( 'centralnotice-english') ); |
90 | | - $htmlOut .= Xml::element( 'th' ); |
91 | | - $htmlOut .= Xml::element( 'th', null, $wpUserLang ); |
| 93 | + $htmlOut .= Xml::element( 'th', array( 'width' => '20%' ) ); |
| 94 | + $htmlOut .= Xml::element( 'th', array( 'width' => '40%' ), wfMsg ( 'centralnotice-english') ); |
| 95 | + $languages = Language::getLanguageNames(); |
| 96 | + $htmlOut .= Xml::element( 'th', array( 'width' => '40%' ), $languages[$wpUserLang] ); |
92 | 97 | |
93 | 98 | // Rows |
94 | 99 | $fields = array( 'heading', 'target', 'button', 'hide' ); |
— | — | @@ -96,12 +101,7 @@ |
97 | 102 | $message = ( $wpUserLang == 'en' ) ? "Centralnotice-{$field}" : "Centralnotice-{$field}/{$wpUserLang}"; |
98 | 103 | |
99 | 104 | // Text -- only load text if a message exists to avoild default english text display |
100 | | - $title = Title::newFromText( $message, NS_MEDIAWIKI ); |
101 | | - $text = ''; |
102 | | - if( $title->exists() ) { |
103 | | - $text = wfMsgExt( "centralnotice-{$field}", array ( 'language' => $wpUserLang ) ); |
104 | | - } |
105 | | - |
| 105 | + |
106 | 106 | // English value |
107 | 107 | $htmlOut .= Xml::openElement( 'tr' ); |
108 | 108 | $htmlOut .= Xml::element( 'td', null, $field ); |
— | — | @@ -109,18 +109,16 @@ |
110 | 110 | wfMsgExt( "centralnotice-{$field}", array( 'language' => 'en') ) |
111 | 111 | ); |
112 | 112 | |
113 | | - // Field |
114 | | - $style = $text !== '' ? array( 'style' => 'color:red' ) : array(); |
115 | | - if ( $wpUserLang == 'en' ) { |
116 | | - $htmlOut .= Xml::element( 'td', $style, $field ); |
117 | | - } |
118 | | - else { |
119 | | - $htmlOut .= Xml::element( 'td', $style, "{$field}/{$wpUserLang}" ); |
120 | | - } |
121 | | - |
122 | 113 | // Input |
| 114 | + $title = Title::newFromText( $message, NS_MEDIAWIKI ); |
| 115 | + $text = ''; |
| 116 | + if( $title->exists() ) { |
| 117 | + $text = wfMsgExt( "centralnotice-{$field}", array ( 'language' => $wpUserLang ) ); |
| 118 | + } |
123 | 119 | $htmlOut .= Xml::tags( 'td', null, |
124 | | - Xml::input( "updateText[$wpUserLang][$field]", 80, $text ) |
| 120 | + Xml::input( "updateText[$wpUserLang][$field]", '', $text, |
| 121 | + array( 'style' => 'width:100%;' . ( $text == '' ? 'color:red' : '' ) ) |
| 122 | + ) |
125 | 123 | ); |
126 | 124 | |
127 | 125 | $htmlOut .= Xml::closeElement( 'tr' ); |