Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/161980

Change subject: Remove CiteThisPageForm, fold into SpecialCiteThisPage
......................................................................

Remove CiteThisPageForm, fold into SpecialCiteThisPage

Change-Id: I46cc6cd167d478fa2e28894eb3f6a4f2a80a4060
---
M SpecialCiteThisPage.php
1 file changed, 26 insertions(+), 39 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CiteThisPage 
refs/changes/80/161980/1

diff --git a/SpecialCiteThisPage.php b/SpecialCiteThisPage.php
index 7becc21..ba1e408 100644
--- a/SpecialCiteThisPage.php
+++ b/SpecialCiteThisPage.php
@@ -19,8 +19,7 @@
                $page = $par !== null ? $par : $this->getRequest()->getText( 
'page' );
                $title = Title::newFromText( $page );
 
-               $cform = new CiteThisPageForm( $title );
-               $cform->execute();
+               $this->showForm( $title );
 
                if ( $title && $title->exists() ) {
                        $id = $this->getRequest()->getInt( 'id' );
@@ -28,51 +27,39 @@
                        $cout->execute();
                }
        }
-}
 
-class CiteThisPageForm {
-       /**
-        * @var Title
-        */
-       public $mTitle;
-
-       function __construct( &$title ) {
-               $this->mTitle =& $title;
-       }
-
-       function execute() {
-               global $wgOut, $wgScript;
-
-               $wgOut->addHTML(
+       private function showForm( Title $title = null ) {
+               $this->getOutput()->addHTML(
                        Xml::openElement( 'form',
                                array(
                                        'id' => 'specialCiteThisPage',
                                        'method' => 'get',
-                                       'action' => $wgScript
+                                       'action' => wfScript(),
                                ) ) .
-                               Html::hidden( 'title', 
SpecialPage::getTitleFor( 'CiteThisPage' )->getPrefixedDBkey() ) .
-                               Xml::openElement( 'label' ) .
-                                       wfMessage( 'citethispage-change-target' 
)->escaped() . ' ' .
-                                       Xml::element( 'input',
-                                               array(
-                                                       'type' => 'text',
-                                                       'size' => 30,
-                                                       'name' => 'page',
-                                                       'value' => is_object( 
$this->mTitle ) ? $this->mTitle->getPrefixedText() : ''
-                                               ),
-                                               ''
-                                       ) .
-                                       ' ' .
-                                       Xml::element( 'input',
-                                               array(
-                                                       'type' => 'submit',
-                                                       'value' => wfMessage( 
'citethispage-change-submit' )->escaped()
-                                               ),
-                                               ''
-                                       ) .
-                               Xml::closeElement( 'label' ) .
+                       Html::hidden( 'title', SpecialPage::getTitleFor( 
'CiteThisPage' )->getPrefixedDBkey() ) .
+                       Xml::openElement( 'label' ) .
+                       $this->msg( 'citethispage-change-target' )->escaped() . 
' ' .
+                       Xml::element( 'input',
+                               array(
+                                       'type' => 'text',
+                                       'size' => 30,
+                                       'name' => 'page',
+                                       'value' => $title ? 
$title->getPrefixedText() : ''
+                               ),
+                               ''
+                       ) .
+                       ' ' .
+                       Xml::element( 'input',
+                               array(
+                                       'type' => 'submit',
+                                       'value' => $this->msg( 
'citethispage-change-submit' )->escaped()
+                               ),
+                               ''
+                       ) .
+                       Xml::closeElement( 'label' ) .
                        Xml::closeElement( 'form' )
                );
+
        }
 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/161980
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I46cc6cd167d478fa2e28894eb3f6a4f2a80a4060
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CiteThisPage
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to