-/** Build the mailbox select
- */
-function asearch_get_form_mailbox($imapConnection, &$boxes, $mailbox, $row_num = 0)
-{
- if (($mailbox != 'All Folders') && (!asearch_mailbox_exists($mailbox, $boxes))) {
- $missing = asearch_opt($mailbox, $mailbox, '[' . _("Missing") . '] ' . asearch_get_mailbox_display($mailbox));
- } else {
- $missing = '';
- }
- return '<select name="mailbox[' . $row_num . ']">'
- . $missing
- . asearch_opt('All Folders', $mailbox, '[' . asearch_get_mailbox_display('All Folders') . ']')
- . sqimap_mailbox_option_list($imapConnection, array(strtolower($mailbox)), 0, $boxes, NULL)
- . '</select>';
-}
-
-/** Build the Include subfolders checkbox
- */
-function asearch_get_form_sub($sub, $row_num = 0)
-{
- return function_exists('addCheckBox') ? addCheckBox('sub[' . $row_num .']', $sub)
- : '<input type="checkbox" name="sub[' . $row_num .']"' . ($sub ? ' checked="checked"' : '') . ' />';
-}
-
-/** Build the 2 unop and where selects
- */
-function asearch_get_form_location($unop, $where, $row_num = 0)
-{
- global $imap_asearch_unops, $imap_asearch_options;
-
- return asearch_opt_array('unop[' . $row_num . ']', $imap_asearch_unops, $unop)
- . asearch_opt_array('where[' . $row_num . ']', $imap_asearch_options, $where);
-}
-
-/** Build the what text input
- */
-function asearch_get_form_what($what, $row_num = 0)
-{
- return function_exists('addInput') ? addInput('what[' . $row_num . ']', $what, '35')
- : '<input type="text" size="35" name="what[' . $row_num . ']" value="' . htmlspecialchars($what) . '" />';
-}
-
-/** Build the Exclude criteria checkbox
- */
-function asearch_get_form_exclude($exclude, $row_num = 0)
-{
- return function_exists('addCheckBox') ? addCheckBox('exclude['.$row_num.']', $exclude)
- : '<input type="checkbox" name="exclude[' . $row_num .']"' . ($exclude ? ' checked="checked"' : '') . ' />';
-}
-
-/** Print one advanced form row
- */
-function asearch_print_form_row($imapConnection, &$boxes, $mailbox, $biop, $unop, $where, $what, $exclude, $sub, $row_num)
-{
- global $imap_asearch_biops_in;
- global $color;
-
- echo html_tag('tr', '', '', $color[4]);
-
-//Binary operator
- echo html_tag('td', $row_num ?
- asearch_opt_array('biop[' . $row_num . ']', $imap_asearch_biops_in, $biop)
- : '<b>' . _("In") . '</b>', 'center') . "\n";
-
-//Mailbox list and Include Subfolders
- echo html_tag('td',
- asearch_get_form_mailbox($imapConnection, $boxes, $mailbox, $row_num)
- . _("and subfolders:") . asearch_get_form_sub($sub, $row_num), 'center') . "\n";
-
-//Unary operator and Search location
- echo html_tag('td', asearch_get_form_location($unop, $where, $row_num), 'center') . "\n";
-
-//Text input
- echo html_tag('td', asearch_get_form_what($what, $row_num), 'center') . "\n";
-
-//Exclude criteria
- echo html_tag('td', _("Exclude Criteria:") . asearch_get_form_exclude($exclude, $row_num), 'center') . "\n";
-
- echo "</tr>\n";
-}
-