MediaWiki r45269 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r45268‎ | r45269 (on ViewVC)‎ | r45270 >
Date:00:55, 1 January 2009
Author:rainman
Status:ok
Tags:
Comment:
(bug 5552) add a fulltext-only search mode to inputbox
Reuse getSearchForm() for both 'search' and 'fulltext' type, IMO it should also be used for 'search2' (exact-match only), but since 'search2' is kindof strange and ignores some params (like 'break') for which I'm not sure if it's bug or feature, leaving 'search2' as separate function.
Modified paths:

Diff [purge]

Index: trunk/extensions/InputBox/InputBox.classes.php
===================================================================
--- trunk/extensions/InputBox/InputBox.classes.php	(revision 45268)
+++ trunk/extensions/InputBox/InputBox.classes.php	(revision 45269)
@@ -48,7 +48,9 @@
 			case 'commenttitle':
 				return $this->getCommentForm();
 			case 'search':
-				return $this->getSearchForm();
+				return $this->getSearchForm('search');
+			case 'fulltext':
+				return $this->getSearchForm('fulltext');
 			case 'search2':
 				return $this->getSearchForm2();
 			default:
@@ -67,8 +69,9 @@
 
 	/**
 	 * Generate search form
+	 * @param $type 
 	 */
-	public function getSearchForm() {
+	public function getSearchForm( $type ) {
 		global $wgContLang;
 
 		// Use button label fallbacks
@@ -153,7 +156,7 @@
 
 			// Line break
 			$htmlOut .= $this->mBR;
-		} else {
+		} else if( $type == 'search') {
 			// Go button
 			$htmlOut .= Xml::element( 'input',
 				array(

Status & tagging log

Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox