r99305 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99304‎ | r99305 | r99306 >
Date:11:41, 8 October 2011
Author:nikerabbit
Status:resolved
Tags:
Comment:
Small cleanups to XmlSelect
Modified paths:
  • /trunk/phase3/includes/Xml.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Xml.php
@@ -466,7 +466,7 @@
467467 if( $selected ) {
468468 $attribs['selected'] = 'selected';
469469 }
470 - return self::element( 'option', $attribs, $text );
 470+ return Html::element( 'option', $attribs, $text );
471471 }
472472
473473 /**
@@ -888,7 +888,7 @@
889889 * @return array|null
890890 */
891891 public function getAttribute( $name ) {
892 - if ( isset($this->attributes[$name]) ) {
 892+ if ( isset( $this->attributes[$name] ) ) {
893893 return $this->attributes[$name];
894894 } else {
895895 return null;
@@ -932,7 +932,7 @@
933933 foreach( $options as $label => $value ) {
934934 if ( is_array( $value ) ) {
935935 $contents = self::formatOptions( $value, $default );
936 - $data .= Xml::tags( 'optgroup', array( 'label' => $label ), $contents ) . "\n";
 936+ $data .= Html::rawElement( 'optgroup', array( 'label' => $label ), $contents ) . "\n";
937937 } else {
938938 $data .= Xml::option( $label, $value, $value === $default ) . "\n";
939939 }
@@ -951,7 +951,7 @@
952952 $contents .= self::formatOptions( $options, $this->default );
953953 }
954954
955 - return Xml::tags( 'select', $this->attributes, rtrim( $contents ) );
 955+ return Html::rawElement( 'select', $this->attributes, rtrim( $contents ) );
956956 }
957957 }
958958

Follow-up revisions

RevisionCommit summaryAuthorDate
r99306Followup r99305 - change tests to match behaviour. Would set globals but rest...nikerabbit11:58, 8 October 2011

Status & tagging log