require_once('../src/validate.php');
require_once('../functions/imap.php');
require_once('../functions/imap_search.php');
+require_once('../functions/imap_utf7_decode_local');
require_once('../functions/array.php');
require_once('../functions/strings.php');
$saved_attributes = array ();
$search_all = 'none';
$perbox_count = array ();
+$recent_count = getPref($data_dir, $username, 'search_memory', 0);
/* get mailbox names */
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
$search_all = 'all';
}
-displayPageHeader($color, $mailbox);
-
+if (isset($composenew) && $composenew) {
+ displayPageHeader($color, $mailbox, 'comp_in_new();');
+} else {
+ displayPageHeader($color, $mailbox);
+}
/* See how the page was called and fire off correct function */
if ((!isset($submit) || empty($submit)) && !empty($what)) {
$submit = _("Search");
if ( !isset( $submit ) ) {
$submit = '';
} else if ($submit == _("Search") && !empty($what)) {
- update_recent($what, $where, $mailbox, $username, $data_dir);
+ if ($recent_count > 0) {
+ update_recent($what, $where, $mailbox, $username, $data_dir);
+ }
}
elseif ($submit == 'forget') {
forget_recent($count, $username, $data_dir);
/* update the recent and saved searches from the pref files */
$attributes = get_recent($username, $data_dir);
-$recent_count = getPref($data_dir, $username, 'search_memory', 0);
$saved_attributes = get_saved($username, $data_dir);
$saved_count = count($saved_attributes['saved_what']);
$count_all = 0;
for ($i = 0; $i < count($boxes); $i++) {
if (!in_array('noselect', $boxes[$i]['flags'])) {
$box = $boxes[$i]['unformatted'];
- $box2 = str_replace(' ', ' ', $boxes[$i]['unformatted-disp']);
+ $box2 = imap_utf7_decode_local(str_replace(' ', ' ', $boxes[$i]['unformatted-disp']));
if( $box2 == 'INBOX' ) {
$box2 = _("INBOX");
}
if ( !isset( $what ) ) {
$what = '';
}
+if ( !isset( $where ) ) {
+ $where = '';
+}
+
+
$what_disp = str_replace(',', ' ', $what);
$what_disp = str_replace('\\\\', '\\', $what_disp);
$what_disp = str_replace('\\"', '"', $what_disp);
*/
$old_value = 0;
-if ($allow_thread_sort == true) {
+if ($allow_thread_sort == TRUE) {
$old_value = $allow_thread_sort;
- $allow_thread_sort = false;
+ $allow_thread_sort = FALSE;
}
if ($search_all == 'all') {
}
for ($i=0;$i<count($perbox_count);$i++) {
if ($perbox_count[$i] != "") {
- break;
+ $count_all = "found";
+ break;
}
- $count_all = "none";
}
- if ($count_all == "none") {
+ if ($count_all != "found") {
echo '<br><b>' .
_("No Messages found") .
'</b><br>';