r42844 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r42843‎ | r42844 | r42845 >
Date:21:47, 30 October 2008
Author:tparscal
Status:old
Tags:
Comment:
Improved UI.
Modified paths:
  • /branches/CentralNotice-SpecialPage-Integration/SpecialNoticeTranslate.php (modified) (history)

Diff [purge]

Index: branches/CentralNotice-SpecialPage-Integration/SpecialNoticeTranslate.php
@@ -81,13 +81,18 @@
8282 // Build HTML
8383 $htmlOut = Xml::openElement( 'form', array( 'method' => 'post' ) );
8484 $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+ );
8691
8792 // 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] );
9297
9398 // Rows
9499 $fields = array( 'heading', 'target', 'button', 'hide' );
@@ -96,12 +101,7 @@
97102 $message = ( $wpUserLang == 'en' ) ? "Centralnotice-{$field}" : "Centralnotice-{$field}/{$wpUserLang}";
98103
99104 // 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+
106106 // English value
107107 $htmlOut .= Xml::openElement( 'tr' );
108108 $htmlOut .= Xml::element( 'td', null, $field );
@@ -109,18 +109,16 @@
110110 wfMsgExt( "centralnotice-{$field}", array( 'language' => 'en') )
111111 );
112112
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 -
122113 // Input
 114+ $title = Title::newFromText( $message, NS_MEDIAWIKI );
 115+ $text = '';
 116+ if( $title->exists() ) {
 117+ $text = wfMsgExt( "centralnotice-{$field}", array ( 'language' => $wpUserLang ) );
 118+ }
123119 $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+ )
125123 );
126124
127125 $htmlOut .= Xml::closeElement( 'tr' );

Status & tagging log