* null|string
*/
protected $profile;
- function getProfile() { return $this->profile; }
/// Search engine
protected $searchEngine;
* @var array
*/
protected $namespaces;
- function getNamespaces() { return $this->namespaces; }
/**
* @var bool
// prev/next links
if ( $num || $this->offset ) {
// Show the create link ahead
- $this->showCreateLink( $t );
+ $this->showCreateLink( $t, $num );
$prevnext = $this->getLanguage()->viewPrevNext( $this->getTitle(), $this->offset, $this->limit,
$this->powerSearchOptions() + array( 'search' => $term ),
max( $titleMatchesNum, $textMatchesNum ) < $this->limit
} else {
$out->wrapWikiMsg( "<p class=\"mw-search-nonefound\">\n$1</p>",
array( 'search-nonefound', wfEscapeWikiText( $term ) ) );
- $this->showCreateLink( $t );
+ $this->showCreateLink( $t, $num );
}
}
$out->addHtml( "</div>" );
/**
* @param $t Title
+ * @param int $num The number of search results found
*/
- protected function showCreateLink( $t ) {
+ protected function showCreateLink( $t, $num ) {
// show direct page/create link if applicable
// Check DBkey !== '' in case of fragment link only.
} else {
$messageName = 'searchmenu-new-nocreate';
}
- $params = array( $messageName, wfEscapeWikiText( $t->getPrefixedText() ) );
+ $params = array( $messageName, wfEscapeWikiText( $t->getPrefixedText() ), Message::numParam( $num ) );
wfRunHooks( 'SpecialSearchCreateLink', array( $t, &$params ) );
// Extensions using the hook might still return an empty $messageName
return $this->searchEngine;
}
+ /**
+ * Current search profile.
+ * @return null|string
+ */
+ function getProfile() {
+ return $this->profile;
+ }
+
+ /**
+ * Current namespaces.
+ * @return array
+ */
+ function getNamespaces() {
+ return $this->namespaces;
+ }
+
/**
* Users of hook SpecialSearchSetupEngine can use this to
* add more params to links to not lose selection when