Florianschmidtwelzow has uploaded a new change for review.
https://gerrit.wikimedia.org/r/170309
Change subject: Use HTMLForm for Special:FileDuplicateSearch
......................................................................
Use HTMLForm for Special:FileDuplicateSearch
Prepare the usage of MediaWiki UI.
Bug: 71436
Change-Id: I12240aaf624dff5219b344648b20373594b5ec46
---
M includes/specials/SpecialFileDuplicateSearch.php
1 file changed, 32 insertions(+), 17 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/09/170309/1
diff --git a/includes/specials/SpecialFileDuplicateSearch.php
b/includes/specials/SpecialFileDuplicateSearch.php
index fc26c90..246eb7e 100644
--- a/includes/specials/SpecialFileDuplicateSearch.php
+++ b/includes/specials/SpecialFileDuplicateSearch.php
@@ -110,24 +110,39 @@
$out = $this->getOutput();
# Create the input form
+ $formFields = array(
+ 'filename' => array(
+ 'type' => 'text',
+ 'name' => 'filename',
+ 'label-message' =>
'fileduplicatesearch-filename',
+ 'id' => 'filename',
+ 'size' => 50,
+ 'value' => $this->filename
+ ),
+ 'title' => array(
+ 'type' => 'hidden',
+ 'name' => 'title',
+ 'value' =>
$this->getPageTitle()->getPrefixedDBKey()
+ )
+ );
+ $htmlForm = new HTMLForm( $formFields, $this->getContext() );
+ $htmlForm->setSubmitCallback(
+ function() {
+ return false;
+ }
+ );
+ $htmlForm->setMethod( 'get' );
+ $htmlForm->setSubmitProgressive();
+
$out->addHTML(
- Html::openElement(
- 'form',
- array( 'id' => 'fileduplicatesearch', 'method'
=> 'get', 'action' => wfScript() )
- ) . "\n" .
- Html::hidden( 'title',
$this->getPageTitle()->getPrefixedDBkey() ) . "\n" .
- Html::openElement( 'fieldset' ) . "\n" .
- Html::element( 'legend', null, $this->msg(
'fileduplicatesearch-legend' )->text() ) . "\n" .
- Xml::inputLabel(
- $this->msg(
'fileduplicatesearch-filename' )->text(),
- 'filename',
- 'filename',
- 50,
- $this->filename
- ) . "\n" .
- Xml::submitButton( $this->msg(
'fileduplicatesearch-submit' )->text() ) . "\n" .
- Html::closeElement( 'fieldset' ) . "\n" .
- Html::closeElement( 'form' )
+ Html::openElement( 'fieldset' ) . "\n" .
+ Html::element( 'legend', null, $this->msg(
'fileduplicatesearch-legend' )->text() )
+ );
+
+ $htmlForm->show();
+
+ $out->addHtml(
+ Html::closeElement( 'fieldset' )
);
if ( $this->file ) {
--
To view, visit https://gerrit.wikimedia.org/r/170309
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I12240aaf624dff5219b344648b20373594b5ec46
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits