Example #1
0
    } else {
        $unseen_type = 1;
    }
}
if (empty($unseen_notify)) {
    if (!empty($default_unseen_notify)) {
        $unseen_notify = $default_unseen_notify;
    } else {
        $unseen_notify = 0;
    }
}
/**
 * pass $mailboxes now instead of $imapconnection - sqimap_get_mailboxes() has been separated from
 * sqimap_mailbox_tree() so that the cached mailbox list can be used elsewhere in left_main and beyond
 */
$boxes = sqimap_mailbox_tree($imapConnection, $mailboxes, $show_only_subscribed_folders);
$mailbox_structure = getBoxStructure($boxes);
$oTemplate->assign('clock', $clock);
$oTemplate->assign('mailboxes', $mailbox_structure);
/*
 * Build an array to pass user prefs to the template in order to avoid using
 * globals, which are dirty, filthy things in templates. :)
 */
$settings = array();
#$settings['imapConnection'] = $imapConnection;
$settings['templateID'] = $sTemplateID;
$settings['unreadNotificationEnabled'] = $unseen_notify != 1;
$settings['unreadNotificationAllFolders'] = $unseen_notify == 3;
$settings['unreadNotificationDisplayTotal'] = $unseen_type == 2;
$settings['unreadNotificationCummulative'] = $unseen_cum == 1;
$settings['useSpecialFolderColor'] = $use_special_folder_color;
                    $mailbox = str_replace(' ', '', $mailbox);
                    $line .= str_replace(' ', ' ', $mailbox);
                }
                $line .= '</font>';
            } else {
                $line .= formatMailboxName($imapConnection, $boxes[$i]);
            }
            /* Put the final touches on our folder line. */
            $line .= "</nobr><br />\n";
            /* Output the line for this folder. */
            echo $line;
        }
    }
} else {
    /* expiremental code */
    $boxes = sqimap_mailbox_tree($imapConnection);
    if (isset($advanced_tree) && $advanced_tree) {
        echo '<form name="collapse" action="left_main.php" method="post" ' . 'enctype="multipart/form-data"' . "\n";
        echo '<small>';
        echo '<button type="submit" class="button" onmouseover="buttonover(this,true)" onmouseout="buttonover(this,false)" onmousedown="buttonclick(this,true)" onmouseup="buttonclick(this,false)">' . _("Save folder tree") . '</button><br /><br />';
        echo '<div id="mailboxes" class="mailboxes">' . "\n\n";
        sqgetGlobalVar('mbx', $mbx, SQ_POST);
        if (!isset($mbx)) {
            $mbx = NULL;
        }
        ListAdvancedBoxes($boxes, $mbx);
        echo '</div>';
        echo '</small>';
        echo '</form>' . "\n";
    } else {
        //sqimap_get_status_mbx_tree($imap_stream,$boxes)