Template/default/viewSearch : Not display predefinedFilters when no filter is defined.
[ldapsaisie.git] / public_html / templates / default / viewSearch.tpl
1 {include file='top.tpl'}
2 <form action='{$searchForm.action}' method='post' class='LSview_search' id='LSsearch_form'>
3
4 <div class='LSview_search'>
5   {foreach from=$searchForm.hiddenFields item=value key=name}
6     <input type='hidden' name='{$name}' value='{$value}' />
7   {/foreach}
8   
9   <input type='text' name='pattern' class='LSview_search' value="{$searchForm.values.pattern}"/>
10   <input type='submit' value='{$searchForm.labels.submit}' name='{$searchForm.names.submit}' class='LSview_search' />
11   <p id='LSview_search_param'>
12     <label class='LSview_search'>{$searchForm.labels.approx} : <input type='checkbox' name='approx' class='LSview_search' {if $searchForm.values.approx!=''}checked="true"{/if} /></label>
13     {if $searchForm.recursive}<label class='LSview_search'>{$searchForm.labels.recursive} : <input type='checkbox' name='recursive' class='LSview_search' {if $searchForm.values.recursive!=''}checked="true"{/if}/></label>{/if}
14   </p>
15 </div>
16
17 <h1>
18   {$pagetitle}
19 </h1>
20
21 {if $LSview_actions != ''}
22 <ul class='LSview-actions'>
23   {foreach from=$LSview_actions item=item}
24     {if is_array($item)}
25       <li class='LSview-actions'><a href='{$item.url}' class='LSview-actions'><img src='{$LS_IMAGES_DIR}/{$item.action}.png' alt='{php}tr('label');{/php}' title='{php}tr('label');{/php}' /> {php}tr('item','label');{/php}</a></li>
26     {/if}
27   {/foreach}
28 </ul>
29 {/if}
30
31 {if count($LSsearch->predefinedFilters) != 0}
32   <select id='LSview_search_predefinedFilter' name='predefinedFilter'>
33     <option value=''>--</option>
34     {html_options options=$LSsearch->predefinedFilters selected=$searchForm.predefinedFilter}
35   </select>
36 {/if}
37
38
39 </form>
40
41 <table class='LSobject-list'>
42     <tr class='LSobject-list'>
43       <th class='LSobject-list'>
44         {if $LSsearch->sort}
45         <a href='view.php?LSobject={$LSsearch->LSobject}&amp;sortBy=displayName&amp;nocache={$smarty.now}'>
46           {if $LSsearch->sortBy == 'displayName'}
47             <strong>{$LSsearch->label_objectName}</strong>
48             <img src='{$LS_IMAGES_DIR}/{$LSsearch->sortDirection}.png' class='LSobject-list-ordersense' alt='{$LSsearch->sortDirection}'/>
49           {else}
50             {$LSsearch->label_objectName}
51           {/if}
52         </a>
53         {else}
54           {$LSsearch->label_objectName}
55         {/if}
56       </th>
57       {if $LSsearch->displaySubDn}
58         <th class='LSobject-list LSobject-list-subdn'>
59         {if $LSsearch->sort}
60           <a href='view.php?LSobject={$LSsearch->LSobject}&amp;sortBy=subDn&amp;nocache={$smarty.now}'>
61           {if $LSsearch->sortBy == 'subDn'}
62             <strong>{$LSsearch->label_level}</strong>
63             <img src='{$LS_IMAGES_DIR}/{$LSsearch->sortDirection}.png' class='LSobject-list-ordersense' alt='{$LSsearch->sortDirection}'/>
64           {else}
65             {$LSsearch->label_level}
66           {/if}
67           </a>
68         {else}
69           {$LSsearch->label_level}
70         {/if}
71         </th>
72       {/if}
73       <th class='LSobject-list'>{$LSsearch->label_actions}</th>
74     </tr>
75     {foreach from=$page.list item=object}
76     <tr class='{cycle values="LSobject-list,LSobject-list LSobject-list-bis"}'>
77         <td class='LSobject-list LSobject-list-names'><a href='view.php?LSobject={$LSsearch->LSobject}&amp;dn={$object->dn}'  class='LSobject-list'>{$object->displayName}</a> </td>
78         {if $LSsearch->displaySubDn}<td class='LSobject-list'>{$object->subDn}</td>{/if}
79         <td class='LSobject-list LSobject-list-actions'>
80         {foreach from=$object->actions item=item}
81           <a href='{$item.url}'  class='LSobject-list-actions'><img src='{$LS_IMAGES_DIR}/{$item.action}.png' alt='{$item.label}' title='{$item.label}'/></a>
82         {/foreach}
83         </td>
84     </tr>
85     {foreachelse}
86       <tr class='LSobject-list'>
87         <td colspan='3' class='LSobject-list-without-result'>{$LSsearch->label_no_result}</td>
88       </tr>   
89     {/foreach}
90 </table>
91 <span id='LSobject_list_nbresult'>{$LSsearch->label_total}</span>
92 {if $page.nbPages > 1}
93   <p class='LSobject-list-page'>
94     
95   {if $page.nbPages > 10}
96     {php}$this->assign('range', range(0,10));{/php}
97     {if $page.nb > 5}
98       {if $page.nb > $page.nbPages-6}
99         {assign var=start value=$page.nbPages-12}
100        {else}
101         {assign var=start value=$page.nb-6}
102       {/if}
103     {else}
104       {assign var=start value=0}
105     {/if}
106     <a href='view.php?LSobject={$LSsearch->LSobject}&amp;page=0' class='LSobject-list-page'><</a> 
107     {foreach from=$range item=i}
108       {if $page.nb==$start+$i}
109         <strong class='LSobject-list-page'>{$page.nb+1}</strong> 
110       {else}
111         <a href='view.php?LSobject={$LSsearch->LSobject}&amp;page={$i+$start}'  class='LSobject-list-page'>{$i+$start+1}</a> 
112       {/if}
113     {/foreach}
114     <a href='view.php?LSobject={$LSsearch->LSobject}&amp;page={$page.nbPages-1}' class='LSobject-list-page'>></a> 
115   {else}
116     {section name=listpage loop=$page.nbPages step=1}
117       {if $page.nb == $smarty.section.listpage.index}
118         <strong class='LSobject-list-page'>{$page.nb+1}</strong> 
119       {else}
120         <a href='view.php?LSobject={$LSsearch->LSobject}&amp;page={$smarty.section.listpage.index}'  class='LSobject-list-page'>{$smarty.section.listpage.index+1}</a> 
121       {/if}
122     {/section}
123   {/if}
124   </p>
125 {/if}
126 {include file='bottom.tpl'}