*
* IMAP search page
*
- * $Id$
+ * Subfolder search idea from Patch #806075 by Thomas Pohl xraven at users.sourceforge.net. Thanks Thomas!
+ *
+ * @version $Id$
* @package squirrelmail
* @link http://www.ietf.org/rfc/rfc3501.txt
* @author Alex Lemaresquier - Brainstorm - alex at brainstorm.fr
- *
- * Subfolder search idea from Patch #806075 by Thomas Pohl xraven at users.sourceforge.net. Thanks Thomas!
*/
-/** Path for SquirrelMail required files. */
+/**
+ * Path for SquirrelMail required files.
+ * @ignore
+ */
define('SM_PATH','../');
/** SquirrelMail required files. */
/** Build an <option> statement */
function asearch_opt($val, $sel, $tit)
{
- return '<option value="' . $val . '"' . ($sel == $val ? ' selected' : '') . '>' . $tit . '</option>' . "\n";
+ return '<option value="' . $val . '"' . ($sel == $val ? ' selected' : '') . '>' . $tit . '</option>' . "\n";
}
/** Build a <select> statement from an array */
echo '</select>' . "\n";
/* Include Subfolders */
- echo _("and subfolders:") . '<input type=checkbox name="sub[' . $row_num .']"' . ($sub ? ' CHECKED' : '') . '></td>' . "\n";
+ echo _("and subfolders:") .
+ addCheckBox('sub[' . $row_num .']', $sub) . '</td>' . "\n";
/* Unary operator and Search location */
echo html_tag('td',
'center');
/* Text input */
- $what_disp = htmlspecialchars($what);
- echo html_tag('td', '<input type="text" size="35" name="what[' . $row_num . ']" value="' . $what_disp . '">', 'center') . "\n";
+ echo html_tag('td', addInput('what['.$row_num.']', $what, '35'), 'center') . "\n";
/* Exclude criteria */
echo html_tag('td',
- _("Exclude Criteria:") . '<input type=checkbox name="exclude[' . $row_num .']"' . ($exclude ? ' CHECKED' : '') . '>', 'center', '') . "\n";
+ _("Exclude Criteria:") . sm_print_r($exclude) .
+ addCheckBox('exclude['.$row_num.']', $exclude), 'center', '') . "\n";
echo "</tr>\n";
}
$mailbox_display = asearch_get_mailbox_display($mailbox);
$msg_cnt_str = get_msgcnt_str(1, $cnt, $cnt);
- $paginator_str = '<b><big>' . _("Folder:") . ' '. $mailbox_display . '</big></b>';
+ $paginator_str = '<b><big>' . _("Folder:") . ' '. $mailbox_display . ' </big></b>';
echo '<br><table border="0" width="100%" cellpadding="0" cellspacing="0">';
echo '<tr><td>';
- mail_message_listing_beginning($imapConnection, $mailbox, $real_sort, $msg_cnt_str, $paginator_str, 1);
+ mail_message_listing_beginning($imapConnection, NULL, $mailbox, $real_sort, $msg_cnt_str, $paginator_str, 1, 1);
echo '</td></tr>';
echo '<tr><td HEIGHT="5" BGCOLOR="'.$color[4].'"></td></tr>';
echo html_tag('tr', html_tag('td', asearch_get_query_display($color, $mailbox_array, $biop_array, $unop_array, $where_array, $what_array, $exclude_array, $sub_array), 'center', $color[4]));
echo '</table>' . "\n";
+ flush();
+
$query_error = asearch_check_query($where_array, $what_array, $exclude_array);
if ($query_error != '')
echo '<br>' . html_tag('div', asearch_get_error_display($color, $query_error), 'center') . "\n";