Watchlist: Separate non-form parts out of the <fieldset>
authorMatmaRex <matma.rex@gmail.com>
Mon, 20 May 2013 09:07:25 +0000 (11:07 +0200)
committerMatmaRex <matma.rex@gmail.com>
Tue, 23 Jul 2013 17:36:51 +0000 (19:36 +0200)
These include the information blurb at the top and the "Mark all pages
visited" button.

This also allows us the change the form-inside-fieldset nesting to
saner fieldset-inside-form. The 'mw-watchlist-form-namespaceselector'
id was removed; the primary form now has id of 'mw-watchlist-form'.

Bug: 48615
Change-Id: I9398922dc4cabc7b190f8d97c5d91a05710206bb

includes/specials/SpecialWatchlist.php

index b4bea60..5d3dc2f 100644 (file)
@@ -245,12 +245,8 @@ class SpecialWatchlist extends SpecialPage {
                        $output->showLagWarning( $lag );
                }
 
-               # Create output form
-               $form = Xml::fieldset(
-                       $this->msg( 'watchlist-options' )->text(),
-                       false,
-                       array( 'id' => 'mw-watchlist-options' )
-               );
+               # Create output
+               $form = '';
 
                # Show watchlist header
                $form .= "<p>";
@@ -275,7 +271,16 @@ class SpecialWatchlist extends SpecialPage {
                        $form .= Xml::closeElement( 'form' ) . "\n";
                }
 
-               $form .= "<hr />\n";
+               $form .= Xml::openElement( 'form', array(
+                       'method' => 'post',
+                       'action' => $this->getTitle()->getLocalURL(),
+                       'id' => 'mw-watchlist-form'
+               ) );
+               $form .= Xml::fieldset(
+                       $this->msg( 'watchlist-options' )->text(),
+                       false,
+                       array( 'id' => 'mw-watchlist-options' )
+               );
 
                $tables = array( 'recentchanges', 'watchlist' );
                $fields = RecentChange::selectFields();
@@ -355,7 +360,6 @@ class SpecialWatchlist extends SpecialPage {
                $form .= $wlInfo;
                $form .= $cutofflinks;
                $form .= $lang->pipeList( $links ) . "\n";
-               $form .= Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalURL(), 'id' => 'mw-watchlist-form-namespaceselector' ) ) . "\n";
                $form .= "<hr />\n<p>";
                $form .= Html::namespaceSelector(
                        array(
@@ -386,8 +390,8 @@ class SpecialWatchlist extends SpecialPage {
                foreach ( $hiddenFields as $key => $value ) {
                        $form .= Html::hidden( $key, $value ) . "\n";
                }
-               $form .= Xml::closeElement( 'form' ) . "\n";
                $form .= Xml::closeElement( 'fieldset' ) . "\n";
+               $form .= Xml::closeElement( 'form' ) . "\n";
                $output->addHTML( $form );
 
                # If there's nothing to show, stop here