6 * Copyright (c) 1999-2002 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
9 * This is the code for the left bar. The left bar shows the folders
10 * available, and has cookie information.
15 require_once('../src/validate.php');
16 require_once('../functions/array.php');
17 require_once('../functions/imap.php');
18 require_once('../functions/plugin.php');
19 require_once('../functions/page_header.php');
20 require_once('../functions/html.php');
22 /* These constants are used for folder stuff. */
23 define('SM_BOX_UNCOLLAPSED', 0);
24 define('SM_BOX_COLLAPSED', 1);
26 /* --------------------- FUNCTIONS ------------------------- */
28 function formatMailboxName($imapConnection, $box_array) {
30 global $folder_prefix, $trash_folder, $sent_folder,
31 $color, $move_to_sent, $move_to_trash,
32 $unseen_notify, $unseen_type, $collapse_folders,
33 $draft_folder, $save_as_draft,
34 $use_special_folder_color;
36 $real_box = $box_array['unformatted'];
37 $mailbox = str_replace(' ','',$box_array['formatted']);
38 $mailboxURL = urlencode($real_box);
40 /* Strip down the mailbox name. */
41 if (ereg("^( *)([^ ]*)$", $mailbox, $regs)) {
47 if (($unseen_notify == 2 && $real_box == 'INBOX') ||
48 $unseen_notify == 3) {
49 $unseen = sqimap_unseen_messages($imapConnection, $real_box);
50 if ($unseen_type == 1 && $unseen > 0) {
51 $unseen_string = "($unseen)";
53 } else if ($unseen_type == 2) {
54 $numMessages = sqimap_get_num_messages($imapConnection, $real_box);
55 $unseen_string = "<font color=\"$color[11]\">($unseen/$numMessages)</font>";
60 $special_color = ($use_special_folder_color && isSpecialMailbox( $real_box ) );
62 /* Start off with a blank line. */
65 /* If there are unseen message, bold the line. */
66 if ($unseen > 0) { $line .= '<B>'; }
68 /* Crate the link for this folder. */
69 $line .= "<a href=\"right_main.php?PG_SHOWALL=0&sort=0&startMessage=1&mailbox=$mailboxURL\" TARGET=\"right\" STYLE=\"text-decoration:none\">";
71 $line .= "<font color=\"$color[11]\">";
73 if ( $mailbox == 'INBOX' ) {
76 $line .= str_replace(' ',' ',$mailbox);
78 if ($special_color == TRUE)
82 /* If there are unseen message, close bolding. */
83 if ($unseen > 0) { $line .= "</B>"; }
85 /* Print unseen information. */
86 if (isset($unseen_found) && $unseen_found) {
87 $line .= " <SMALL>$unseen_string</SMALL>";
90 if (($move_to_trash) && ($real_box == $trash_folder)) {
91 if (! isset($numMessages)) {
92 $numMessages = sqimap_get_num_messages($imapConnection, $real_box);
95 if ($numMessages > 0) {
96 $urlMailbox = urlencode($real_box);
97 $line .= "\n<small>\n" .
98 " (<A HREF=\"empty_trash.php\" style=\"text-decoration:none\">"._("purge")."</A>)" .
103 /* Return the final product. */
108 * Recursive function that computes the collapsed status and parent
109 * (or not parent) status of this box, and the visiblity and collapsed
110 * status and parent (or not parent) status for all children boxes.
112 function compute_folder_children(&$parbox, $boxcount) {
113 global $boxes, $data_dir, $username, $collapse_folders;
114 $nextbox = $parbox +
1;
116 /* Retreive the name for the parent box. */
117 $parbox_name = $boxes[$parbox]['unformatted'];
119 /* 'Initialize' this parent box to childless. */
120 $boxes[$parbox]['parent'] = FALSE;
122 /* Compute the collapse status for this box. */
123 if( isset($collapse_folders) && $collapse_folders ) {
124 $collapse = getPref($data_dir, $username, 'collapse_folder_' . $parbox_name);
125 $collapse = ($collapse == '' ? SM_BOX_UNCOLLAPSED
: $collapse);
127 $collapse = SM_BOX_UNCOLLAPSED
;
129 $boxes[$parbox]['collapse'] = $collapse;
131 /* Otherwise, get the name of the next box. */
132 if (isset($boxes[$nextbox]['unformatted'])) {
133 $nextbox_name = $boxes[$nextbox]['unformatted'];
138 /* Compute any children boxes for this box. */
139 while (($nextbox < $boxcount) &&
140 (is_parent_box($boxes[$nextbox]['unformatted'], $parbox_name))) {
142 /* Note that this 'parent' box has at least one child. */
143 $boxes[$parbox]['parent'] = TRUE;
145 /* Compute the visiblity of this box. */
146 $boxes[$nextbox]['visible'] = ($boxes[$parbox]['visible'] &&
147 ($boxes[$parbox]['collapse'] != SM_BOX_COLLAPSED
));
149 /* Compute the visibility of any child boxes. */
150 compute_folder_children($nextbox, $boxcount);
153 /* Set the parent box to the current next box. */
158 * Create the link for a parent folder that will allow that
159 * parent folder to either be collapsed or expaned, as is
160 * currently appropriate.
162 function create_collapse_link($boxnum) {
164 $mailbox = urlencode($boxes[$boxnum]['unformatted']);
166 /* Create the link for this collapse link. */
167 $link = '<a target="left" style="text-decoration:none" ' .
168 'href="left_main.php?';
169 if ($boxes[$boxnum]['collapse'] == SM_BOX_COLLAPSED
) {
170 $link .= "unfold=$mailbox\">+";
172 $link .= "fold=$mailbox\">-";
176 /* Return the finished product. */
181 * This simple function checks if a box is another box's parent.
183 function is_parent_box($curbox_name, $parbox_name) {
186 /* Extract the name of the parent of the current box. */
187 $curparts = explode($delimiter, $curbox_name);
188 $curname = array_pop($curparts);
189 $actual_parname = implode($delimiter, $curparts);
190 $actual_parname = substr($actual_parname,0,strlen($parbox_name));
192 /* Compare the actual with the given parent name. */
193 return ($parbox_name == $actual_parname);
196 function listBoxes ($boxes, $j=0 ) {
197 global $data_dir, $username, $startmessage, $color, $unseen_notify, $unseen_type,
198 $move_to_trash, $trash_folder, $collapse_folders;
203 $mailbox = $boxes->mailboxname_full
;
205 for ($k = 0; $k < $j; $k++
) {
206 $leader.= '   ';
208 $mailboxURL = urlencode($mailbox);
210 /* get unseen/total messages information */
211 if ($boxes->unseen
) {
212 $unseen = $boxes->unseen
;
213 $unseen_string = "($unseen)";
214 if ($unseen>0) $unseen_found = TRUE;
216 $numMessages = $boxes->total
;
217 $unseen_string = "<font color=\"$color[11]\">($unseen/$numMessages)</font>";
223 if (isset($boxes->mbxs
[0]) && $collapse_folders) {
224 $collapse = getPref($data_dir, $username, 'collapse_folder_' . $mailbox);
225 $collapse = ($collapse == '' ? SM_BOX_UNCOLLAPSED
: $collapse);
227 $link = '<a target="left" style="text-decoration:none" ' .'href="left_main.php?';
229 $link .= "unfold=$mailboxURL\">$leader + ";
231 $link .= "fold=$mailboxURL\">$leader - ";
236 $pre.= $leader . '   ';
240 /* If there are unseen message, bold the line. */
241 if ($unseen > 0) { $pre .= '<B>'; }
243 if (($move_to_trash) && ($mailbox == $trash_folder)) {
244 if (! isset($numMessages)) {
245 $numMessages = sqimap_get_num_messages($imapConnection, $mailbox);
248 if ($numMessages > 0) {
249 $urlMailbox = urlencode($mailbox);
250 $pre .= "\n<small>\n" .
251 " (<A HREF=\"empty_trash.php\" style=\"text-decoration:none\">"._("purge")."</A>)" .
255 if (!$boxes->is_noselect
) {
256 $pre .= "<A HREF=\"right_main.php?PG_SHOWALL=0&sort=0&startMessage=1&mailbox=$mailboxURL\" TARGET=\"right\" STYLE=\"text-decoration:none\">";
261 /* If there are unseen message, close bolding. */
262 if ($unseen > 0) { $end .= "</B>"; }
264 /* Print unseen information. */
265 if (isset($unseen_found) && $unseen_found) {
266 $end .= " <SMALL>$unseen_string</SMALL>";
271 if ($boxes->is_special
) {
272 $font = "<FONT COLOR=\"$color[11]\">";
273 $fontend = "</FONT>";
276 if (!$boxes->is_root
) {
277 echo "" . $pre .$font. $boxes->mailboxname_sub
.$fontend . $end. '<br>';
280 if (!$collapse ||
$boxes->is_root
) {
281 for ($i = 0; $i <count($boxes->mbxs
); $i++
) {
282 listBoxes($boxes->mbxs
[$i],$j);
289 function ListAdvancedBoxes ($boxes, $mbx, $j='ID.0' ) {
290 global $data_dir, $username, $startmessage, $color, $unseen_notify, $unseen_type,
291 $move_to_trash, $trash_folder, $collapse_folders;
293 /* use_folder_images only works if the images exist in ../images */
294 $use_folder_images = false;
301 $mailbox = $boxes->mailboxname_full
;
302 $mailboxURL = urlencode($mailbox);
304 /* get unseen/total messages information */
305 if ($boxes->unseen
) {
306 $unseen = $boxes->unseen
;
307 $unseen_string = "($unseen)";
308 if ($unseen>0) $unseen_found = TRUE;
310 $numMessages = $boxes->total
;
311 $unseen_string = "<font color=\"$color[11]\">($unseen/$numMessages)</font>";
316 /* If there are unseen message, bold the line. */
317 if ($unseen > 0) { $pre .= '<B>'; }
319 if (($move_to_trash) && ($mailbox == $trash_folder)) {
320 if (! isset($numMessages)) {
321 $numMessages = $boxes->total
;
323 if ($numMessages > 0) {
324 $urlMailbox = urlencode($mailbox);
325 $pre .= "\n<small>\n" .
326 " (<A HREF=\"empty_trash.php\" style=\"text-decoration:none\">"._("purge")."</A>)" .
330 if (!$boxes->is_noselect
) { /* \Noselect boxes can't be selected */
331 $pre .= "<A HREF=\"right_main.php?PG_SHOWALL=0&sort=0&startMessage=1&mailbox=$mailboxURL\" TARGET=\"right\" STYLE=\"text-decoration:none\">";
336 /* If there are unseen message, close bolding. */
337 if ($unseen > 0) { $end .= "</B>"; }
339 /* Print unseen information. */
340 if (isset($unseen_found) && $unseen_found) {
341 $end .= " <SMALL>$unseen_string</SMALL>";
347 /* color special boxes */
348 if ($boxes->is_special
) {
349 $font = "<FONT COLOR=\"$color[11]\">";
350 $fontend = "</FONT>";
352 if (!$boxes->is_root
) {
353 if ($use_folder_images) {
354 if ($boxes->is_inbox
) {
355 $folder_img = '../images/inbox.gif';
356 } else if ($boxes->is_sent
) {
357 $folder_img = '../images/senti.gif';
358 } else if ($boxes->is_trash
) {
359 $folder_img = '../images/delitem.gif';
360 } else if ($boxes->is_draft
) {
361 $folder_img = '../images/draft.gif';
362 } else $folder_img = '../images/folder.gif';
363 $folder_img = ' <img src="'.$folder_img.'" heigth="15" valign="center"> ';
364 } else $folder_img = '';
365 if (!isset($boxes->mbxs
[0])) {
366 echo ' ' . html_tag( 'div',
367 $folder_img .$pre .$font. $boxes->mailboxname_sub
.$fontend . $end ,
368 'left', '', 'class="mbx_sub" id="' .$j. '" onmouseover="changerowcolor(this,true)" onmouseout="changerowcolor(this,false)"' )
371 /* get collapse information */
372 if ($collapse_folders) {
373 $link = '<a target="left" style="text-decoration:none" ' .'href="left_main.php?';
374 $form_entry = $j.'F';
375 if (isset($mbx) && isset($mbx[$form_entry])) {
376 $collapse = $mbx[$form_entry];
378 setPref($data_dir, $username, 'collapse_folder_'.$boxes->mailboxname_full
, SM_BOX_COLLAPSED
);
380 setPref($data_dir, $username, 'collapse_folder_'.$boxes->mailboxname_full
, SM_BOX_UNCOLLAPSED
);
383 $collapse = getPref($data_dir, $username, 'collapse_folder_' . $mailbox);
384 $collapse = ($collapse == '' ? SM_BOX_UNCOLLAPSED
: $collapse);
387 $link = '<a href="javascript:void(0)">'." <img src=\"../images/plus.gif\" border=\"1\" id=$j onclick=\"hidechilds(this)\"></A>";
389 $link = '<a href="javascript:void(0)">'."<img src=\"../images/minus.gif\" border=\"1\" id=$j onclick=\"hidechilds(this)\"></a>";
391 $collapse_link = $link;
392 } else $collapse_link='';
393 echo ' ' . html_tag( 'div',
394 $collapse_link . $folder_img .$pre. $font. '  '. $boxes->mailboxname_sub
.$fontend . $end ,
395 'left', '', 'class="mbx_par" id="' .$j. 'P" onmouseover="changerowcolor(this,true)" onmouseout="changerowcolor(this,false)"' )
397 echo ' <INPUT TYPE="hidden" name=mbx['.$j. 'F] value="'.$collapse.'" id=mbx['.$j.'F>'."\n";
401 $visible = ' STYLE="display:none;"';
403 $visible = ' STYLE="display:block;"';
406 if (isset($boxes->mbxs
[0]) && !$boxes->is_root
) /* mailbox contains childs */
407 echo html_tag( 'div', '', 'left', '', 'class="par_area" id='.$j.'.0 '. $visible ) . "\n";
412 for ($i = 0; $i <count($boxes->mbxs
); $i++
) {
414 listAdvancedBoxes($boxes->mbxs
[$i],$mbx,$j);
416 if (isset($boxes->mbxs
[0]) && !$boxes->is_root
) echo '</div>'."\n\n";
423 /* -------------------- MAIN ------------------------ */
425 global $delimiter, $default_folder_prefix, $left_size;
427 // open a connection on the imap port (143)
428 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 10); // the 10 is to hide the output
431 * Using stristr since older preferences may contain "None" and "none".
433 if (isset($left_refresh) && ($left_refresh != '') &&
434 !stristr($left_refresh, "none")){
435 $xtra = "\n<META HTTP-EQUIV=\"Expires\" CONTENT=\"Thu, 01 Dec 1994 16:00:00 GMT\">\n" .
436 "<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">\n".
437 "<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"$left_refresh;URL=left_main.php\">\n";
443 * $advanced_tree and $oldway are boolean vars which are default set to default
445 * Setting $oldway to false causes left_main.php to use the new experimental
446 * way of getting the mailbox-tree.
447 * Setting $advanced tree to true causes SM to display a experimental
448 * mailbox-tree with dhtml behaviour.
449 * It only works on browsers which supports css and javascript. The used
450 * javascript is experimental and doesn't support all browsers. It is tested on
451 * IE6 an Konquerer 3.0.0-2.
452 * In the function ListAdvancedBoxes there is another var $use_folder_images.
453 * setting this to true is only usefull if the images exists in ../images.
455 * Feel free to experiment with the code and report bugs and enhancements
456 * to marc@its-projects.nl
459 $advanced_tree = false; /* set this to true if you want to see a nicer mailboxtree */
460 $oldway = true; /* default SM behaviour */
462 if ($advanced_tree) {
464 <script language="Javascript" TYPE="text/javascript">
468 function hidechilds(el) {
470 form_id = "mbx[" + el.id +"F]";
472 ele = document.all[id];
474 if(ele.style.display == "none") {
475 ele.style.display = "block";
476 ele.style.visibility = "visible"
477 document.all[el.id].src="../images/minus.gif";
478 document.all[form_id].value=0;
480 ele.style.display = "none";
481 ele.style.visibility = "hidden"
482 document.all[el.id].src="../images/plus.gif";
483 document.all[form_id].value=1;
486 } else if (document.getElementById) {
488 ele = document.getElementById(id);
489 img_ele = document.getElementById(el.id);
491 if(ele.style.display == "none") {
492 ele.style.display = "block";
493 ele.style.visibility = "visible"
494 img_ele.src="../images/minus.gif";
495 document.getElementById(form_id).value=0;
497 ele.style.display = "none";
498 ele.style.visibility = "hidden"
499 img_ele.src="../images/plus.gif";
500 document.getElementById(form_id).value=1;
507 if (!document.images) return;
508 var ar = new Array();
509 var arguments = preload.arguments;
510 for (var i = 0; i<arguments.length; i++) {
512 ar[i].src = arguments[i];
516 function changerowcolor(el,on) {
519 $xtra.= "\nvar color1 = \"$color[0]\";\n".
520 "var color2 = \"$color[9]\";\n";
524 document.all[id].style.background = color1;
526 document.all[id].style.background = color2;
528 } else if (document.getElementById) {
530 document.getElementById(id).style.background=color1;
532 document.getElementById(id).style.background=color2;
538 function buttonover(el,on) {
540 el.style.borderColor="blue";}
542 el.style.borderColor="orange";}
545 function buttonclick(el,on) {
547 el.style.border="groove"}
549 el.style.border="ridge";}
552 function hideframe(hide) {
555 $xtra .= " left_size = \"$left_size\";\n";
558 masterf = window.parent.document.all["fs1"];
559 leftf = window.parent.document.all["left"];
560 leftcontent = document.all["leftframe"];
561 leftbutton = document.all["showf"];
562 } else if (document.getElementById) {
563 masterf = window.parent.document.getElementById("fs1");
564 leftf = window.parent.document.getElementById("left");
565 leftcontent = document.getElementById("leftframe");
566 leftbutton = document.getElementById("showf");
571 new_col = calc_col("20");
572 masterf.cols = new_col;
573 document.body.scrollLeft=0;
574 document.body.style.overflow='hidden';
575 leftcontent.style.display = 'none';
576 leftbutton.style.display='block';
578 masterf.cols = calc_col(left_size);
579 document.body.style.overflow='';
580 leftbutton.style.display='none';
581 leftcontent.style.display='block';
586 function calc_col(c_w) {
589 if ($location_of_bar == 'right') {
590 $xtra .= ' right=true;';
592 $xtra .= ' right=false;';
604 function resizeframe(direction) {
606 masterf = window.parent.document.all["fs1"];
607 } else if (document.getElementById) {
608 window.parent.document.getElementById("fs1");
614 if ($location_of_bar == 'right') {
615 $xtra .= ' colPat=/^\*,(\d+)$/;';
617 $xtra .= ' colPat=/^(\d+),.*$/;';
622 old_col = masterf.cols;
623 colPat.exec(old_col);
626 new_col_width = parseInt(RegExp.$1) + 25;
629 if (parseInt(RegExp.$1) > 35) {
630 new_col_width = parseInt(RegExp.$1) - 25;
633 masterf.cols = calc_col(new_col_width);
642 /* style definitions */
649 margin: 0px 0px 0px 0px;
650 padding: 5px 5px 5px 5px;
668 voice-family: "\"}\"";
669 voice-family: inherit;
684 border-left-width:0.1em;
685 border-left-color:blue;
686 border-bottom: solid;
687 border-bottom-width:0.1em;
688 border-bottom-color:blue;
703 $xtra .= " background:$color[0];";
718 displayHtmlHeader( 'SquirrelMail', $xtra );
720 /* If requested and not yet complete, attempt to autocreate folders. */
721 if ($auto_create_special && !isset($auto_create_done)) {
722 $autocreate = array($sent_folder, $trash_folder, $draft_folder);
723 foreach( $autocreate as $folder ) {
724 if (($folder != '') && ($folder != 'none')) {
725 if ( !sqimap_mailbox_exists($imapConnection, $folder)) {
726 sqimap_mailbox_create($imapConnection, $folder, '');
727 } else if (!sqimap_mailbox_is_subscribed($imapConnection, $folder)) {
728 sqimap_subscribe($imapConnection, $folder);
733 /* Let the world know that autocreation is complete! Hurrah! */
734 $auto_create_done = TRUE;
735 session_register('auto_create_done');
738 echo "\n<BODY BGCOLOR=\"$color[3]\" TEXT=\"$color[6]\" LINK=\"$color[6]\" VLINK=\"$color[6]\" ALINK=\"$color[6]\">\n";
740 do_hook('left_main_before');
741 if ($advanced_tree) {
742 /* nice future feature, needs layout !! volunteers? */
743 $right_pos = $left_size - 20;
744 echo '<div style="position:absolute;top:0;border=solid;border-width:0.1em;border-color:blue;"><div ID="hidef" style="width=20;font-size:12"><A HREF="javascript:hideframe(true)"><b><<</b></a></div>';
745 echo '<div ID="showf" style="width=20;font-size:12;display:none;"><A HREF="javascript:hideframe(false)"><b>>></b></a></div>';
746 echo '<div ID="incrf" style="width=20;font-size:12"><A HREF="javascript:resizeframe(true)"><b>></b></a></div>';
747 echo '<div ID="decrf" style="width=20;font-size:12"><A HREF="javascript:resizeframe(false)"><b><</b></a></div></div>';
748 echo '<div ID="leftframe"><br><br>';
751 echo "\n\n" . html_tag( 'table', '', '', '', 'border="0" cellspacing="0" cellpadding="0" width="100%"' ) .
753 html_tag( 'td', '', 'left' ) .
754 '<center><font size="4"><b>'. _("Folders") . "</b><br></font>\n\n";
756 if ($date_format != 6) {
757 /* First, display the clock. */
758 if ($hour_format == 1) {
760 if ($date_format == 4) {
764 if ($date_format == 4) {
771 switch( $date_format ) {
773 $clk = date('m/d/y '.$hr, time());
776 $clk = date('d/m/y '.$hr, time());
780 $clk = date($hr, time());
783 $clk = substr( getDayName( date( 'w', time() ) ), 0, 3 ) . date( ', ' . $hr, time() );
785 $clk = str_replace(' ',' ',$clk);
787 echo '<center><small>' . str_replace(' ',' ',_("Last Refresh")) .
788 ": $clk</small></center>";
791 /* Next, display the refresh button. */
792 echo '<small>(<a href="../src/left_main.php" target="left">'.
793 _("refresh folder list") . '</a>)</small></center><br>';
795 /* Lastly, display the folder list. */
796 if ( $collapse_folders ) {
797 /* If directed, collapse or uncollapse a folder. */
799 setPref($data_dir, $username, 'collapse_folder_' . $fold, SM_BOX_COLLAPSED
);
800 } else if (isset($unfold)) {
801 setPref($data_dir, $username, 'collapse_folder_' . $unfold, SM_BOX_UNCOLLAPSED
);
805 if ($oldway) { /* normal behaviour SM */
807 $boxes = sqimap_mailbox_list($imapConnection);
808 /* Prepare do do out collapsedness and visibility computation. */
810 $boxcount = count($boxes);
812 /* Compute the collapsedness and visibility of each box. */
814 while ($curbox < $boxcount) {
815 $boxes[$curbox]['visible'] = TRUE;
816 compute_folder_children($curbox, $boxcount);
820 for ($i = 0; $i < count($boxes); $i++
) {
821 if ( $boxes[$i]['visible'] ) {
822 $mailbox = $boxes[$i]['formatted'];
823 $mblevel = substr_count($boxes[$i]['unformatted'], $delimiter) +
1;
825 /* Create the prefix for the folder name and link. */
826 $prefix = str_repeat(' ',$mblevel);
827 if (isset($collapse_folders) && $collapse_folders && $boxes[$i]['parent']) {
828 $prefix = str_replace(' ',' ',substr($prefix,0,strlen($prefix)-2)).
829 create_collapse_link($i) . ' ';
831 $prefix = str_replace(' ',' ',$prefix);
833 $line = "<NOBR><TT>$prefix</TT>";
835 /* Add the folder name and link. */
836 if (! isset($color[15])) {
837 $color[15] = $color[6];
840 if (in_array('noselect', $boxes[$i]['flags'])) {
841 if( isSpecialMailbox( $boxes[$i]['unformatted']) ) {
842 $line .= "<FONT COLOR=\"$color[11]\">";
844 $line .= "<FONT COLOR=\"$color[15]\">";
846 if (ereg("^( *)([^ ]*)", $mailbox, $regs)) {
847 $mailbox = str_replace(' ','',$mailbox);
848 $line .= str_replace(' ', ' ', $mailbox);
852 $line .= formatMailboxName($imapConnection, $boxes[$i]);
855 /* Put the final touches on our folder line. */
856 $line .= "</NOBR><BR>\n";
858 /* Output the line for this folder. */
862 } else { /* expiremental code */
863 $boxes = sqimap_mailbox_tree($imapConnection);
864 if (isset($advanced_tree) && $advanced_tree) {
865 echo '<FORM name=collapse action="left_main.php" METHOD=POST' .
866 'ENCTYPE="multipart/form-data"'."\n";
867 echo '<small><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>';
868 echo '<DIV ID=mailboxes CLASS=mailboxes>'."\n\n";
869 if (!isset($mbx)) $mbx=NULL;
870 ListAdvancedBoxes($boxes, $mbx);
871 echo '</div></small>'."\n";
876 } /* if ($oldway) else ... */
877 do_hook('left_main_after');
878 sqimap_logout($imapConnection);
880 echo '</td></tr></table>' . "\n".
881 "</div></body></html>\n";