Special:Search: Insert a difference between exist and non exist page
authorFlorian <florian.schmidt.welzow@t-online.de>
Tue, 29 Jul 2014 18:15:55 +0000 (20:15 +0200)
committerKrinkle <krinklemail@gmail.com>
Tue, 29 Jul 2014 18:25:13 +0000 (18:25 +0000)
The css class of "page exist" or "create this page" should
be different when the page exists (instead of "createlink").

Change-Id: I6d4d9d88a561749ae158ca9d27e563c2c5f9b943

includes/specials/SpecialSearch.php

index 1df674a..4532f98 100644 (file)
@@ -424,8 +424,10 @@ class SpecialSearch extends SpecialPage {
                        return;
                }
 
+               $linkClass = 'mw-search-createlink';
                if ( $title->isKnown() ) {
                        $messageName = 'searchmenu-exists';
+                       $linkClass = 'mw-search-exists';
                } elseif ( $title->quickUserCan( 'create', $this->getUser() ) ) {
                        $messageName = 'searchmenu-new';
                } else {
@@ -440,7 +442,7 @@ class SpecialSearch extends SpecialPage {
 
                // Extensions using the hook might still return an empty $messageName
                if ( $messageName ) {
-                       $this->getOutput()->wrapWikiMsg( "<p class=\"mw-search-createlink\">\n$1</p>", $params );
+                       $this->getOutput()->wrapWikiMsg( "<p class=\"$linkClass\">\n$1</p>", $params );
                } else {
                        // preserve the paragraph for margins etc...
                        $this->getOutput()->addHtml( '<p></p>' );