r79948 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79947‎ | r79948 | r79949 >
Date:18:58, 10 January 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Follow up to r79938
Modified paths:
  • /trunk/extensions/LiveTranslate/LiveTranslate.i18n.php (modified) (history)
  • /trunk/extensions/LiveTranslate/specials/SpecialLiveTranslate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiveTranslate/LiveTranslate.i18n.php
@@ -38,7 +38,11 @@
3939 'livetranslate-special-button' => 'Save',
4040 'livetranslate-special-type' => 'Type',
4141 'livetranslate-special-location' => 'Location',
 42+ 'livetranslate-special-remove' => 'Remove',
4243 'livetranslate-special-add-tm' => 'Add a new translation memory',
 44+ 'livetranslate-special-current-tms' => 'Existing translation memories',
 45+ 'livetranslate-special-tms-update' => 'Update translation memories',
 46+ 'livetranslate-special-update' => 'Update translation memories',
4347 );
4448
4549 /** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца))
Index: trunk/extensions/LiveTranslate/specials/SpecialLiveTranslate.php
@@ -80,7 +80,7 @@
8181 $this->handleSubmission();
8282 }
8383
84 - $this->displayTMConfig();
 84+ $this->displayTMConfig( $this->getTMConfigItems() );
8585 }
8686
8787 /**
@@ -109,8 +109,10 @@
110110 * Displays the translation memories config table.
111111 *
112112 * @since 0.4
 113+ *
 114+ * @param array $tms The current translation memories
113115 */
114 - protected function displayTMConfig() {
 116+ protected function displayTMConfig( array $tms ) {
115117 global $wgOut, $wgUser;
116118
117119 $wgOut->addHtml( Html::openElement(
@@ -123,19 +125,31 @@
124126 )
125127 ) );
126128
127 - $tms = $this->getTMConfigItems();
128 -
129129 if ( count( $tms ) > 0 ) {
 130+ $wgOut->addHTML( '<h3>' . htmlspecialchars( wfMsg( 'livetranslate-special-tms-update' ) ) . '</h3>' );
 131+
 132+ $wgOut->addHTML(
 133+ Html::input(
 134+ '',
 135+ wfMsg( 'livetranslate-special-update' ),
 136+ 'submit',
 137+ array( 'id' => 'tmform-updatesubmit' )
 138+ )
 139+ );
 140+
 141+ $wgOut->addHTML( '<h3>' . htmlspecialchars( wfMsg( 'livetranslate-special-current-tms' ) ) . '</h3>' );
 142+
130143 $wgOut->addHTML( Html::openElement(
131144 'table',
132 - array( 'class' => 'wikitable', 'style' => 'width:100%' )
 145+ array( 'class' => 'wikitable', 'style' => 'width:50%' )
133146 ) );
134147
135148 $wgOut->addHTML( Html::rawElement(
136149 'tr',
137150 array(),
138 - Html::element( 'th', array(), wfMsg( 'livetranslate-special-location' ) ) .
139 - Html::element( 'th', array(), wfMsg( 'livetranslate-special-type' ) )
 151+ Html::element( 'th', array( 'width' => '400px' ), wfMsg( 'livetranslate-special-location' ) ) .
 152+ Html::element( 'th', array( 'width' => '200px' ), wfMsg( 'livetranslate-special-type' ) ) .
 153+ Html::element( 'th', array( 'width' => '100px' ), wfMsg( 'livetranslate-special-remove' ) )
140154 ) );
141155
142156 foreach ( $tms as $tm ) {
@@ -204,8 +218,21 @@
205219 $wgOut->addHTML( Html::rawElement(
206220 'tr',
207221 array(),
208 - Html::element( 'td', array(), $tm->memory_location ) . // TODO
209 - Html::element( 'td', array(), $tm->memory_type ) // TODO
 222+ Html::rawElement(
 223+ 'td',
 224+ array(),
 225+ Html::input( 'tmlocation-' . $tm->memory_id, $tm->memory_location, 'text', array( 'size' => 60 ) )
 226+ ) .
 227+ Html::rawElement(
 228+ 'td',
 229+ array(),
 230+ $this->getTypeSelector( 'tmtype-' . $tm->memory_id, $tm->memory_type )
 231+ ) .
 232+ Html::rawElement(
 233+ 'td',
 234+ array( 'style' => 'text-align:center' ),
 235+ Xml::check( 'tmdel-' . $tm->memory_id, false )
 236+ )
210237 ) );
211238 }
212239
@@ -221,11 +248,11 @@
222249
223250 $wgOut->addHTML(
224251 '<table><tr>' .
 252+ '<td><b>' . htmlspecialchars( wfMsg( 'livetranslate-special-type' ) ) . ': </b></td>' .
 253+ '<td>' . $this->getTypeSelector( 'newtm-type', '' ) . '</td>' . // TODO
 254+ '</tr><tr>' .
225255 '<td><b>' . htmlspecialchars( wfMsg( 'livetranslate-special-location' ) ) . ': </b></td>' .
226256 '<td>' . Html::input( 'newtm-location', '', 'text', array( 'size' => 75 ) ) . '</td>' .
227 - '</tr><tr>' .
228 - '<td><b>' . htmlspecialchars( wfMsg( 'livetranslate-special-type' ) ) . ': </b></td>' .
229 - '<td>' . $this->getTypeSelector( 'newtm-type', '' ) . '</td>' . // TODO
230257 '</tr></table>'
231258 );
232259 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r79938Work on special pagejeroendedauw16:08, 10 January 2011

Status & tagging log