r67410 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67409‎ | r67410 | r67411 >
Date:19:04, 5 June 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Subpage handling, html fixes, don't strtolower user input
Modified paths:
  • /trunk/extensions/Translate/SpecialTranslationStats.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/SpecialTranslationStats.php
@@ -39,7 +39,7 @@
4040 if ( $opts['scale'] === 'hours' ) $opts->validateIntBounds( 'days', 1, 4 );
4141
4242 foreach ( array( 'group', 'language' ) as $t ) {
43 - $values = array_map( 'trim', explode( ',', strtolower( $opts[$t] ) ) );
 43+ $values = array_map( 'trim', explode( ',', $opts[$t] ) );
4444 $values = array_splice( $values, 0, 4 );
4545 $opts[$t] = implode( ',', $values );
4646 }
@@ -73,9 +73,9 @@
7474
7575 $wgOut->addHTML(
7676 Xml::fieldset( wfMsg( 'translate-statsf-options' ) ) .
77 - Xml::openElement( 'form', array( 'action' => $wgScript ) ) .
78 - Xml::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
79 - Xml::hidden( 'preview', 1 ) .
 77+ Html::openElement( 'form', array( 'action' => $wgScript ) ) .
 78+ Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
 79+ Html::hidden( 'preview', 1 ) .
8080 '<table>'
8181 );
8282
@@ -115,13 +115,13 @@
116116 $titleText = $this->getTitle()->getPrefixedText();
117117
118118 $wgOut->addHTML(
119 - '<hr />' .
120 - Xml::element( 'pre', null, "{{{$titleText}{$spiParams}}}" )
 119+ Html::element( 'hr' ) .
 120+ Html::element( 'pre', null, "{{{$titleText}{$spiParams}}}" )
121121 );
122122
123123 $wgOut->addHTML(
124 - '<hr />' .
125 - Xml::tags( 'div', array( 'style' => 'margin: 1em auto; text-align: center;' ), $this->image( $opts ) )
 124+ Html::element( 'hr' ) .
 125+ Html::rawElement( 'div', array( 'style' => 'margin: 1em auto; text-align: center;' ), $this->image( $opts ) )
126126 );
127127 }
128128
@@ -155,7 +155,7 @@
156156 $options[] = $radio . ' ' . $this->eLabel( $id );
157157 }
158158
159 - $s .= Xml::tags( 'span', array( 'id' => $name ), implode( ' ', $options ) );
 159+ $s .= implode( ' ', $options );
160160
161161 $s .= '</td></tr>' . "\n";
162162 return $s;
@@ -443,7 +443,7 @@
444444 if ( !max( $this->filters ) ) return 0;
445445 if ( strpos( $row->rc_title, '/' ) === false ) return - 1;
446446
447 - list( $key, $code ) = explode( '/', $wgContLang->lcfirst( $row->rc_title ), 2 );
 447+ list( $key, $code ) = TranslateUtils::figureMessage( $row->rc_title );
448448 $indexKey = '';
449449
450450 if ( $this->filters['group'] ) {
@@ -468,4 +468,4 @@
469469 $labels = array_keys( $this->cache );
470470 }
471471 }
472 -}
\ No newline at end of file
 472+}

Status & tagging log