* Don't suggest user to create page if he cannot
authorVictor Vasiliev <vasilievvv@users.mediawiki.org>
Thu, 13 Dec 2007 16:59:56 +0000 (16:59 +0000)
committerVictor Vasiliev <vasilievvv@users.mediawiki.org>
Thu, 13 Dec 2007 16:59:56 +0000 (16:59 +0000)
includes/SpecialSearch.php
languages/messages/MessagesEn.php
languages/messages/MessagesRu.php
maintenance/language/messages.inc

index 3fc8bab..3530ff1 100644 (file)
@@ -103,7 +103,11 @@ class SpecialSearch {
                                return;
                        } 
                }
-               $wgOut->addWikiText( wfMsg( 'noexactmatch', wfEscapeWikiText( $term ) ) );
+               if( $t->quickUserCan( 'create' ) && $t->quickUserCan( 'edit' ) ) {
+                       $wgOut->addWikiText( wfMsg( 'noexactmatch', wfEscapeWikiText( $term ) ) );
+               } else {
+                       $wgOut->addWikiText( wfMsg( 'noexactmatch-nocreate', wfEscapeWikiText( $term ) ) );
+               }
 
                return $this->showResults( $term );
        }
index d5b4807..b1edeba 100644 (file)
@@ -1229,6 +1229,7 @@ Make sure that this change will maintain historical page continuity.
 'searchsubtitle'        => "You searched for '''[[:$1]]'''",
 'searchsubtitleinvalid' => "You searched for '''$1'''",
 'noexactmatch'          => "'''There is no page titled \"\$1\".''' You can [[:\$1|create this page]].",
+'noexactmatch-nocreate' => "'''There is no page titled \"\$1\".'''",
 'titlematches'          => 'Page title matches',
 'notitlematches'        => 'No page title matches',
 'textmatches'           => 'Page text matches',
index 3cd771d..9a03751 100644 (file)
@@ -891,6 +891,7 @@ $3 указал следующую причину: ''$2''",
 
 <span style="display: block; margin: 1.5em 2em">
 <strong>[[:$1|Создать страницу]]</strong></span>',
+'noexactmatch-nocreate' => 'Страницы с названием «$1» не существует.',
 'titlematches'          => 'Совпадения в названиях статей',
 'notitlematches'        => 'Нет совпадений в названиях статей',
 'textmatches'           => 'Совпадения в текстах статей',
index 1c4c6e1..6680781 100644 (file)
@@ -652,6 +652,7 @@ $wgMessageStructure = array(
                'searchsubtitle',
                'searchsubtitleinvalid',
                'noexactmatch',
+               'noexactmatch-nocreate',
                'titlematches',
                'notitlematches',
                'textmatches',