Wiki source code of ListWebSearch

Last modified by Ecaterina Valica on 2010/07/22 10:30

Show last authors
1 #info("Discussed: New Search Interface: http://xwiki.markmail.org/thread/2pgbx6d6rrkqzd6y")
2
3 $xwiki.ssx.use("Main.ListWebSearch")
4
5 #if(!$request.space)
6 #set($space = "All")
7 #else
8 #set($space = $request.space)
9 #end
10 #set($spacesText = {})
11 #set($spaces = $xwiki.spaces)
12 #set($ok = $spacesText.put("All","All"))
13 #foreach($space in $spaces)
14 #set($ok = $spacesText.put($space,$space))
15 #end
16
17 #macro(spaceoption $space $selectspace $spacesText)
18 <option value="$spacesText.get($space)" #if($selectspace == $spacesText.get($space))selected="selected"#end>$space</option>
19 #end
20 #macro(spaceselect $selectspace $spaces $spacesText)
21 <select name="space" title="$msg.get('xe.search.bar.spaces.title')">
22 #spaceoption("All spaces" $selectspace $spacesText)
23 #foreach($space in $spaces)
24 #spaceoption($space $selectspace $spacesText)
25 #end
26 </select>
27 #end
28 ##
29 ##
30 #set($text = "$!request.getParameter('text')")
31 #set($utext = $util.encodeURI($text))
32 #if($space == "All")
33 #set($url = $xwiki.getURL("Main.WebSearchRss", "view", "xpage=rdf&amp;text=${utext}" ))
34 #else
35 #set($url = $xwiki.getURL("Main.WebSearchRss", "view", "xpage=rdf&space=$space&text=${utext}"))
36 #end
37 <div id="search">
38 <form action="" id="searchBar">
39 {pre}
40 <input type="text" name="text" class="searchQuery" value="$msg.get("xe.search.bar.query")" title="$msg.get('xe.search.bar.query.title')"/>
41 #spaceselect($space $spaces $spacesText)
42 <input type="submit" class="searchButton" value="$msg.get('xe.search.bar.go')" title="$msg.get('xe.search.bar.go.title')"/>
43 <div class="searchHelp">$msg.get("xe.search.bar.help")</div>
44 {/pre}
45 </form>
46 #includeInContext("XWiki.WebSearchCode")
47 #includeInContext("XWiki.ListSuggestions")
48 #includeInContext("XWiki.ListResults")
49 </div>