summaryrefslogtreecommitdiff
path: root/templates/search.tpl
blob: 376cfa93588b3739117a706ffdec5d48680bc894 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{strip}
<div class="display search">
	<div class="header">
		<h1>{tr}Search {if $words}Results{else}Page{/if}{/tr}</h1>
	</div>

	<div class="body">
		{form legend="Extended Search"}
			<div class="form-group">
				{formlabel label="Limit Search" for="content_type_guid"}
				{forminput}
					{html_options options=$contentTypes name=content_type_guid selected=$content_type_guid }
					{formhelp note="Limit search to the selected Liberty package"}
				{/forminput}
			</div>

			<div class="form-group">
				{formlabel label="Use Partial Word Search" for="usePart"}
				{forminput}
					<input type="checkbox" name="usePart" id="usePart" {if $usePart}checked{/if} />
					{formhelp note="This may slow search results"}
				{/forminput}
			</div>


			<div class="form-group">
				{formlabel label="And Terms Together" for="useAnd"}
				{forminput}
					<input type="checkbox" name="useAnd" id="useAnd" {if $useAnd}checked{/if} />
					{formhelp note="This may slow search results"}
				{/forminput}
			</div>

			<div class="form-group">
				{formlabel label="Find" for="find"}
				{forminput}
					<input name="highlight" size="14" id="find" type="text" accesskey="s" value="{$words|escape}"/>
				{/forminput}
			</div>

			<div class="form-group submit">
				<input type="submit" class="wikiaction" name="search" value="{tr}go{/tr}"/>
			</div>
		{/form}

		{if $words}<h2>{tr}Found '<span class="highlight">{$words|escape:htmlall}</span>' in {$listInfo.total_records} {if $where2}{$where2}{else}pages{/if}{/tr}</h2>{/if}

		{section  name=search loop=$results}
			{* using capture for no particular reason appart from a nicer layout - xing *}
			{capture name=title}
				{assign var=guid value=$results[search].content_type_guid}
				<a href="{$results[search].href}&highlight={$words|escape:url}">{$results[search].title|escape}</a>
				&nbsp;
				<small>
					&bull; {tr}{$gLibertySystem->getContentTypeName($guid)}{/tr} &bull; {tr}Relevance{/tr}:&nbsp;{$results[search].relevancy} &bull; {tr}Hits{/tr}:&nbsp;{$results[search].hits}
					{if $gBitSystem->isFeatureActive( 'search_fulltext' )}
						&nbsp;&bull;&nbsp;
						{if $results[search].relevancy <= 0}
							{tr}Simple search{/tr}
						{else}
							{tr}Relevance{/tr}: {$results[search].relevancy}
						{/if}
					{/if}
					{if !empty($results[search].type)}
						&nbsp; ( {$results[search].type} )
					{/if}
				</small>
			{/capture}

			<div class="search box">
				<h3>{$smarty.capture.title}</h3>
				<div class="boxcontent">
					{$results[search].parsed|default:''|strip_tags|truncate:250}
					<br />
					{if !empty($results[search].blog_title)}<span class="blog-name">{tr}In{/tr}: {$results[search].blog_title|escape}</span><br />{/if}
					<span class="date">{tr}Last modification{/tr}: {$results[search].last_modified|bit_long_datetime}</span>
				</div>
			</div>
		{sectionelse}
			{if $words}<div class="norecords">{tr}No pages matched the search criteria{/tr}</div>{/if}
		{/section}

		{pagination useAnd=$useAnd usePart=$usePart content_type_guid=$content_type_guid highlight=$words|escape }
	</div>
</div>
{/strip}