Index: trunk/extensions/Translate/SpecialLanguageStats.php |
— | — | @@ -64,56 +64,43 @@ |
65 | 65 | $out .= Xml::openElement( 'fieldset' ); |
66 | 66 | $out .= Xml::element( 'legend', null, wfMsg( 'translate-language-code' ) ); |
67 | 67 | $out .= Xml::openElement( 'table', array( 'id' => 'langcodeselect', 'class' => 'allpages' ) ); |
68 | | - $out .= "<tr> |
69 | | - <td class='mw-label'>" . |
70 | | - Xml::label( wfMsg( 'translate-language-code-field-name' ), 'code' ) . |
71 | | - "</td> |
72 | | - <td class='mw-input'>" . |
73 | | - Xml::input( 'code', 30, str_replace( '_', ' ', $code ), array( 'id' => 'code' ) ) . |
74 | | - "</td></tr><tr><td colspan='2'>" . |
75 | | - Xml::checkLabel( wfMsg( 'translate-suppress-complete' ), 'suppresscomplete', 'suppresscomplete', $suppressComplete ) . |
76 | | - "</td>" . |
77 | | - "</tr>" . |
78 | | - "<tr>" . |
79 | | - "<td class='mw-input'>" . |
80 | | - Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . |
81 | | - "</td> |
82 | | - </tr>"; |
| 68 | + |
| 69 | + $out .= Xml::openElement( 'tr' ); |
| 70 | + $out .= Xml::openElement( 'td', array( 'class' => 'mw-label' ) ); |
| 71 | + $out .= Xml::label( wfMsg( 'translate-language-code-field-name' ), 'code' ); |
| 72 | + $out .= Xml::closeElement( 'td' ); |
| 73 | + $out .= Xml::openElement( 'td', array( 'class' => 'mw-input' ) ); |
| 74 | + $out .= Xml::input( 'code', 30, str_replace( '_', ' ', $code ), array( 'id' => 'code' ) ); |
| 75 | + $out .= Xml::closeElement( 'td' ); |
| 76 | + $out .= Xml::closeElement( 'tr' ); |
| 77 | + |
| 78 | + $out .= Xml::openElement( 'tr' ); |
| 79 | + $out .= Xml::openElement( 'td', array( 'colspan' => 2 ) ); |
| 80 | + $out .= Xml::checkLabel( wfMsg( 'translate-suppress-complete' ), 'suppresscomplete', 'suppresscomplete', $suppressComplete ); |
| 81 | + $out .= Xml::closeElement( 'td' ); |
| 82 | + $out .= Xml::closeElement( 'tr' ); |
| 83 | + |
| 84 | + $out .= Xml::openElement( 'tr' ); |
| 85 | + $out .= Xml::openElement( 'td', array( 'class' => 'mw-input' ) ); |
| 86 | + $out .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ); |
| 87 | + $out .= Xml::closeElement( 'td' ); |
| 88 | + $out .= Xml::closeElement( 'tr' ); |
| 89 | + |
83 | 90 | $out .= Xml::closeElement( 'table' ); |
84 | 91 | $out .= Xml::closeElement( 'fieldset' ); |
85 | 92 | $out .= Xml::closeElement( 'form' ); |
86 | 93 | $out .= Xml::closeElement( 'div' ); |
| 94 | + |
87 | 95 | return $out; |
88 | 96 | } |
89 | 97 | |
90 | | - # Statistics table heading |
91 | | - function heading() { |
92 | | - return '<table class="sortable wikitable" border="2" cellpadding="4" cellspacing="0" style="background-color: #F9F9F9; border: 1px #AAAAAA solid; border-collapse: collapse; clear:both;" width="100%">' . "\n"; |
93 | | - } |
94 | 98 | |
95 | | - # Statistics table footer |
96 | | - function footer() { |
97 | | - return "</table>\n"; |
98 | | - } |
99 | | - |
100 | | - # Statistics table row start |
101 | | - function blockstart() { |
102 | | - return "\t<tr>\n"; |
103 | | - } |
104 | | - |
105 | | - # Statistics table row end |
106 | | - function blockend() { |
107 | | - return "\t</tr>\n"; |
108 | | - } |
109 | | - |
110 | 99 | # Statistics table element (heading or regular cell) |
111 | | - function element( $in, $heading = false, $bgcolor = '' ) { |
112 | | - if ( $heading ) { |
113 | | - $element = '<th>' . $in . '</th>'; |
114 | | - } else if ( $bgcolor ) { |
115 | | - $element = '<td bgcolor="#' . $bgcolor . '">' . $in . '</td>'; |
| 100 | + function element( $in, $bgcolor = '' ) { |
| 101 | + if ( $bgcolor ) { |
| 102 | + $element = Xml::element( 'td', array( 'bgcolor' => "#" . $bgcolor ), $in ); |
116 | 103 | } else { |
117 | | - $element = '<td>' . $in . '</td>'; |
| 104 | + $element = Xml::element( 'td', null, $in ); |
118 | 105 | } |
119 | 106 | return "\t\t" . $element . "\n"; |
120 | 107 | } |
— | — | @@ -159,14 +146,21 @@ |
160 | 147 | $out = wfMsgExt( 'languagestats-stats-for', array( 'parse', 'replaceafter' ), $languageName, $rcInLangLink ); |
161 | 148 | |
162 | 149 | # Create table header |
163 | | - $out .= $this->heading(); |
164 | | - $out .= $this->blockstart(); |
165 | | - $out .= $this->element( wfMsg( 'translate-page-group' ), true ); |
166 | | - $out .= $this->element( wfMsg( 'translate-total' ), true ); |
167 | | - $out .= $this->element( wfMsg( 'translate-untranslated' ), true ); |
168 | | - $out .= $this->element( wfMsg( 'translate-percentage-complete' ), true ); |
169 | | - $out .= $this->element( wfMsg( 'translate-percentage-fuzzy' ), true ); |
170 | | - $out .= $this->blockend(); |
| 150 | + $out .= Xml::openElement( 'table', array( |
| 151 | + 'class' => "sortable wikitable", |
| 152 | + 'border' => '2', |
| 153 | + 'cellpadding' => '4', |
| 154 | + 'cellspacing' => '0', |
| 155 | + 'style' => "background-color: #F9F9F9; border: 1px #AAAAAA solid; border-collapse: collapse; clear:both;", |
| 156 | + 'width' => "100%" |
| 157 | + ); |
| 158 | + $out .= Xml::openElement( 'tr' ); |
| 159 | + $out .= Xml::element( 'th', null, wfMsg( 'translate-page-group' ) ); |
| 160 | + $out .= Xml::element( 'th' null, wfMsg( 'translate-total' ) ); |
| 161 | + $out .= Xml::element( 'th', null, wfMsg( 'translate-untranslated' ) ); |
| 162 | + $out .= Xml::element( 'th', null, wfMsg( 'translate-percentage-complete' ) ); |
| 163 | + $out .= Xml::element( 'th', null, wfMsg( 'translate-percentage-fuzzy' ) ); |
| 164 | + $out .= Xml::closeElement( 'tr' ); |
171 | 165 | |
172 | 166 | return $out; |
173 | 167 | } |
— | — | @@ -248,7 +242,7 @@ |
249 | 243 | |
250 | 244 | // Bold for meta groups |
251 | 245 | if( $g->isMeta() ) { |
252 | | - $groupLabel = "<b>" . $groupLabel . "</b>"; |
| 246 | + $groupLabel = Xml::element( 'b', null, $groupLabel ); |
253 | 247 | } |
254 | 248 | |
255 | 249 | $translateGroupLink = $wgUser->getSkin()->link( |
— | — | @@ -260,18 +254,18 @@ |
261 | 255 | $queryParameters |
262 | 256 | ); |
263 | 257 | |
264 | | - $out .= $this->blockstart(); |
265 | | - $out .= $this->element( $translateGroupLink ); |
266 | | - $out .= $this->element( $total ); |
267 | | - $out .= $this->element( $total - $translated ); |
268 | | - $out .= $this->element( $translatedPercentage, false, $translatedPercentage == $errorString ? '' : $this->getBackgroundColour( $translated, $total ) ); |
269 | | - $out .= $this->element( $fuzzyPercentage, false, $translatedPercentage == $errorString ? '' : $this->getBackgroundColour( $fuzzy, $total, true ) ); |
270 | | - $out .= $this->blockend(); |
| 258 | + $out .= Xml::openElement( 'tr' ); |
| 259 | + $out .= Xml::element( 'td', null, $translateGroupLink ); |
| 260 | + $out .= Xml::element( 'td', null, $total ); |
| 261 | + $out .= Xml::element( 'td', null, $total - $translated ); |
| 262 | + $out .= $this->element( $translatedPercentage, $translatedPercentage == $errorString ? '' : $this->getBackgroundColour( $translated, $total ) ); |
| 263 | + $out .= $this->element( $fuzzyPercentage, $translatedPercentage == $errorString ? '' : $this->getBackgroundColour( $fuzzy, $total, true ) ); |
| 264 | + $out .= Xml::closeElement( 'tr' ); |
271 | 265 | } |
272 | 266 | |
273 | 267 | if ( $out ) { |
274 | 268 | $out = $this->createHeader( $code ) . $out; |
275 | | - $out .= $this->footer(); |
| 269 | + $out .= Xml::closeElement( 'table' ); |
276 | 270 | } else { |
277 | 271 | $out = wfMsgExt( 'translate-nothing-to-do', 'parse' ); |
278 | 272 | } |
Index: trunk/extensions/Translate/SpecialImportTranslations.php |
— | — | @@ -119,7 +119,9 @@ |
120 | 120 | ) ) . |
121 | 121 | Xml::hidden( 'token', $this->user->editToken() ) . |
122 | 122 | Xml::hidden( 'title', $this->getTitle()->getPrefixedText() ) . |
123 | | - "\n<table><tr><td>\n" |
| 123 | + Xml::openElement( 'table' ) . |
| 124 | + Xml::openElement( 'tr' ) . |
| 125 | + Xml::openElement( 'td' ); |
124 | 126 | ); |
125 | 127 | |
126 | 128 | $class = array( 'class' => 'mw-translate-import-inputs' ); |
— | — | @@ -128,11 +130,12 @@ |
129 | 131 | Xml::radioLabel( wfMsg( 'translate-import-from-url' ), |
130 | 132 | 'upload-type', 'url', 'mw-translate-up-url', |
131 | 133 | $this->request->getText( 'upload-type' ) === 'url' ) . |
132 | | - "\n</td><td>\n" . |
| 134 | + "\n" . Xml::closeElement( 'td' ) . Xml::openElement( 'td' ) . "\n" . |
133 | 135 | Xml::input( 'upload-url', 50, |
134 | 136 | $this->request->getText( 'upload-url' ), |
135 | 137 | array( 'id' => 'mw-translate-up-url-input' ) + $class ) . |
136 | | - "\n</td></tr><tr><td>\n" |
| 138 | + "\n" . . Xml::closeElement( 'td' ) . Xml::closeElement( 'tr' ) . |
| 139 | + Xml::openElement( 'tr' ) . Xml::openElement( 'td' ) . "\n" |
137 | 140 | ); |
138 | 141 | } |
139 | 142 | |
— | — | @@ -140,19 +143,21 @@ |
141 | 144 | Xml::radioLabel( wfMsg( 'translate-import-from-wiki' ), |
142 | 145 | 'upload-type', 'wiki', 'mw-translate-up-wiki', |
143 | 146 | $this->request->getText( 'upload-type' ) === 'wiki' ) . |
144 | | - "\n</td><td>\n" . |
| 147 | + "\n" . Xml::closeElement( 'td' ) . Xml::openElement( 'td' ) . "\n" . |
145 | 148 | Xml::input( 'upload-wiki', 50, |
146 | 149 | $this->request->getText( 'upload-wiki', 'File:' ), |
147 | 150 | array( 'id' => 'mw-translate-up-wiki-input' ) + $class ) . |
148 | | - "\n</td></tr><tr><td>\n" . |
| 151 | + "\n" . . Xml::closeElement( 'td' ) . Xml::closeElement( 'tr' ) . |
| 152 | + Xml::openElement( 'tr' ) . Xml::openElement( 'td' ) . "\n" . |
149 | 153 | Xml::radioLabel( wfMsg( 'translate-import-from-local' ), |
150 | 154 | 'upload-type', 'local', 'mw-translate-up-local', |
151 | 155 | $this->request->getText( 'upload-type' ) === 'local' ) . |
152 | | - "\n</td><td>\n" . |
| 156 | + "\n" . Xml::closeElement( 'td' ) . Xml::openElement( 'td' ) . "\n" . |
153 | 157 | Xml::input( 'upload-local', 50, |
154 | 158 | $this->request->getText( 'upload-local' ), |
155 | 159 | array( 'type' => 'file', 'id' => 'mw-translate-up-local-input' ) + $class ) . |
156 | | - "\n</td></tr></table>\n" . |
| 160 | + "\n" . . Xml::closeElement( 'td' ) . Xml::closeElement( 'tr' ) . |
| 161 | + Xml::closeElement( 'table' ) . |
157 | 162 | Xml::submitButton( wfMsg( 'translate-import-load' ) ) . |
158 | 163 | Xml::closeElement( 'form' ) |
159 | 164 | ); |
Index: trunk/extensions/Translate/SpecialMagic.php |
— | — | @@ -157,7 +157,7 @@ |
158 | 158 | return; |
159 | 159 | } else { |
160 | 160 | $o->save( $wgRequest ); |
161 | | - $wgOut->wrapWikiMsg( '<big><b>$1</b></big>', 'translate-magic-saved' ); |
| 161 | + $wgOut->wrapWikiMsg( '<strong><b>$1</b></strong>', 'translate-magic-saved' ); |
162 | 162 | $wgOut->addHTML( $o->output() ); |
163 | 163 | return; |
164 | 164 | } |