Index: trunk/phase3/includes/specials/SpecialSearch.php |
— | — | @@ -319,16 +319,20 @@ |
320 | 320 | protected function showCreateLink( $t ) { |
321 | 321 | global $wgOut; |
322 | 322 | |
323 | | - // show direct page/create link |
| 323 | + // show direct page/create link if applicable |
| 324 | + $messageName = null; |
324 | 325 | if( !is_null($t) ) { |
325 | | - if( !$t->isKnown() ) { |
326 | | - $wgOut->addWikiMsg( 'searchmenu-new', wfEscapeWikiText( $t->getPrefixedText() ) ); |
327 | | - } else { |
328 | | - $wgOut->addWikiMsg( 'searchmenu-exists', wfEscapeWikiText( $t->getPrefixedText() ) ); |
| 326 | + if( $t->isKnown() ) { |
| 327 | + $messageName = 'searchmenu-exists'; |
| 328 | + } elseif( $t->userCan( 'create' ) ) { |
| 329 | + $messageName = 'searchmenu-new'; |
329 | 330 | } |
| 331 | + } |
| 332 | + if( $messageName ) { |
| 333 | + $wgOut->addWikiMsg( $messageName, wfEscapeWikiText( $t->getPrefixedText() ) ); |
330 | 334 | } else { |
331 | 335 | // preserve the paragraph for margins etc... |
332 | | - $wgOut->addHTML('<p></p>'); |
| 336 | + $wgOut->addHtml( '<p></p>' ); |
333 | 337 | } |
334 | 338 | } |
335 | 339 | |