5 * Template to display the advanced (multi-rule) search fields
7 * The following variables are available in this template:
8 * $allow_advanced_search - boolean TRUE if the advacned search feature is available
9 * $adv_toggle_link - URL to toggle between basic and advanced searches.
10 * NULL if advanced search has been disabled.
11 * $adv_toggle_text - Text to toggle between basic and advanced searches.
12 * NULL if advanced search has been disabled.
13 * $mailbox_options - array containing sanitized list of mailboxes to
14 * sort. Index of each element is the value that
15 * should be assigned to the HTML input element.
16 * $logical_options - array containing sanitized list of logical
17 * operators available, e.g. AND, OR. Index of each
18 * element is the value that should be assigned
19 * to the HTML input element.
20 * $unary_options - array containing sanitized list of unary options,
21 * e.g. NOT. Index of each element is the value that
22 * should be assigned to the HTML input element.
23 * $where_options - array containing sanitized list of fields availble
24 * to search on. Index of each element is the value
25 * that should be assigned to the HTML input element.
26 * $criteria - array containing the current list of search criteria.
27 * Each element in the array represents a set of criteria
28 * and contains the following elements:
29 * $el['MailboxSel'] - the selected mailbox for this rule
30 * $el['LogicSel'] - the selected logical operator for this rule
31 * $el['UnarySel'] - the selected unary operator for this rule
32 * $el['WhereSel'] - the selected field to search in for this rule
33 * $el['Exclude'] - boolean TRUE if this rule is to be excluded
34 * $el['IncludeSubfolders'] - boolean TRUE if this rule is to include
35 * the subfolders of the selected mailbox
36 * $el['What'] - the value that is to be searched for.
38 * @copyright 1999-2017 The SquirrelMail Project Team
39 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
41 * @package squirrelmail
42 * @subpackage templates
45 /** add required includes **/
47 /** extract template variables **/
50 /** Begin template **/
53 <table cellspacing="0" class="table2">
55 <td class="header1" colspan="5">
56 <?php echo _("Search"); ?>
58 if ($allow_advanced_search) {
60 - <small>[<a href="<?php echo $adv_toggle_link; ?>"><?php echo $adv_toggle_text; ?></a>]</small>
67 foreach ($criteria as $row=>$rule) {
68 $mailbox_sel = strtolower($rule['MailboxSel']);
69 $logical_sel = $rule['LogicSel'];
70 $unary_sel = $rule['UnarySel'];
71 $subfolders = $rule['IncludeSubfolders'];
72 $where_sel = $rule['WhereSel'];
73 $what_val = $rule['What'];
74 $exclude = $rule['Exclude'];
77 <td class="searchForm">
83 <select name="biop[<?php echo $row; ?>]">
85 foreach ($logical_options as $value=>$option) {
86 echo '<option value="'. $value .'"' . ($value==$logical_sel ? ' selected="selected"' : '').'>' . $option .'</option>'."\n";
94 <td class="searchForm">
95 <select name="mailbox[<?php echo $row; ?>]">
97 foreach ($mailbox_options as $value=>$option) {
98 echo '<option value="'. $value .'"' . (strtolower($value)==$mailbox_sel ? ' selected="selected"' : '').'>' . $option .'</option>'."\n";
102 <label for="sub_<?php echo $row; ?>"><?php echo _("and subfolders"); ?>:</label>
103 <input type="checkbox" name="sub[<?php echo $row; ?>]" id="sub_<?php echo $row; ?>" <?php if ($subfolders) echo ' checked="checked"'; ?> />
105 <td class="searchForm">
106 <select name="unop[<?php echo $row; ?>]">
108 foreach ($unary_options as $value=>$option) {
109 echo '<option value="'. $value .'"' . ($value==$unary_sel ? ' selected="selected"' : '').'>' . $option .'</option>'."\n";
114 <select name="where[<?php echo $row; ?>]">
116 foreach ($where_options as $value=>$option) {
117 echo '<option value="'. $value .'"' . ($value==$where_sel ? ' selected="selected"' : '').'>' . $option .'</option>'."\n";
122 <td class="searchForm">
123 <input type="text" name="what[<?php echo $row; ?>]" value="<?php echo $what_val; ?>" />
125 <td class="searchForm">
126 <label for="exclude_<?php echo $row; ?>"><?php echo _("Exclude"); ?>:</label>
127 <input type="checkbox" name="exclude[<?php echo $row; ?>]" id="exclude_<?php echo $row; ?>" <?php if ($exclude) echo ' checked="checked"'; ?> />
134 <td colspan="5" class="header1">
135 <input type="submit" name="submit" value="<?php echo _("Search"); ?>" />
136 <input type="submit" name="submit" value="<?php echo _("Add New Criteria"); ?>" />
137 <input type="submit" name="submit" value="<?php echo _("Remove All Criteria"); ?>" />
138 <input type="submit" name="submit" value="<?php echo _("Remove Excluded Criteria"); ?>" />