<?php
+
/**
* imap_mailbox.php
*
return $cnt;
}
-
-/**
- * Expunge specified message
- *
- * We'll use this wrapper function to
- * remove the message with the matching UID .. the order
- * won't be changed - the array element for the message
- * will just be removed.
- */
-
-function sqimap_mailbox_expunge_dmn($imapConnection, &$aMailbox, $message_id) {
- $cnt = 0;
-
- if ($aMailbox['AUTO_EXPUNGE']) {
- $cnt = sqimap_mailbox_expunge($imapConnection, $aMailbox['NAME'], true);
- } else {
- return $cnt;
- }
- $error = '';
- $message_id = (int) $message_id; // we use strickt array_search
- if (is_array($aMailbox['UIDSET'])) {
- $key = array_search($message_id,$aMailbox['UIDSET'],true);
- if ($key !== false && !is_null($key)) {
- unset($aMailbox['UIDSET'][$key]);
- $aMailbox['UIDSET'] = array_values($aMailbox['UIDSET']);
- // adapt the exists count to avoid triggering of a new sort
- $aMailbox['EXISTS'] -= 1;
- } else {
- $aMailbox['UIDSET'] = get_sorted_msgs_list($imapConnection,$aMailbox,$error);
- }
- } else {
- $aMailbox['UIDSET'] = get_sorted_msgs_list($imapConnection,$aMailbox,$error);
- }
- sqsession_register($aMailbox,'aLastSelectedMailbox');
- sqsession_register($aMailbox['UIDSET'],'server_sort_array'); //fix me, use aMailbox instead
- return $cnt;
-}
-
/**
* Checks whether or not the specified mailbox exists
*/
/**
* Returns list of options (to be echoed into select statement
* based on available mailboxes and separators
- * Caller should surround options with <SELECT..> </SELECT> and
+ * Caller should surround options with <select ...> </select> and
* any formatting.
* $imap_stream - $imapConnection to query for mailboxes
* $show_selected - array containing list of mailboxes to pre-select (0 if none)
}
foreach ($boxes as $boxes_part) {
- if ($flag == NULL || !in_array($flag, $boxes_part['flags'])) {
+ if ($flag == NULL || (is_array($boxes_part['flags'])
+ && !in_array($flag, $boxes_part['flags']))) {
$box = $boxes_part['unformatted'];
if ($folder_skip != 0 && in_array($box, $folder_skip) ) {
}
}
if ($show_selected != 0 && in_array($lowerbox, $show_selected) ) {
- $mbox_options .= '<OPTION VALUE="' . htmlspecialchars($box) .'" SELECTED>'.$box2.'</OPTION>' . "\n";
+ $mbox_options .= '<option value="' . htmlspecialchars($box) .'" selected="selected">'.$box2.'</option>' . "\n";
} else {
- $mbox_options .= '<OPTION VALUE="' . htmlspecialchars($box) .'">'.$box2.'</OPTION>' . "\n";
+ $mbox_options .= '<option value="' . htmlspecialchars($box) .'">'.$box2.'</option>' . "\n";
}
}
}
}
}
-?>
+?>
\ No newline at end of file