* Set up basic search parameters from the request and user settings.
* Typically you'll pass $wgRequest and $wgUser.
*
- * @param WebRequest $request
- * @param User $user
- * @public
+ * @param $request WebRequest
+ * @param $user User
*/
- function __construct( &$request, &$user ) {
+ public function __construct( &$request, &$user ) {
list( $this->limit, $this->offset ) = $request->getLimitOffset( 20, 'searchlimit' );
$this->mPrefix = $request->getVal('prefix', '');
# Extract requested namespaces
/**
* If an exact title match can be found, jump straight ahead to it.
- * @param string $term
+ *
+ * @param $term String
*/
public function goResult( $term ) {
global $wgOut;
}
/**
- * @param string $term
+ * @param $term String
*/
public function showResults( $term ) {
global $wgOut, $wgUser, $wgDisableTextSearch, $wgContLang, $wgScript;
* Extract "power search" namespace settings from the request object,
* returning a list of index numbers to search.
*
- * @param WebRequest $request
- * @return array
+ * @param $request WebRequest
+ * @return Array
*/
protected function powerSearch( &$request ) {
$arr = array();
/**
* Reconstruct the 'power search' options for links
- * @return array
+ *
+ * @return Array
*/
protected function powerSearchOptions() {
$opt = array();
/**
* Show whole set of results
*
- * @param SearchResultSet $matches
+ * @param $matches SearchResultSet
*/
protected function showMatches( &$matches ) {
global $wgContLang;
/**
* Format a single hit result
- * @param SearchResult $result
- * @param array $terms terms to highlight
+ *
+ * @param $result SearchResult
+ * @param $terms Array: terms to highlight
*/
protected function showHit( $result, $terms ) {
global $wgContLang, $wgLang, $wgUser;
/**
* Show results from other wikis
*
- * @param SearchResultSet $matches
+ * @param $matches SearchResultSet
+ * @param $query String
*/
protected function showInterwiki( &$matches, $query ) {
global $wgContLang;
/**
* Show single interwiki link
*
- * @param SearchResult $result
- * @param string $lastInterwiki
- * @param array $terms
- * @param string $query
- * @param array $customCaptions iw prefix -> caption
+ * @param $result SearchResult
+ * @param $lastInterwiki String
+ * @param $terms Array
+ * @param $query String
+ * @param $customCaptions Array: iw prefix -> caption
*/
protected function showInterwikiHit( $result, $lastInterwiki, $terms, $query, $customCaptions) {
wfProfileIn( __METHOD__ );
/**
* Generates the power search box at bottom of [[Special:Search]]
- * @param $term string: search term
- * @return $out string: HTML form
+ *
+ * @param $term String: search term
+ * @return String: HTML form
*/
protected function powerSearchBox( $term ) {
global $wgScript, $wgContLang;
return $out . $this->didYouMeanHtml;
}
- /** Make a search link with some target namespaces */
+ /**
+ * Make a search link with some target namespaces
+ *
+ * @param $term String
+ * @param $namespaces Array
+ * @param $label String: link's text
+ * @param $tooltip String: link's tooltip
+ * @param $params Array: query string parameters
+ * @return String: HTML fragment
+ */
protected function makeSearchLink( $term, $namespaces, $label, $tooltip, $params=array() ) {
$opt = $params;
foreach( $namespaces as $n ) {
);
}
- /** Check if query starts with image: prefix */
+ /**
+ * Check if query starts with image: prefix
+ *
+ * @param $term String: the string to check
+ * @return Boolean
+ */
protected function startsWithImage( $term ) {
global $wgContLang;
return false;
}
- /** Check if query starts with all: prefix */
+ /**
+ * Check if query starts with all: prefix
+ *
+ * @param $term String: the string to check
+ * @return Boolean
+ */
protected function startsWithAll( $term ) {
$allkeyword = wfMsgForContent('searchall');