01241: add a method=get|post param to searchbox syntax

Summary: add a method=get|post param to searchbox syntax
Created: 2011-01-06 05:26
Status: Open
Category:
Assigned:
Priority: 3
Version: latest
OS:

Description: It would be usefull to add a 'method=get|post' param to the searchbox directive to hide the parameters of the search from the URL of page with the results.

How to:

Just modify the SearchBox function of the pagelist.php file. Two lines have to be changed:

 $opt = array_merge((array)$SearchBoxOpt, @$_GET, (array)$opt);

vs.

 $opt = array_merge((array)$SearchBoxOpt, @$_POST, (array)$opt);

and the call to FmtPageName()

 FmtPageName(" class='wikisearch' action='\$PageUrl' method='get'> , $target);

vs.

 FmtPageName(" class='wikisearch' action='\$PageUrl' method='post'> , $target);

Hello. Because no one ever asked to be able to chose POST or GET method for the searchbox, I feel that this feature is not required by most PmWiki users. Until it is, without modifying core files, you can either redefine the (:searchbox:) markup to use your own modified function, or create a custom search form with the elements supported by PmWiki.Forms. We could add a Cookbook recipe for this feature. --Petko January 06, 2011, at 08:47 AM