** $Id$
**/
+ if (defined ('imap_mailbox_php'))
+ return;
+ define ('imap_mailbox_php', true);
+
/******************************************************************************
** Expunges a mailbox
******************************************************************************/
if (substr($mailbox, -1) == $dm)
$mailbox = substr($mailbox, 0, strlen($mailbox) - 1);
$boxes[$g]['unformatted'] = $mailbox;
- //$boxes[$g]['unformatted-disp'] = ereg_replace('^' . $folder_prefix, '', $mailbox);
- if (substr($mailbox,0,strlen($folder_prefix))==$folder_prefix) {
- $boxes[$g]['unformatted-disp'] = substr($mailbox, strlen($folder_prefix));
- }
+ if (substr($mailbox,0,strlen($folder_prefix))==$folder_prefix)
+ $mailbox = substr($mailbox, strlen($folder_prefix));
+ $boxes[$g]['unformatted-disp'] = $mailbox;
$boxes[$g]['id'] = $g;
if (isset($line[$g]))
$flags = trim(strtolower(str_replace('\\', '',$regs[1])));
if ($flags) {
$boxes[$g]['flags'] = explode(' ', $flags);
- }
- else
- $boxes[$g]['flags'] = array();
+ } else
+ $boxes[$g]['flags'] = array();
}
return $boxes;
** See comment on sqimap_mailbox_parse() for info about the returned array.
******************************************************************************/
function sqimap_mailbox_list ($imap_stream) {
- global $load_prefs_php, $prefs_php, $config_php;
global $data_dir, $username, $list_special_folders_first;
global $trash_folder, $sent_folder;
- global $move_to_trash, $move_to_sent;
+ global $move_to_trash, $move_to_sent, $folder_prefix;
$inbox_in_list = false;
$inbox_subscribed = false;
- if (!isset($load_prefs_php)) include "../src/load_prefs.php";
- else global $folder_prefix;
- if (!function_exists ("ary_sort")) include "../functions/array.php";
+ include "../src/load_prefs.php";
+ include "../functions/array.php";
$dm = sqimap_get_delimiter ($imap_stream);
/** LSUB array **/
$inbox_subscribed = false;
- fputs ($imap_stream, "a001 LSUB \"\" \"*\"\r\n");
+ fputs ($imap_stream, "a001 LSUB \"\" \"*%\"\r\n");
$lsub_ary = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
/** OS: we don't want to parse last element of array, 'cause it is OK command, so we unset it **/
if ($flags) {
$boxes[$g]['flags'] = explode(" ", $flags);
}
- else
- {
- $boxes[$g]['flags'] = array();
- }
+ else
+ {
+ $boxes[$g]['flags'] = array();
+ }
}
$g++;
}