summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2005-11-01 23:35:59 +0100
committerAndreas Gohr <andi@splitbrain.org>2005-11-01 23:35:59 +0100
commit72645b754b40e57485ed859b9b5416c604536c79 (patch)
tree35c3074ff9b0ac3bc41384e2b80f08aed91cc01c
parent13ddd5084bb1582b90045d7209fd566a62a72297 (diff)
downloadrpg-72645b754b40e57485ed859b9b5416c604536c79.tar.gz
rpg-72645b754b40e57485ed859b9b5416c604536c79.tar.bz2
options for searchform template function
darcs-hash:20051101223559-7ad00-cca84b64eb86d2c72b880bc558fb337ba29d992a.gz
-rw-r--r--inc/template.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/inc/template.php b/inc/template.php
index be0d2f193..302d9d1f5 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -464,19 +464,27 @@ function tpl_actionlink($type,$pre='',$suf=''){
/**
* Print the search form
*
+ * If the first parameter is given a div with the ID 'qsearch_out' will
+ * be added which instructs the ajax pagequicksearch to kick in and place
+ * its output into this div. The second parameter controls the propritary
+ * attribute autocomplete. If set to false this attribute will be set with an
+ * value of "off" to instruct the browser to disable it's own built in
+ * autocompletion feature (MSIE and Firefox)
+ *
* @author Andreas Gohr <andi@splitbrain.org>
*/
-function tpl_searchform($withajax=true){
+function tpl_searchform($ajax=true,$autocomplete=true){
global $lang;
global $ACT;
print '<form action="'.wl().'" accept-charset="utf-8" class="search" name="search">';
print '<input type="hidden" name="do" value="search" />';
print '<input type="text" ';
- if ($ACT == 'search') print 'value="'.htmlspecialchars($_REQUEST['id']).'" ';
+ if($ACT == 'search') print 'value="'.htmlspecialchars($_REQUEST['id']).'" ';
+ if(!$autocomplete) print 'autocomplete="off" ';
print 'id="qsearch_in" accesskey="f" name="id" class="edit" />';
print '<input type="submit" value="'.$lang['btn_search'].'" class="button" />';
- print '<div id="qsearch_out" class="ajax_qsearch JSpopup"></div>';
+ if($ajax) print '<div id="qsearch_out" class="ajax_qsearch JSpopup"></div>';
print '</form>';
}