Jack Phoenix has uploaded a new change for review.

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

Change subject: Allow QueryPage subclasses to use a different "no results" 
message than "specialpage-empty"
......................................................................

Allow QueryPage subclasses to use a different "no results" message than 
"specialpage-empty"

Child classes wishing to show a different message, such as wikiHow's
NewArticleBoost extension, need to override getEmptyText() to display
their custom message via the appropriate OutputPage method(s).
getEmptyText()

Change-Id: If488e2c81b225eb651e52bcca0fea08b8e685286
---
M includes/specialpage/QueryPage.php
1 file changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/34/207334/1

diff --git a/includes/specialpage/QueryPage.php 
b/includes/specialpage/QueryPage.php
index da752f6..a29525c 100644
--- a/includes/specialpage/QueryPage.php
+++ b/includes/specialpage/QueryPage.php
@@ -253,6 +253,15 @@
        }
 
        /**
+        * Outputs some kind of an informative message (via OutputPage) to let 
the
+        * user know that the query returned nothing and thus there's nothing to
+        * show.
+        */
+       function getEmptyText() {
+               $this->getOutput()->addWikiMsg( 'specialpage-empty' );
+       }
+
+       /**
         * If using extra form wheely-dealies, return a set of parameters here
         * as an associative array. They will be encoded and added to the paging
         * links (prev/next/lengths).
@@ -546,7 +555,7 @@
                        } else {
                                # No results to show, so don't bother with 
"showing X of Y" etc.
                                # -- just let the user know and give up now
-                               $out->addWikiMsg( 'specialpage-empty' );
+                               $this->getEmptyText();
                                $out->addHTML( Xml::closeElement( 'div' ) );
                                return;
                        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If488e2c81b225eb651e52bcca0fea08b8e685286
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix <[email protected]>

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

Reply via email to