r42953 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r42952‎ | r42953 | r42954 >
Date:22:08, 31 October 2008
Author:tparscal
Status:old
Tags:
Comment:
Improved UI.
Modified paths:
  • /branches/CentralNotice-SpecialPage-Integration/CentralNotice.i18n.php (modified) (history)
  • /branches/CentralNotice-SpecialPage-Integration/SpecialNoticeTemplate.php (modified) (history)

Diff [purge]

Index: branches/CentralNotice-SpecialPage-Integration/SpecialNoticeTemplate.php
@@ -280,20 +280,34 @@
281281
282282 $htmlOut .= Xml::element( 'td', null, $count);
283283
284 - $htmlOut .= Xml::element( 'td', null,
285 - wfMsgExt( "Centralnotice-{$currentTemplate}-{$field}", array( 'language' => 'en') )
 284+ // English text
 285+ $englishText = wfMsg( 'centralnotice-message-not-set' );
 286+ $englishTextExists = false;
 287+ if( Title::newFromText( $message, NS_MEDIAWIKI )->exists() ) {
 288+ $englishText = wfMsgExt( "Centralnotice-{$currentTemplate}-{$field}",
 289+ array( 'language' => 'en' )
 290+ );
 291+ $englishTextExists = true;
 292+ }
 293+ $htmlOut .= Xml::tags( 'td', null,
 294+ Xml::element( 'span',
 295+ array( 'style' => 'font-style:italic;' . ( !$englishTextExists ? 'color:silver' : '' ) ),
 296+ $englishText
 297+ )
286298 );
287299
288 - // Input
289 - $text = '';
 300+ // Foreign text input
 301+ $foreignText = '';
 302+ $foreignTextExists = false;
290303 if( Title::newFromText( $message, NS_MEDIAWIKI )->exists() ) {
291 - $text = wfMsgExt( "Centralnotice-{$currentTemplate}-{$field}",
 304+ $foreignText = wfMsgExt( "Centralnotice-{$currentTemplate}-{$field}",
292305 array( 'language' => $wpUserLang )
293306 );
 307+ $foreignTextExists = true;
294308 }
295309 $htmlOut .= Xml::tags( 'td', null,
296 - Xml::input( "updateText[{$wpUserLang}][{$currentTemplate}-{$field}]", '', $text,
297 - array( 'style' => 'width:100%;' . ( $text == '' ? 'color:red' : '' ) )
 310+ Xml::input( "updateText[{$wpUserLang}][{$currentTemplate}-{$field}]", '', $foreignText,
 311+ array( 'style' => 'width:100%;' . ( !$foreignTextExists ? 'color:red' : '' ) )
298312 )
299313 );
300314
Index: branches/CentralNotice-SpecialPage-Integration/CentralNotice.i18n.php
@@ -86,6 +86,7 @@
8787 'centralnotice-number-uses' => 'Uses',
8888 'centralnotice-edit-template' => 'Edit template',
8989 'centralnotice-message' => 'Message',
 90+ 'centralnotice-message-not-set' => 'Message not set',
9091 );
9192
9293 /** Afrikaans (Afrikaans)

Status & tagging log