SearchFormWidget: Move hidden fields below the ActionFieldLayout
authorBartosz Dziewoński <matma.rex@gmail.com>
Thu, 23 Feb 2017 17:02:29 +0000 (18:02 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Thu, 23 Feb 2017 17:02:29 +0000 (18:02 +0100)
I think ideally, these would be at the end of the form, but there
are some hooks below which can produce arbitrary HTML and potentially
want to override these with their own fields, so I'm avoiding any
revolutionary changes to the field order here.

Bug: T158856
Change-Id: I377c0061a365930e11454a86c1e0926853789b55

includes/widget/search/SearchFormWidget.php

index 1451843..b8d415f 100644 (file)
@@ -79,6 +79,8 @@ class SearchFormWidget {
         * @return string HTML
         */
        protected function shortDialogHtml( $profile, $term, $numResults, $totalResults, $offset ) {
+               $html = '';
+
                $searchWidget = new SearchInputWidget( [
                        'id' => 'searchText',
                        'name' => 'search',
@@ -96,11 +98,7 @@ class SearchFormWidget {
                        'align' => 'top',
                ] );
 
-               $html =
-                       Html::hidden( 'title', $this->specialSearch->getPageTitle()->getPrefixedText() ) .
-                       Html::hidden( 'profile', $profile ) .
-                       Html::hidden( 'fulltext', '1' ) .
-                       $layout;
+               $html .= $layout;
 
                if ( $totalResults > 0 && $offset < $totalResults ) {
                        $html .= Xml::tags(
@@ -113,6 +111,11 @@ class SearchFormWidget {
                        );
                }
 
+               $html .=
+                       Html::hidden( 'title', $this->specialSearch->getPageTitle()->getPrefixedText() ) .
+                       Html::hidden( 'profile', $profile ) .
+                       Html::hidden( 'fulltext', '1' );
+
                return $html;
        }