r79939 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79938‎ | r79939 | r79940 >
Date:16:31, 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
@@ -35,6 +35,9 @@
3636 'livetranslate-tmtype-tmx' => 'Translation Memory eXchange',
3737 'livetranslate-tmtype-gcsv' => 'Google CSV',
3838 'livetranslate-special-no-tms-yet' => 'There are no translation memories yet.',
 39+ 'livetranslate-special-button' => 'Save',
 40+ 'livetranslate-special-type' => 'Type',
 41+ 'livetranslate-special-location' => 'Location',
3942 );
4043
4144 /** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца))
Index: trunk/extensions/LiveTranslate/specials/SpecialLiveTranslate.php
@@ -76,6 +76,8 @@
7777 return;
7878 }
7979
 80+ // TODO: handle submissions
 81+
8082 $this->displayTMConfig();
8183 }
8284
@@ -85,20 +87,55 @@
8688 * @since 0.4
8789 */
8890 protected function displayTMConfig() {
89 - global $wgOut;
 91+ global $wgOut, $wgUser;
9092
91 - $tms = $this->getTMConfigItems();
 93+ $wgOut->addHtml( Html::openElement(
 94+ 'form',
 95+ array(
 96+ 'id' => 'tmform',
 97+ 'name' => 'tmform',
 98+ 'method' => 'post',
 99+ 'action' => $this->getTitle()->getLocalURL(),
 100+ )
 101+ ) );
92102
 103+ $tms = $this->getTMConfigItems();
 104+
93105 if ( count( $tms ) > 0 ) {
 106+ $wgOut->addHTML( Html::openElement(
 107+ 'table',
 108+ array( 'class' => 'wikitable', 'style' => 'width:100%' )
 109+ ) );
 110+
 111+ $wgOut->addHTML( Html::rawElement(
 112+ 'tr',
 113+ array(),
 114+ Html::element( 'th', array(), wfMsg( 'livetranslate-special-location' ) ),
 115+ Html::element( 'th', array(), wfMsg( 'livetranslate-special-type' ) )
 116+ ) );
 117+
94118 foreach ( $tms as $tm ) {
95119 $this->displayTMItem( $tm );
96 - }
 120+ }
 121+
 122+ $wgOut->addHTML( Html::closeElement( 'table' ) );
97123 }
98124 else {
99125 $wgOut->addWikiMsg( 'livetranslate-special-no-tms-yet' );
100126 }
101127
102128 $this->displayAddNewTM();
 129+
 130+ $wgOut->addHtml(
 131+ Html::input(
 132+ '',
 133+ wfMsg( 'livetranslate-special-button' ),
 134+ 'submit',
 135+ array( 'id' => 'tmform-submit' )
 136+ ) .
 137+ Html::hidden( 'wpEditToken', $wgUser->editToken() ) .
 138+ Html::closeElement( 'form' )
 139+ );
103140 }
104141
105142 /**
@@ -139,7 +176,12 @@
140177 protected function displayTMItem( $tm ) {
141178 global $wgOut;
142179
143 -
 180+ $wgOut->addHTML( Html::rawElement(
 181+ 'tr',
 182+ array(),
 183+ Html::element( 'td', array(), $tm->memory_location ), // TODO
 184+ Html::element( 'rd', array(), $tm->memory_type ) // TODO
 185+ ) );
144186 }
145187
146188 /**
@@ -148,7 +190,7 @@
149191 * @since 0.4
150192 */
151193 protected function displayAddNewTM() {
152 -
 194+ // TODO
153195 }
154196
155197 }

Past revisions this follows-up on

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

Status & tagging log