';*/
-}
-
-echo "\n\n" .
- '
'. _("Folders") . "
\n\n";
-
+$clock = '';
if ($date_format != 6) {
/* First, display the clock. */
if ($hour_format == 1) {
@@ -719,16 +144,12 @@ if ($date_format != 6) {
}
$clk = str_replace(' ',' ',$clk);
- echo ''
- . str_replace(' ', ' ', _("Last Refresh"))
+//FIXME don't build HTML here - do it in template
+ $clock = ''
+ . str_replace(' ', ' ', _("Last Refresh"))
. ":
$clk
\n";
}
-/* Next, display the refresh button. */
-echo '\n\n";
-
-/* Lastly, display the folder list. */
if ( $collapse_folders ) {
/* If directed, collapse or uncollapse a folder. */
if (isset($fold)) {
@@ -758,25 +179,33 @@ if (empty($unseen_notify)) {
}
}
-$boxes = sqimap_mailbox_tree($imapConnection);
-if (isset($advanced_tree) && $advanced_tree) {
- echo '
'."\n";
-} else {
- ListBoxes($boxes);
-}
+/**
+ * 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);
-do_hook('left_main_after');
-sqimap_logout($imapConnection);
+$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;
+$settings['messageRecyclingEnabled'] = $move_to_trash;
+$settings['collapsableFoldersEnabled'] = $collapse_folders==1;
+$oTemplate->assign('settings', $settings);
+
+$oTemplate->display('left_main.tpl');
-?>
-
+sqimap_logout($imapConnection);
+$oTemplate->display('footer.tpl');