/** Imap SEARCH keys
* @global array $imap_asearch_opcodes
*/
+global $imap_asearch_opcodes;
$imap_asearch_opcodes = array(
/* <sequence-set> => 'asequence', */ // Special handling, @see sqimap_asearch_build_criteria()
/*'ALL' is binary operator */
'12' => 'dec'
);
-/** Error message titles according to imap server returned code
-* @global array $imap_error_titles
-*/
-$imap_error_titles = array(
- 'OK' => '',
- 'NO' => _("ERROR : Could not complete request."),
- 'BAD' => _("ERROR : Bad or malformed request."),
- 'BYE' => _("ERROR : Imap server closed the connection."),
- '' => _("ERROR : Connection dropped by imap-server.")
-);
-
/**
* Function to display an error related to an IMAP-query.
* We need to do our own error management since we may receive NO responses on purpose (even BAD with SORT or THREAD)
//@global array color sm colors array
function sqimap_asearch_error_box($response, $query, $message, $link = '')
{
- global $imap_error_titles;
+ global $color;
+ // Error message titles according to imap server returned code
+ $imap_error_titles = array(
+ 'OK' => '',
+ 'NO' => _("ERROR : Could not complete request."),
+ 'BAD' => _("ERROR : Bad or malformed request."),
+ 'BYE' => _("ERROR : Imap server closed the connection."),
+ '' => _("ERROR : Connection dropped by imap-server.")
+ );
+
if (!array_key_exists($response, $imap_error_titles))
$title = _("ERROR : Unknown imap response.");
else { //Straight copy of 1.5 imap_general.php:sqimap_error_box(). Can be removed at a later time
global $color;
require_once(SM_PATH . 'functions/display_messages.php');
- $string = "<font color=$color[2]><b>\n" . $title . "</b><br>\n";
+ $string = "<font color=\"$color[2]\"><b>\n" . $title . "</b><br />\n";
if ($query != '')
- $string .= _("Query:") . ' ' . htmlspecialchars($query) . '<br>';
+ $string .= _("Query:") . ' ' . htmlspecialchars($query) . '<br />';
if ($message_title != '')
$string .= $message_title;
if ($message != '')
$string .= htmlspecialchars($message);
if ($link != '')
$string .= $link;
- $string .= "</font><br>\n";
+ $string .= "</font><br />\n";
error_box($string,$color);
}
}
if ($next_mailbox != $cur_mailbox) {
$search_string = trim($search_string); /* Trim out last space */
if ($cur_mailbox == 'All Folders')
- $search_mboxes = $mboxes_array;
+ $search_mboxes = $mboxes_array;
else if ((!empty($sub_array[$cur_crit - 1])) || (!in_array($cur_mailbox, $mboxes_array)))
$search_mboxes = sqimap_asearch_get_sub_mailboxes($cur_mailbox, $mboxes_array);
else
}
$cur_mailbox = $next_mailbox;
$search_string = '';
-
}
if (isset($where_array[$cur_crit]) && empty($exclude_array[$cur_crit])) {
for ($crit = $cur_crit; $crit < count($where_array); $crit++) {
$aSearch[] = 'OR '.$aCriteria[$i][1];
} else if ($cur_biop != 'OR') {
$aSearch[] = 'ALL '.$aCriteria[$i][1];
- } else { // or only supports 2 search keys so we need to create a parenthized list
+ } else { // OR only supports 2 search keys so we need to create a parenthesized list
$prev_biop = (isset($aCriteria[$i-1][0])) ? $aCriteria[$i-1][0] : false;
if ($prev_biop == $cur_biop) {
$last = $aSearch[$i-1];
} else {
$sEnd = '';
while ($last && substr($last,-1) == ')') {
- $last = substr($last,0,-1);
- $sEnd .= ')';
+ $last = substr($last,0,-1);
+ $sEnd .= ')';
}
$aSearch[$i-1] = "(OR $last";
$aSearch[] = $aCriteria[$i][1].$sEnd.')';
$aSearch[] = $aCriteria[$i][1];
}
}
-
}
$search_string .= implode(' ',$aSearch);
}
-
}
}
return ($mbox_search);
}
-?>
+?>
\ No newline at end of file