From: umherirrender Date: Thu, 27 Dec 2012 16:26:24 +0000 (+0100) Subject: Fix some validation errors on Special:Import X-Git-Tag: 1.31.0-rc.0~21204 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=commitdiff_plain;h=b28c7a8adc70034fbb8b10e632b4196d9087eed4;p=lhc%2Fweb%2Fwiklou.git Fix some validation errors on Special:Import Fixed errors are: * Duplicate ID mw-import-table * Duplicate ID mw-interwiki-rootpage * The for attribute of the label element must refer to a form control (2x) Added also a id for another input element for easy user scripting Change-Id: I9c7aa3b2af2d49cf3aed42a057ab13aa1275ee90 --- diff --git a/includes/specials/SpecialImport.php b/includes/specials/SpecialImport.php index 362fc5cf4c..bed39b263e 100644 --- a/includes/specials/SpecialImport.php +++ b/includes/specials/SpecialImport.php @@ -194,14 +194,14 @@ class SpecialImport extends SpecialPage { $this->msg( 'importtext' )->parseAsBlock() . Html::hidden( 'action', 'submit' ) . Html::hidden( 'source', 'upload' ) . - Xml::openElement( 'table', array( 'id' => 'mw-import-table' ) ) . + Xml::openElement( 'table', array( 'id' => 'mw-import-table-upload' ) ) . " " . Xml::label( $this->msg( 'import-upload-filename' )->text(), 'xmlimport' ) . " " . - Xml::input( 'xmlimport', 50, '', array( 'type' => 'file' ) ) . ' ' . + Xml::input( 'xmlimport', 50, '', array( 'id' => 'xmlimport', 'type' => 'file' ) ) . ' ' . " @@ -215,11 +215,11 @@ class SpecialImport extends SpecialPage { " . - Xml::label( $this->msg( 'import-interwiki-rootpage' )->text(), 'mw-interwiki-rootpage' ) . + Xml::label( $this->msg( 'import-interwiki-rootpage' )->text(), 'mw-interwiki-rootpage-upload' ) . " " . Xml::input( 'rootpage', 50, $this->rootpage, - array( 'id' => 'mw-interwiki-rootpage', 'type' => 'text' ) ) . ' ' . + array( 'id' => 'mw-interwiki-rootpage-upload', 'type' => 'text' ) ) . ' ' . " @@ -260,13 +260,13 @@ class SpecialImport extends SpecialPage { Html::hidden( 'action', 'submit' ) . Html::hidden( 'source', 'interwiki' ) . Html::hidden( 'editToken', $user->getEditToken() ) . - Xml::openElement( 'table', array( 'id' => 'mw-import-table' ) ) . + Xml::openElement( 'table', array( 'id' => 'mw-import-table-interwiki' ) ) . " " . Xml::label( $this->msg( 'import-interwiki-source' )->text(), 'interwiki' ) . " " . - Xml::openElement( 'select', array( 'name' => 'interwiki' ) ) + Xml::openElement( 'select', array( 'name' => 'interwiki', 'id' => 'interwiki' ) ) ); foreach( $wgImportSources as $prefix ) { $selected = ( $this->interwiki === $prefix ) ? ' selected="selected"' : ''; @@ -275,7 +275,7 @@ class SpecialImport extends SpecialPage { $out->addHTML( Xml::closeElement( 'select' ) . - Xml::input( 'frompage', 50, $this->frompage ) . + Xml::input( 'frompage', 50, $this->frompage, array( 'id' => 'frompage' ) ) . " @@ -321,11 +321,11 @@ class SpecialImport extends SpecialPage { " . - Xml::label( $this->msg( 'import-interwiki-rootpage' )->text(), 'mw-interwiki-rootpage' ) . + Xml::label( $this->msg( 'import-interwiki-rootpage' )->text(), 'mw-interwiki-rootpage-interwiki' ) . " " . Xml::input( 'rootpage', 50, $this->rootpage, - array( 'id' => 'mw-interwiki-rootpage', 'type' => 'text' ) ) . ' ' . + array( 'id' => 'mw-interwiki-rootpage-interwiki', 'type' => 'text' ) ) . ' ' . "