X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FXml.php;h=11f14dbb698da6c464e6a9a242b6479b5ef33aba;hb=3f7ecb40273a079113a9a95a4e26d686215d7427;hp=c356c6db61973ee4e63048f43cfd7dd1abf810f6;hpb=112892455f2d42f4981760d53e404af8444b9ec5;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Xml.php b/includes/Xml.php index c356c6db61..11f14dbb69 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -144,26 +144,19 @@ class Xml { public static function monthSelector( $selected = '', $allmonths = null, $id = 'month' ) { global $wgLang; $options = array(); + $data = new XmlSelect( 'month', $id, $selected ); if ( is_null( $selected ) ) { $selected = ''; } if ( !is_null( $allmonths ) ) { - $options[] = self::option( - wfMessage( 'monthsall' )->text(), - $allmonths, - $selected === $allmonths - ); + $options[wfMessage( 'monthsall' )->text()] = $allmonths; } for ( $i = 1; $i < 13; $i++ ) { - $options[] = self::option( $wgLang->getMonthName( $i ), $i, $selected === $i ); + $options[$wgLang->getMonthName( $i )] = $i; } - return self::openElement( 'select', array( - 'id' => $id, - 'name' => 'month', - 'class' => 'mw-month-selector' - ) ) - . implode( "\n", $options ) - . self::closeElement( 'select' ); + $data->addOptions( $options ); + $data->setAttribute( 'class', 'mw-month-selector' ); + return $data->getHTML(); } /** @@ -718,10 +711,10 @@ class Xml { xml_parser_set_option( $parser, XML_OPTION_CASE_FOLDING, false ); if ( !xml_parse( $parser, $text, true ) ) { - //$err = xml_error_string( xml_get_error_code( $parser ) ); - //$position = xml_get_current_byte_index( $parser ); - //$fragment = $this->extractFragment( $html, $position ); - //$this->mXmlError = "$err at byte $position:\n$fragment"; + // $err = xml_error_string( xml_get_error_code( $parser ) ); + // $position = xml_get_current_byte_index( $parser ); + // $fragment = $this->extractFragment( $html, $position ); + // $this->mXmlError = "$err at byte $position:\n$fragment"; xml_parser_free( $parser ); return false; }