~ubuntu-branches/ubuntu/hardy/squirrelmail/hardy-updates

« back to all changes in this revision

Viewing changes to src/left_main.php

  • Committer: Bazaar Package Importer
  • Author(s): Thijs Kinkhorst
  • Date: 2005-02-06 21:41:51 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050206214151-z4n1o8mnttgzuj0y
Tags: 2:1.4.4-3
* Move default_pref config file from /var to /etc, as per Debian policy
  (Closes: #293281)
* [JvW] (finally) override two lintian warnings about nonstandard
  permissions that are intentional (Closes: #293366)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
/**
4
4
 * left_main.php
5
5
 *
6
 
 * Copyright (c) 1999-2003 The SquirrelMail Project Team
 
6
 * Copyright (c) 1999-2005 The SquirrelMail Project Team
7
7
 * Licensed under the GNU GPL. For full terms see the file COPYING.
8
8
 *
9
9
 * This is the code for the left bar. The left bar shows the folders
10
10
 * available, and has cookie information.
11
11
 *
12
 
 * $Id: left_main.php,v 1.184 2003/12/12 21:14:15 indiri69 Exp $
 
12
 * @version $Id: left_main.php,v 1.154.2.18 2004/12/29 19:12:07 jervfors Exp $
13
13
 * @package squirrelmail
14
14
 */
15
15
 
16
 
/** Path for SquirrelMail required files. */
 
16
/**
 
17
 * Path for SquirrelMail required files.
 
18
 * @ignore
 
19
 */
17
20
define('SM_PATH','../');
18
21
 
19
22
/* SquirrelMail required files. */
22
25
require_once(SM_PATH . 'functions/plugin.php');
23
26
require_once(SM_PATH . 'functions/page_header.php');
24
27
require_once(SM_PATH . 'functions/html.php');
25
 
require_once(SM_PATH . 'functions/date.php');
26
28
 
27
29
/* These constants are used for folder stuff. */
28
30
define('SM_BOX_UNCOLLAPSED', 0);
49
51
    $status = array('','');
50
52
    if (($unseen_notify == 2 && $real_box == 'INBOX') ||
51
53
        $unseen_notify == 3) {
52
 
    $tmp_status = create_unseen_string($real_box, $box_array, $imapConnection, $unseen_type );
53
 
    if ($status !== false) {
54
 
        $status = $tmp_status;
55
 
    }
 
54
            $tmp_status = create_unseen_string($real_box, $box_array, $imapConnection, $unseen_type );
 
55
            if ($status !== false) {
 
56
                $status = $tmp_status;
 
57
            }
56
58
    }
57
59
    list($unseen_string, $unseen) = $status;
58
60
    $special_color = ($use_special_folder_color && isSpecialMailbox($real_box));
61
63
    $line = '';
62
64
 
63
65
    /* If there are unseen message, bold the line. */
64
 
    if ($unseen > 0) { $line .= '<B>'; }
 
66
    if ($unseen > 0) { $line .= '<b>'; }
65
67
 
66
68
    /* Create the link for this folder. */
67
69
    if ($status !== false) {
68
 
    $line .= '<a href="right_main.php?PG_SHOWALL=0&amp;sort=0&amp;startMessage=1&amp;mailbox='.
69
 
                $mailboxURL.'" TARGET="right" STYLE="text-decoration:none">';
 
70
        $line .= '<a href="right_main.php?PG_SHOWALL=0&amp;sort=0&amp;startMessage=1&amp;mailbox='.
 
71
                 $mailboxURL.'" target="right" style="text-decoration:none">';
70
72
    }
71
73
    if ($special_color) {
72
74
        $line .= "<font color=\"$color[11]\">";
74
76
    if ( $mailbox == 'INBOX' ) {
75
77
        $line .= _("INBOX");
76
78
    } else {
77
 
        $line .= str_replace(' ','&nbsp;',$mailbox);
 
79
        $line .= str_replace(array(' ','<','>'),array('&nbsp;','&lt;','&gt;'),$mailbox);
78
80
    }
79
81
    if ($special_color == TRUE)
80
82
        $line .= '</font>';
81
83
    if ($status !== false) {
82
 
    $line .= '</a>';
 
84
        $line .= '</a>';
83
85
    }
84
86
 
85
87
    /* If there are unseen message, close bolding. */
86
 
    if ($unseen > 0) { $line .= "</B>"; }
 
88
    if ($unseen > 0) { $line .= "</b>"; }
87
89
 
88
90
    /* Print unseen information. */
89
91
    if ($unseen_string != '') {
90
 
        $line .= "&nbsp;<SMALL>$unseen_string</SMALL>";
 
92
        $line .= "&nbsp;<small>$unseen_string</small>";
91
93
    }
92
94
 
93
95
    /* If it's the trash folder, show a purge link when needed */
99
101
        if (($numMessages > 0) or ($box_array['parent'] == 1)) {
100
102
            $urlMailbox = urlencode($real_box);
101
103
            $line .= "\n<small>\n" .
102
 
                    "&nbsp;&nbsp;(<A HREF=\"empty_trash.php\" style=\"text-decoration:none\">"._("purge")."</A>)" .
103
 
                    "</small>";
104
 
        } else {
105
 
           $line .= concat_hook_function('left_main_after_each_folder',
106
 
                  array(isset($numMessages) ? $numMessages : '',$real_box,$imapConnection));
 
104
                    '&nbsp;&nbsp;(<a href="empty_trash.php" style="text-decoration:none">'._("Purge").'</a>)' .
 
105
                    '</small>';
107
106
        }
 
107
    } else {
 
108
        $line .= concat_hook_function('left_main_after_each_folder',
 
109
                                      array(isset($numMessages) ? $numMessages : '',
 
110
                                            $real_box, $imapConnection));
108
111
    }
109
112
 
110
113
    /* Return the final product. */
180
183
    }
181
184
    $link .= '</a>';
182
185
 
183
 
    $hooklink = do_hook_function('create_collapse_link',$link);
184
 
    if ($hooklink != '')
185
 
        $link = $hooklink;
186
 
 
187
186
    /* Return the finished product. */
188
187
    return ($link);
189
188
}
197
196
 * @param string $boxName name of the current mailbox
198
197
 * @param array $boxArray array for the current mailbox
199
198
 * @param $imapConnection current imap connection in use
200
 
 * @return array unseen message string (for display), unseen message count
 
199
 * @return array[0] unseen message string (for display)
 
200
 * @return array[1] unseen message count
201
201
 */
202
202
function create_unseen_string($boxName, $boxArray, $imapConnection, $unseen_type) {
203
203
    global $boxes, $unseen_type, $color, $unseen_cum;
215
215
    $status = sqimap_status_messages($imapConnection, $boxName);
216
216
    $boxUnseenCount = $status['UNSEEN'];
217
217
    if ($boxUnseenCount === false) {
218
 
    return false;
 
218
        return false;
219
219
    }
220
220
    if ($unseen_type == 2) {
221
221
        $boxMessageCount = $status['MESSAGES'];
235
235
 
236
236
            /* Collect the counts for this subfolder. */
237
237
            if (($boxName != $boxes[$i]['unformatted'])
238
 
                   && (substr($boxes[$i]['unformatted'], 0, $curBoxLength) == $boxName)
239
 
                   && !in_array('noselect', $boxes[$i]['flags'])) {
240
 
        $status = sqimap_status_messages($imapConnection, $boxes[$i]['unformatted']);
241
 
        $subUnseenCount = $status['UNSEEN'];
 
238
                    && (substr($boxes[$i]['unformatted'], 0, $curBoxLength) == $boxName)
 
239
                    && !in_array('noselect', $boxes[$i]['flags'])) {
 
240
                $status = sqimap_status_messages($imapConnection, $boxes[$i]['unformatted']);
 
241
                $subUnseenCount = $status['UNSEEN'];
242
242
                if ($unseen_type == 2) {
243
243
                    $subMessageCount = $status['MESSAGES'];;
244
244
                }
285
285
    return ($parbox_name == $actual_parname);
286
286
}
287
287
 
288
 
function ListBoxes ($boxes, $j=0 ) {
 
288
function listBoxes ($boxes, $j=0 ) {
289
289
    global $data_dir, $username, $startmessage, $color, $unseen_notify, $unseen_type,
290
 
           $move_to_trash, $trash_folder, $collapse_folders, $imapConnection;
291
 
 
292
 
    if (!isset($boxes) || empty($boxes))
293
 
        return;
294
 
 
295
 
    $pre = '<nobr>';
 
290
        $move_to_trash, $trash_folder, $collapse_folders, $use_special_folder_color,
 
291
        $imapConnection;
 
292
 
 
293
    $pre = '';
296
294
    $end = '';
297
295
    $collapse = false;
298
 
    $unseen_found = false;
299
 
    $unseen = 0;
300
 
 
301
 
    $mailbox = $boxes->mailboxname_full;
302
 
    $leader = '<tt>';
303
 
    $leader .= str_repeat('&nbsp;&nbsp;',$j);
304
 
    $mailboxURL = urlencode($mailbox);
305
 
 
306
 
    /* get unseen/total messages information */
307
 
    /* Only need to display info when option is set */
308
 
    if (isset($unseen_notify) && ($unseen_notify > 1) &&
309
 
        (($boxes->unseen !== false) || ($boxes->total !== false))) {
310
 
 
311
 
        if ($boxes->unseen !== false)
 
296
    if ($boxes) {
 
297
        $mailbox = $boxes->mailboxname_full;
 
298
        $leader = '';
 
299
        for ($k = 0; $k < $j; $k++) {
 
300
            $leader.= '&nbsp;&nbsp;&nbsp;';
 
301
        }
 
302
        $mailboxURL = urlencode($mailbox);
 
303
 
 
304
        /* get unseen/total messages information */
 
305
        if ($boxes->unseen) {
312
306
            $unseen = $boxes->unseen;
313
 
 
314
 
        /*
315
 
            Should only display unseen info if the folder is inbox
316
 
            or you set the option for all folders
317
 
        */
318
 
 
319
 
        if ((strtolower($mailbox) == 'inbox') || ($unseen_notify == 3)) {
320
 
            $unseen_string = $unseen;
321
 
 
322
 
            /* If users requests, display message count too */
323
 
            if (isset($unseen_type) && ($unseen_type == 2) && ($boxes->total !== false)) {
324
 
                $unseen_string .= '/' . $boxes->total;
325
 
            }
326
 
 
327
 
            $unseen_string = "<font color=\"$color[11]\">($unseen_string)</font>";
328
 
 
329
 
            /*
330
 
                Finally allow the script to display the values by setting a boolean.
331
 
                This can only occur if the unseen count is great than 0 (if you have
332
 
                unseen count only), or you have the message count too.
333
 
            */
334
 
            if (($unseen > 0) || (isset($unseen_type) && ($unseen_type ==2))) {
335
 
                $unseen_found = true;
336
 
            }
337
 
        }
338
 
    }
339
 
 
340
 
    if (isset($boxes->mbxs[0]) && $collapse_folders) {
341
 
        $collapse = getPref($data_dir, $username, 'collapse_folder_' . $mailbox);
342
 
        $collapse = ($collapse == '' ? SM_BOX_UNCOLLAPSED : $collapse);
343
 
 
344
 
        $link = '<a target="left" style="text-decoration:none" ' .'href="left_main.php?';
345
 
        if ($collapse) {
346
 
            $link .= "unfold=$mailboxURL\">$leader+&nbsp;</tt>";
347
 
        } else {
348
 
            $link .= "fold=$mailboxURL\">$leader-&nbsp;</tt>";
349
 
        }
350
 
        $link .= '</a>';
351
 
        $pre .= $link;
352
 
    } else {
353
 
        $pre.= $leader . '&nbsp;&nbsp;</tt>';
354
 
    }
355
 
 
356
 
    /* If there are unseen message, bold the line. */
357
 
    if (($move_to_trash) && ($mailbox == $trash_folder)) {
358
 
        if (! isset($boxes->total)) {
359
 
            $boxes->total = sqimap_status_messages($imapConnection, $mailbox);
360
 
        }
361
 
        if ($unseen > 0) {
362
 
            $pre .= '<b>';
363
 
        }
364
 
        $pre .= "<a href=\"right_main.php?PG_SHOWALL=0&amp;sort=0;startMessage=1&amp;mailbox=$mailboxURL\" target=\"right\" style=\"text-decoration:none\">";
365
 
        if ($unseen > 0) {
366
 
            $end .= '</b>';
367
 
        }
368
 
        $end .= '</a>';
369
 
        if ($boxes->total > 0) {
370
 
            if ($unseen > 0) {
371
 
                $pre .= '<b>';
372
 
            }
373
 
            $pre .= "<a href=\"right_main.php?PG_SHOWALL=0&amp;sort=0;startMessage=1&amp;mailbox=$mailboxURL\" target=\"right\" style=\"text-decoration:none\">";
374
 
            if ($unseen > 0) {
375
 
                $end .= '</b>';
376
 
            }
377
 
            /* Print unseen information. */
378
 
            if ($unseen_found) {
379
 
                $end .= "&nbsp;<small>$unseen_string</small>";
380
 
            }
381
 
            $end .= "\n<small>\n" .
382
 
                    "&nbsp;&nbsp;(<a href=\"empty_trash.php\" style=\"text-decoration:none\">"._("purge")."</a>)" .
383
 
                    "</small>";
384
 
        }
385
 
    } else {
386
 
        if (!$boxes->is_noselect) {
387
 
            if ($unseen > 0) {
388
 
                $pre .= '<b>';
389
 
            }
390
 
            $pre .= "<a href=\"right_main.php?PG_SHOWALL=0&amp;sort=0&amp;startMessage=1&amp;mailbox=$mailboxURL\" target=\"right\" style=\"text-decoration:none\">";
391
 
            if ($unseen > 0) {
392
 
                $end .= '</b>';
393
 
            }
394
 
            $end .= '</a>';
395
 
        }
 
307
            $unseen_string = "($unseen)";
 
308
            if ($unseen>0) $unseen_found = TRUE;
 
309
            if ($boxes->total) {
 
310
                $numMessages = $boxes->total;
 
311
                $unseen_string = "<font color=\"$color[11]\">($unseen/$numMessages)</font>";
 
312
            }
 
313
        } else $unseen = 0;
 
314
 
 
315
 
 
316
 
 
317
        if (isset($boxes->mbxs[0]) && $collapse_folders) {
 
318
            $collapse = getPref($data_dir, $username, 'collapse_folder_' . $mailbox);
 
319
            $collapse = ($collapse == '' ? SM_BOX_UNCOLLAPSED : $collapse);
 
320
 
 
321
            $link = '<a target="left" style="text-decoration:none" ' .'href="left_main.php?';
 
322
            if ($collapse) {
 
323
                $link .= "unfold=$mailboxURL\">$leader +&nbsp;";
 
324
            } else {
 
325
                $link .= "fold=$mailboxURL\">$leader -&nbsp;";
 
326
            }
 
327
            $link .= '</a>';
 
328
            $pre .= $link;
 
329
        } else {
 
330
            $pre.= $leader . '&nbsp;&nbsp;&nbsp;';
 
331
        }
 
332
 
 
333
 
 
334
        /* If there are unseen message, bold the line. */
 
335
        if ($unseen > 0) { $pre .= '<b>'; }
 
336
 
 
337
        if (($move_to_trash) && ($mailbox == $trash_folder)) {
 
338
            if (! isset($numMessages)) {
 
339
                $status = sqimap_status_messages($imapConnection, $mailbox);
 
340
                $numMessages = $status['MESSAGES'];
 
341
            }
 
342
 
 
343
            if ($numMessages > 0) {
 
344
                $urlMailbox = urlencode($mailbox);
 
345
                $pre .= "\n<small>\n" .
 
346
                "&nbsp;&nbsp;(<a href=\"empty_trash.php\" style=\"text-decoration:none\">"._("Purge")."</a>)" .
 
347
                "</small>";
 
348
            }
 
349
        } else {
 
350
            if (!$boxes->is_noselect) {
 
351
                $pre .= "<a href=\"right_main.php?PG_SHOWALL=0&amp;sort=0&amp;startMessage=1&amp;mailbox=$mailboxURL\" target=\"right\">";
 
352
                $end .= '</a>';
 
353
            }
 
354
        }
 
355
 
 
356
        /* If there are unseen message, close bolding. */
 
357
        if ($unseen > 0) { $end .= "</b>"; }
 
358
 
396
359
        /* Print unseen information. */
397
 
        if ($unseen_found) {
 
360
        if (isset($unseen_found) && $unseen_found) {
398
361
            $end .= "&nbsp;<small>$unseen_string</small>";
399
362
        }
400
363
 
401
 
    }
402
 
 
403
 
    $font = '';
404
 
    $fontend = '';
405
 
    if ($boxes->is_special) {
406
 
        $font = "<font color=\"$color[11]\">";
407
 
        $fontend = "</font>";
408
 
    }
409
 
    $end .= '</nobr>';
410
 
 
411
 
    if (!$boxes->is_root) {
412
 
        echo "" . $pre .$font. $boxes->mailboxname_sub .$fontend . $end. '<br />' . "\n";
413
 
        $j++;
414
 
    }
415
 
 
416
 
    if (!$collapse || $boxes->is_root) {
417
 
        for ($i = 0; $i <count($boxes->mbxs); $i++) {
418
 
            listBoxes($boxes->mbxs[$i],$j);
419
 
        }
 
364
        $font = '';
 
365
        $fontend = '';
 
366
        if ($use_special_folder_color && $boxes->is_special) {
 
367
            $font = "<font color=\"$color[11]\">";
 
368
            $fontend = "</font>";    
 
369
        }
 
370
 
 
371
        if (!$boxes->is_root) { 
 
372
            echo "" . $pre .$font. str_replace(array(' ','<','>'),array('&nbsp;','&lt;','&gt;'),$boxes->mailboxname_sub) .$fontend . $end. '<br />';
 
373
            $j++;
 
374
        }
 
375
        if (!$collapse || $boxes->is_root) {
 
376
            for ($i = 0; $i <count($boxes->mbxs); $i++) {
 
377
                listBoxes($boxes->mbxs[$i],$j);
 
378
            }
 
379
        }
 
380
 
420
381
    }
421
382
}
422
383
 
423
384
function ListAdvancedBoxes ($boxes, $mbx, $j='ID.0000' ) {
424
385
    global $data_dir, $username, $startmessage, $color, $unseen_notify, $unseen_type,
425
 
           $move_to_trash, $trash_folder, $collapse_folders;
426
 
 
427
 
    if (!isset($boxes) || empty($boxes))
428
 
        return;
 
386
        $move_to_trash, $trash_folder, $collapse_folders, $use_special_folder_color;
429
387
 
430
388
    /* use_folder_images only works if the images exist in ../images */
431
389
    $use_folder_images = true;
433
391
    $pre = '';
434
392
    $end = '';
435
393
    $collapse = false;
436
 
    $unseen_found = false;
437
 
    $unseen = 0;
438
 
 
439
 
    $mailbox = $boxes->mailboxname_full;
440
 
    $mailboxURL = urlencode($mailbox);
441
 
 
442
 
    /* get unseen/total messages information */
443
 
    /* Only need to display info when option is set */
444
 
    if (isset($unseen_notify) && ($unseen_notify > 1) &&
445
 
        (($boxes->unseen !== false) || ($boxes->total !== false))) {
446
 
 
447
 
        if ($boxes->unseen !== false)
 
394
    
 
395
    if ($boxes) {
 
396
        $mailbox = $boxes->mailboxname_full;
 
397
        $mailboxURL = urlencode($mailbox);
 
398
 
 
399
        /* get unseen/total messages information */
 
400
        if ($boxes->unseen) {
448
401
            $unseen = $boxes->unseen;
449
 
 
450
 
        /*
451
 
            Should only display unseen info if the folder is inbox
452
 
            or you set the option for all folders
453
 
        */
454
 
 
455
 
        if ((strtolower($mailbox) == 'inbox') || ($unseen_notify == 3)) {
456
 
            $unseen_string = $unseen;
457
 
 
458
 
            /* If users requests, display message count too */
459
 
            if (isset($unseen_type) && ($unseen_type == 2) && ($boxes->total !== false)) {
460
 
                $unseen_string .= '/' . $boxes->total;
461
 
            }
462
 
 
463
 
            $unseen_string = "<font color=\"$color[11]\">($unseen_string)</font>";
464
 
 
465
 
            /*
466
 
                Finally allow the script to display the values by setting a boolean.
467
 
                This can only occur if the unseen count is great than 0 (if you have
468
 
                unseen count only), or you have the message count too.
469
 
            */
470
 
            if (($unseen > 0) || (isset($unseen_type) && ($unseen_type ==2))) {
471
 
                $unseen_found = true;
472
 
            }
473
 
        }
474
 
    }
475
 
 
476
 
    /* If there are unseen message, bold the line. */
477
 
    if ($unseen > 0) { $pre .= '<b>'; }
478
 
 
479
 
    /* color special boxes */
480
 
    if ($boxes->is_special) {
481
 
        $pre .= "<font color=\"$color[11]\">";
482
 
        $end .= '</font>';
483
 
    }
484
 
 
485
 
    /* If there are unseen message, close bolding. */
486
 
    if ($unseen > 0) { $end .= '</b>'; }
487
 
 
488
 
    /* Print unseen information. */
489
 
    if ($unseen_found) {
490
 
        $end .= "&nbsp;$unseen_string";
491
 
    }
492
 
 
493
 
    if (($move_to_trash) && ($mailbox == $trash_folder)) {
494
 
        if (! isset($numMessages)) {
495
 
            $numMessages = $boxes->total;
496
 
        }
497
 
        $pre = "<a class=\"mbx_link\" href=\"right_main.php?PG_SHOWALL=0&amp;sort=0&amp;startMessage=1&amp;mailbox=$mailboxURL\" target=\"right\">" . $pre;
498
 
        $end .= '</a>';
499
 
        if ($numMessages > 0) {
500
 
            $urlMailbox = urlencode($mailbox);
501
 
            $end .= "\n<small>\n" .
502
 
                    "&nbsp;&nbsp;(<a class=\"mbx_link\" href=\"empty_trash.php\">"._("purge")."</a>)" .
 
402
            $unseen_string = "($unseen)";
 
403
            if ($unseen>0) $unseen_found = TRUE;
 
404
            if ($boxes->total) {
 
405
                $numMessages = $boxes->total;
 
406
                $unseen_string = "<font color=\"$color[11]\">($unseen/$numMessages)</font>";
 
407
            }
 
408
        } else $unseen = 0;
 
409
 
 
410
        /* If there are unseen message, bold the line. */
 
411
        if ($unseen > 0) { $pre .= '<b>'; }
 
412
 
 
413
        /* color special boxes */
 
414
        if ($use_special_folder_color && $boxes->is_special) {
 
415
            $pre .= "<font color=\"$color[11]\">";
 
416
            $end .= '</font>';
 
417
        }
 
418
 
 
419
        /* If there are unseen message, close bolding. */
 
420
        if ($unseen > 0) { $end .= '</b>'; }
 
421
 
 
422
        /* Print unseen information. */
 
423
        if (isset($unseen_found) && $unseen_found) {
 
424
            $end .= "&nbsp;$unseen_string";
 
425
        }
 
426
 
 
427
        if (($move_to_trash) && ($mailbox == $trash_folder)) {
 
428
            if (! isset($numMessages)) {
 
429
                $numMessages = $boxes->total;
 
430
            }
 
431
            if ($numMessages > 0) {
 
432
                $urlMailbox = urlencode($mailbox);
 
433
                $pre .= "\n<small>\n" .
 
434
                    "&nbsp;&nbsp;(<a class=\"mbx_link\" href=\"empty_trash.php\">"._("Purge")."</a>)" .
503
435
                    "</small>";
504
 
        }
505
 
    } else {
506
 
        if (!$boxes->is_noselect) { /* \Noselect boxes can't be selected */
507
 
            $pre = "<a class=\"mbx_link\" href=\"right_main.php?PG_SHOWALL=0&amp;sort=0&amp;startMessage=1&amp;mailbox=$mailboxURL\" target=\"right\">" . $pre;
508
 
            $end .= '</a>';
509
 
        }
510
 
    }
511
 
 
512
 
    if (!$boxes->is_root) {
513
 
        if ($use_folder_images) {
514
 
            if ($boxes->is_inbox) {
515
 
                $folder_img = '../images/inbox.png';
516
 
            } else if ($boxes->is_sent) {
517
 
                $folder_img = '../images/senti.png';
518
 
            } else if ($boxes->is_trash) {
519
 
                $folder_img = '../images/delitem.png';
520
 
            } else if ($boxes->is_draft) {
521
 
                $folder_img = '../images/draft.png';
522
 
            } else if ($boxes->is_noinferiors) {
523
 
                $folder_img = '../images/folder_noinf.png';
524
 
            } else {
525
 
                $folder_img = '../images/folder.png';
526
 
            }
527
 
            $folder_img = '&nbsp;<img src="'.$folder_img.'" height="15" valign="center" />&nbsp;';
528
 
        } else {
529
 
            $folder_img = '';
530
 
        }
531
 
        if (!isset($boxes->mbxs[0])) {
532
 
            echo '   ' . html_tag( 'div',
533
 
                            '<tt>'. $pre . $folder_img . '</tt>'. $boxes->mailboxname_sub . $end,
534
 
                            'left', '', 'class="mbx_sub" id="' .$j. '"' ) . "\n";
535
 
        } else {
536
 
            /* get collapse information */
537
 
            if ($collapse_folders) {
538
 
                $form_entry = $j.'F';
539
 
                if (isset($mbx) && isset($mbx[$form_entry])) {
540
 
                    $collapse = $mbx[$form_entry];
541
 
                    setPref($data_dir, $username, 'collapse_folder_'.$boxes->mailboxname_full , $collapse ? SM_BOX_COLLAPSED : SM_BOX_UNCOLLAPSED);
542
 
                } else {
543
 
                    $collapse = getPref($data_dir, $username, 'collapse_folder_' . $mailbox);
544
 
                    $collapse = ($collapse == '' ? SM_BOX_UNCOLLAPSED : $collapse);
545
 
                }
546
 
                $img_src = ($collapse ? '../images/plus.png' : '../images/minus.png');
547
 
                $collapse_link = '<a href="javascript:void(0)">'." <img src=\"$img_src\" border=\"1\" id=$j onclick=\"hidechilds(this)\" style=\"cursor:hand\" /></a>";
548
 
            } else {
549
 
                 $collapse_link='';
550
 
            }
551
 
            echo '   ' . html_tag( 'div',
552
 
                            $collapse_link . $pre . $folder_img . '&nbsp;'. $boxes->mailboxname_sub . $end ,
553
 
                            'left', '', 'class="mbx_par" id="' .$j. 'P"' ) . "\n";
554
 
            echo '   <input type="hidden" name="mbx['.$j. 'F]" value="'.$collapse.'" id="mbx['.$j.'F]" />'."\n";
555
 
        }
556
 
    }
557
 
 
558
 
    $visible = ($collapse ? ' style="display:none"' : ' style="display:block"');
559
 
    if (isset($boxes->mbxs[0]) && !$boxes->is_root) /* mailbox contains childs */
560
 
        echo html_tag( 'div', '', 'left', '', 'class="par_area" id='.$j.'.0000 '. $visible ) . "\n";
561
 
 
562
 
    if ($j !='ID.0000')
563
 
       $j = $j .'.0000';
564
 
    for ($i = 0; $i <count($boxes->mbxs); $i++) {
565
 
        $j++;
566
 
        ListAdvancedBoxes($boxes->mbxs[$i],$mbx,$j);
567
 
    }
568
 
    if (isset($boxes->mbxs[0]) && !$boxes->is_root)
569
 
        echo '</div>'."\n\n";
 
436
            }
 
437
        } else {
 
438
            if (!$boxes->is_noselect) { /* \Noselect boxes can't be selected */
 
439
                $pre .= "<a class=\"mbx_link\" href=\"right_main.php?PG_SHOWALL=0&amp;sort=0&amp;startMessage=1&amp;mailbox=$mailboxURL\" target=\"right\">";
 
440
                $end .= '</a>';
 
441
            }
 
442
        }
 
443
 
 
444
        if (!$boxes->is_root) {
 
445
            if ($use_folder_images) {
 
446
                if ($boxes->is_inbox) {
 
447
                    $folder_img = '../images/inbox.png';
 
448
                } else if ($boxes->is_sent) {
 
449
                    $folder_img = '../images/senti.png';
 
450
                } else if ($boxes->is_trash) {
 
451
                    $folder_img = '../images/delitem.png';
 
452
                } else if ($boxes->is_draft) {
 
453
                    $folder_img = '../images/draft.png';
 
454
                } else $folder_img = '../images/folder.png';
 
455
                $folder_img = '&nbsp;<img src="'.$folder_img.'" height="15" valign="center" />&nbsp;';
 
456
            } else $folder_img = '';
 
457
            if (!isset($boxes->mbxs[0])) {
 
458
                echo '   ' . html_tag( 'div',
 
459
                        $pre . $folder_img . str_replace(array(' ','<','>'),array('&nbsp;','&lt;','&gt;'),$boxes->mailboxname_sub) . $end ,
 
460
                        'left', '', 'class="mbx_sub" id="' .$j. '"' )
 
461
                    . "\n";
 
462
            } else {
 
463
                /* get collapse information */
 
464
                if ($collapse_folders) {
 
465
                    $link = '<a target="left" style="text-decoration:none" ' .'href="left_main.php?';
 
466
                    $form_entry = $j.'F';
 
467
                    if (isset($mbx) && isset($mbx[$form_entry])) {
 
468
                        $collapse = $mbx[$form_entry];
 
469
                        if ($collapse) {
 
470
                            setPref($data_dir, $username, 'collapse_folder_'.$boxes->mailboxname_full , SM_BOX_COLLAPSED);
 
471
                        } else {
 
472
                            setPref($data_dir, $username, 'collapse_folder_'.$boxes->mailboxname_full , SM_BOX_UNCOLLAPSED);
 
473
                        }
 
474
                    } else {
 
475
                        $collapse = getPref($data_dir, $username, 'collapse_folder_' . $mailbox);
 
476
                        $collapse = ($collapse == '' ? SM_BOX_UNCOLLAPSED : $collapse);
 
477
                    }
 
478
                    if ($collapse) {
 
479
                        $link = '<a href="javascript:void(0)">'." <img src=\"../images/plus.png\" border=\"1\" id=$j onclick=\"hidechilds(this)\" /></a>";
 
480
                    } else {
 
481
                        $link = '<a href="javascript:void(0)">'."<img src=\"../images/minus.png\" border=\"1\" id=$j onclick=\"hidechilds(this)\" /></a>";
 
482
                    }
 
483
                    $collapse_link = $link;
 
484
                } else $collapse_link='';
 
485
                echo '   ' . html_tag( 'div',
 
486
                        $collapse_link . $pre . $folder_img . '&nbsp;'. $boxes->mailboxname_sub . $end ,
 
487
                        'left', '', 'class="mbx_par" id="' .$j. 'P"' )
 
488
                    . "\n";
 
489
                echo '   <input type="hidden" name="mbx['.$j. 'F]" value="'.$collapse.'" id="mbx['.$j.'F]" />'."\n";
 
490
            }
 
491
        }
 
492
        if ($collapse) {
 
493
            $visible = ' style="display:none;"';
 
494
        } else {
 
495
            $visible = ' style="display:block;"';
 
496
        }
 
497
 
 
498
        if (isset($boxes->mbxs[0]) && !$boxes->is_root) /* mailbox contains childs */
 
499
            echo html_tag( 'div', '', 'left', '', 'class="par_area" id='.$j.'.0000 '. $visible ) . "\n";
 
500
        
 
501
        if ($j !='ID.0000') {
 
502
            $j = $j .'.0000';
 
503
        }
 
504
        for ($i = 0; $i <count($boxes->mbxs); $i++) {
 
505
            $j++;
 
506
            listAdvancedBoxes($boxes->mbxs[$i],$mbx,$j);
 
507
        }
 
508
        if (isset($boxes->mbxs[0]) && !$boxes->is_root ) echo '</div>'."\n\n";
 
509
    }
570
510
}
571
511
 
572
512
 
582
522
 
583
523
sqgetGlobalVar('fold', $fold, SQ_GET);
584
524
sqgetGlobalVar('unfold', $unfold, SQ_GET);
 
525
sqgetGlobalVar('auto_create_done',$auto_create_done,SQ_SESSION);
585
526
 
586
527
/* end globals */
587
528
 
610
551
 * It only works on browsers which supports css and javascript. The used
611
552
 * javascript is experimental and doesn't support all browsers.
612
553
 * It has been tested on IE6 an Konquerer 3.0.0-2.
613
 
 * It is now tested and working on: (please test and update this list)
614
 
 * Windows: IE 5.5 SP2, IE 6 SP1, Gecko based (Mozilla, Firebird) and Opera7
615
 
 * XWindow: ?
616
 
 * Mac: ?
617
554
 * In the function ListAdvancedBoxes there is another var $use_folder_images.
618
555
 * setting this to true is only usefull if the images exists in ../images.
619
556
 *
621
558
 * to marc@its-projects.nl
622
559
 **/
623
560
 
624
 
/* set this to true if you want to see a nicer mailboxtree */
625
 
if (! isset($advanced_tree) || $advanced_tree=="" ) {
626
 
    $advanced_tree=false;
627
 
}
628
 
/* default SM behaviour */
629
 
if (! isset($oldway) || $oldway=="" ) {
630
 
    $oldway=false;
631
 
}
 
561
$advanced_tree = false; /* set this to true if you want to see a nicer mailboxtree */
 
562
$oldway = true; /* default SM behaviour */
632
563
 
633
564
if ($advanced_tree) {
634
565
$xtra .= <<<ECHO
635
 
<script language="Javascript" TYPE="text/javascript">
 
566
<script language="Javascript" type="text/javascript">
636
567
 
637
568
<!--
638
569
 
 
570
    function hidechilds(el) {
 
571
        id = el.id+".0000";
 
572
        form_id = "mbx[" + el.id +"F]";
 
573
        if (document.all) {
 
574
            ele = document.all[id];
 
575
            if (ele) {
 
576
                if(ele.style.display == "none") {
 
577
                    ele.style.display = "block";
 
578
                    ele.style.visibility = "visible"
 
579
                        el.src="../images/minus.png";
 
580
                    document.all[form_id].value=0;
 
581
               } else {
 
582
                  ele.style.display = "none";
 
583
                  ele.style.visibility = "hidden"
 
584
                      el.src="../images/plus.png";
 
585
                  document.all[form_id].value=1;
 
586
               }
 
587
            }
 
588
        } else if (document.getElementById) {
 
589
            ele = document.getElementById(id);
 
590
                if (ele) {
 
591
                    if(ele.style.display == "none") {
 
592
                        ele.style.display = "block";
 
593
                        ele.style.visibility = "visible"
 
594
                            el.src="../images/minus.png";
 
595
                        document.getElementById(form_id).value=0;
 
596
                    } else {
 
597
                        ele.style.display = "none";
 
598
                        ele.style.visibility = "hidden"
 
599
                            el.src="../images/plus.png";
 
600
                        document.getElementById(form_id).value=1;
 
601
                    }
 
602
                }   
 
603
        }
 
604
    }
 
605
 
639
606
    function preload() {
640
 
      if (document.images) {
641
 
        var treeImages = new Array;
642
 
        var arguments = preload.arguments;
643
 
        for (var i = 0; i<arguments.length; i++) {
644
 
          treeImages[i] = new Image();
645
 
          treeImages[i].src = arguments[i];
646
 
        }
647
 
      }
648
 
    }
649
 
 
650
 
var vTreeImg;
651
 
var vTreeDiv;
652
 
var vTreeSrc;
653
 
 
654
 
    function fTreeTimeout() {
655
 
      if (vTreeDiv.readyState == "complete")
656
 
        vTreeImg.src = vTreeSrc;
657
 
      else
658
 
        setTimeout("fTreeTimeout()", 100);
659
 
    }
660
 
 
661
 
    function hidechilds(img) {
662
 
      id = img.id + ".0000";
663
 
      form_id = "mbx[" + img.id +"F]";
664
 
      if (document.all) {       //IE, Opera7
665
 
        div = document.all[id];
666
 
        if (div) {
667
 
           if (div.style.display == "none") {
668
 
              vTreeSrc = "../images/minus.png";
669
 
              style = "block";
670
 
              value = 0;
671
 
           }
672
 
           else {
673
 
              vTreeSrc = "../images/plus.png";
674
 
              style = "none";
675
 
              value = 1;
676
 
           }
677
 
           vTreeImg = img;
678
 
           vTreeDiv = div;
679
 
           if (typeof vTreeDiv.readyState != "undefined")       //IE
680
 
              setTimeout("fTreeTimeout()",100);
681
 
           else //Non IE
682
 
              vTreeImg.src = vTreeSrc;
683
 
           div.style.display = style;
684
 
           document.all[form_id].value = value;
685
 
        }
686
 
      }
687
 
      else if (document.getElementById) {       //Gecko
688
 
        div = document.getElementById(id);
689
 
        if (div) {
690
 
           if (div.style.display == "none") {
691
 
              src = "../images/minus.png";
692
 
              style = "block";
693
 
              value = 0;
694
 
           }
695
 
           else {
696
 
              src = "../images/plus.png";
697
 
              style = "none";
698
 
              value = 1;
699
 
           }
700
 
           div.style.display = style;
701
 
           img.src = src;
702
 
           document.getElementById(form_id).value = value;
703
 
        }
704
 
      }
705
 
    }
706
 
 
707
 
   function buttonover(el,on) {
708
 
      if (!on) {
709
 
//         el.style.borderColor="$color[9]";}
710
 
         el.style.background="$color[0]";}
711
 
      else {
712
 
         el.style.background="$color[9]";}
713
 
   }
714
 
 
715
 
   function buttonclick(el,on) {
716
 
      if (!on) {
717
 
         el.style.border="groove";}
718
 
      else {
719
 
         el.style.border="ridge";}
720
 
   }
721
 
 
722
 
   function hideframe(hide) {
723
 
 
 
607
       if (!document.images) return;
 
608
       var ar = new Array();
 
609
       var arguments = preload.arguments;
 
610
       for (var i = 0; i<arguments.length; i++) {
 
611
           ar[i] = new Image();
 
612
           ar[i].src = arguments[i];
 
613
       }
 
614
    }
 
615
 
 
616
    function buttonover(el,on) {
 
617
        if (!on) {
 
618
            el.style.borderColor="blue";
 
619
        } else {
 
620
            el.style.borderColor="orange";
 
621
        }
 
622
    }
 
623
 
 
624
    function buttonclick(el,on) {
 
625
        if (!on) { 
 
626
            el.style.border="groove"
 
627
        } else {
 
628
            el.style.border="ridge";
 
629
        }
 
630
    }
 
631
 
 
632
    function hideframe(hide) {
 
633
   
724
634
ECHO;
725
635
$xtra .= "      left_size = \"$left_size\";\n";
726
636
$xtra .= <<<ECHO
727
 
      if (document.all) {
728
 
        masterf = window.parent.document.all["fs1"];
729
 
    leftf = window.parent.document.all["left"];
730
 
    leftcontent = document.all["leftframe"];
731
 
    leftbutton = document.all["showf"];
732
 
      } else if (document.getElementById) {
733
 
    masterf = window.parent.document.getElementById("fs1");
734
 
    leftf = window.parent.document.getElementById("left");
735
 
    leftcontent = document.getElementById("leftframe");
736
 
    leftbutton = document.getElementById("showf");
737
 
      } else {
738
 
        return false;
739
 
      }
740
 
      if(hide) {
741
 
         new_col = calc_col("20");
742
 
         masterf.cols = new_col;
743
 
     document.body.scrollLeft=0;
744
 
     document.body.style.overflow='hidden';
745
 
     leftcontent.style.display = 'none';
746
 
     leftbutton.style.display='block';
747
 
      } else {
748
 
         masterf.cols = calc_col(left_size);
749
 
     document.body.style.overflow='';
750
 
     leftbutton.style.display='none';
751
 
     leftcontent.style.display='block';
 
637
        if (document.all) {
 
638
            masterf = window.parent.document.all["fs1"];
 
639
            leftf = window.parent.document.all["left"];
 
640
            leftcontent = document.all["leftframe"];
 
641
            leftbutton = document.all["showf"];
 
642
        } else if (document.getElementById) {
 
643
            masterf = window.parent.document.getElementById("fs1");
 
644
            leftf = window.parent.document.getElementById("left");
 
645
            leftcontent = document.getElementById("leftframe");
 
646
            leftbutton = document.getElementById("showf");
 
647
        } else {
 
648
            return false;
 
649
        }
 
650
        if(hide) {
 
651
            new_col = calc_col("20");
 
652
            masterf.cols = new_col;
 
653
            document.body.scrollLeft=0;
 
654
            document.body.style.overflow='hidden';
 
655
            leftcontent.style.display = 'none';
 
656
            leftbutton.style.display='block';
 
657
        } else {
 
658
            masterf.cols = calc_col(left_size);
 
659
            document.body.style.overflow='';
 
660
            leftbutton.style.display='none';
 
661
            leftcontent.style.display='block';
752
662
 
753
663
      }
754
664
   }
775
685
     if (document.all) {
776
686
        masterf = window.parent.document.all["fs1"];
777
687
     } else if (document.getElementById) {
778
 
    window.parent.document.getElementById("fs1");
 
688
        window.parent.document.getElementById("fs1");
779
689
     } else {
780
690
        return false;
781
691
     }
892
802
 
893
803
}
894
804
 
 
805
 
 
806
 
 
807
 
895
808
displayHtmlHeader( 'SquirrelMail', $xtra );
896
809
 
897
810
/* If requested and not yet complete, attempt to autocreate folders. */
898
 
if ($auto_create_special && !isset($auto_create_done)) {
 
811
if ($auto_create_special && !$auto_create_done) {
899
812
    $autocreate = array($sent_folder, $trash_folder, $draft_folder);
900
813
    foreach( $autocreate as $folder ) {
901
814
        if (($folder != '') && ($folder != 'none')) {
910
823
    /* Let the world know that autocreation is complete! Hurrah! */
911
824
    $auto_create_done = TRUE;
912
825
    sqsession_register($auto_create_done, 'auto_create_done');
 
826
    /* retrieve the mailboxlist. We do this at a later stage again but if
 
827
       the right_frame loads faster then the second call retrieves a cached
 
828
       version of the mailboxlist without the newly created folders.
 
829
       The second parameter forces a non cached mailboxlist return.
 
830
     */
 
831
    if ($advanced_tree) {
 
832
        // do nothing, caching not seported yet.
 
833
        //$boxes = sqimap_mailbox_tree($imapConnection);
 
834
    } else {
 
835
        $boxes = sqimap_mailbox_list($imapConnection,true);
 
836
    }
913
837
}
914
838
 
915
 
if ($advanced_tree)
916
 
  echo "\n<body" .
917
 
        ' onload="preload(\'../images/minus.png\',\'../images/plus.png\')"' .
918
 
  " bgcolor=\"$color[3]\" text=\"$color[6]\" link=\"$color[6]\" vlink=\"$color[6]\" alink=\"$color[6]\">\n";
919
 
else
920
 
  echo "\n<body bgcolor=\"$color[3]\" text=\"$color[6]\" link=\"$color[6]\" vlink=\"$color[6]\" alink=\"$color[6]\">\n";
 
839
echo "\n<body bgcolor=\"$color[3]\" text=\"$color[6]\" link=\"$color[6]\" vlink=\"$color[6]\" alink=\"$color[6]\">\n";
921
840
 
922
841
do_hook('left_main_before');
923
842
if ($advanced_tree) {
924
843
   /* nice future feature, needs layout !! volunteers?   */
925
844
   $right_pos = $left_size - 20;
926
 
/*   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>';
927
 
   echo '<div ID="showf" style="width=20;font-size:12;display:none;"><a href="javascript:hideframe(false)"><b>>></b></a></div>';
928
 
   echo '<div ID="incrf" style="width=20;font-size:12"><a href="javascript:resizeframe(true)"><b>></b></a></div>';
929
 
   echo '<div ID="decrf" style="width=20;font-size:12"><a href="javascript:resizeframe(false)"><b><</b></a></div></div>';
930
 
   echo '<div ID="leftframe"><br /><br />';*/
 
845
/*   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>&lt;&lt;</b></a></div>';
 
846
   echo '<div id="showf" style="width=20;font-size:12;display:none;"><a href="javascript:hideframe(false)"><b>&gt;&gt;</b></a></div>';
 
847
   echo '<div id="incrf" style="width=20;font-size:12"><a href="javascript:resizeframe(true)"><b>&gt;</b></a></div>';
 
848
   echo '<div id="decrf" style="width=20;font-size:12"><a href="javascript:resizeframe(false)"><b>&lt;</b></a></div></div>';
 
849
   echo '<div id="leftframe"><br /><br />';*/
931
850
}
932
851
 
933
852
echo "\n\n" . html_tag( 'table', '', 'left', '', 'border="0" cellspacing="0" cellpadding="0" width="99%"' ) .
934
853
    html_tag( 'tr' ) .
935
854
    html_tag( 'td', '', 'left' ) .
936
 
    '<center><font size="4"><b>'. _("Folders") . "</b><br /></font>\n\n";
 
855
    html_tag( 'table', '', '', '', 'border="0" cellspacing="0" cellpadding="0"' ) .
 
856
    html_tag( 'tr' ) .
 
857
    html_tag( 'td', '', 'center' ) .
 
858
    '<font size="4"><b>'. _("Folders") . "</b><br /></font>\n\n";
937
859
 
938
860
if ($date_format != 6) {
939
861
    /* First, display the clock. */
951
873
    }
952
874
 
953
875
    switch( $date_format ) {
 
876
    case 0:
 
877
        $clk = date('Y-m-d '.$hr. ' T', time());
 
878
        break;
954
879
    case 1:
955
880
        $clk = date('m/d/y '.$hr, time());
956
881
        break;
966
891
    }
967
892
    $clk = str_replace(' ','&nbsp;',$clk);
968
893
 
969
 
    echo '<center><small>' . str_replace(' ','&nbsp;',_("Last Refresh")) .
970
 
         ": $clk</small></center>";
 
894
    echo '<nobr><small>' . str_replace(' ','&nbsp;',_("Last Refresh")) .
 
895
         ": $clk</small></nobr><br />";
971
896
}
972
897
 
973
898
/* Next, display the refresh button. */
974
 
echo '<small>(<a href="../src/left_main.php" target="left">'.
975
 
     _("refresh folder list") . '</a>)</small></center><br />';
 
899
echo '<nobr><small>(<a href="../src/left_main.php" target="left">'.
 
900
     _("Check mail") . '</a>)</small></nobr></td></tr></table><br />';
976
901
 
977
902
/* Lastly, display the folder list. */
978
903
if ( $collapse_folders ) {
984
909
    }
985
910
}
986
911
 
987
 
/* Get unseen/total display prefs */
988
 
$unseen_type = getPref( $data_dir , $username , 'unseen_type' );
989
 
$unseen_notify = getPref( $data_dir , $username , 'unseen_notify' );
990
 
 
991
 
if (!isset($unseen_type) || empty($unseen_type)) {
992
 
    if (isset($default_unseen_type) && !empty($default_unseen_type)) {
993
 
        $unseen_type = $default_unseen_type;
994
 
    } else {
995
 
        $unseen_type = 1;
996
 
    }
997
 
}
998
 
 
999
 
if (!isset($unseen_notify) || empty($unseen_notify)) {
1000
 
    if (isset($default_unseen_notify) && !empty($default_unseen_notify)) {
1001
 
        $unseen_notify = $default_unseen_notify;
1002
 
    } else {
1003
 
        $unseen_notify = 0;
1004
 
    }
1005
 
}
1006
 
 
1007
912
if ($oldway) {  /* normal behaviour SM */
1008
913
 
1009
 
$boxes = sqimap_mailbox_list($imapConnection);
 
914
sqgetGlobalVar('force_refresh',$force_refresh,SQ_GET);
 
915
if (!isset($boxes)) { // auto_create_done
 
916
    $boxes = sqimap_mailbox_list($imapConnection,$force_refresh);
 
917
}
1010
918
/* Prepare do do out collapsedness and visibility computation. */
1011
919
$curbox = 0;
1012
920
$boxcount = count($boxes);
1054
962
        }
1055
963
 
1056
964
        /* Put the final touches on our folder line. */
1057
 
        $line .= "</nobr><br>\n";
 
965
        $line .= "</nobr><br />\n";
1058
966
 
1059
967
        /* Output the line for this folder. */
1060
968
        echo $line;
1064
972
    $boxes = sqimap_mailbox_tree($imapConnection);
1065
973
    if (isset($advanced_tree) && $advanced_tree) {
1066
974
        echo '<form name="collapse" action="left_main.php" method="post" ' .
1067
 
             'enctype="multipart/form-data"'."\n";
 
975
            'enctype="multipart/form-data"'."\n";
1068
976
        echo '<small>';
1069
977
        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 />';
1070
978
        echo '<div id="mailboxes" class="mailboxes">'."\n\n";
1071
 
        sqgetGlobalVar('mbx', $mbx, SQ_POST);
1072
 
        if (!isset($mbx)) $mbx=NULL;
1073
 
        ListAdvancedBoxes($boxes, $mbx);
 
979
        if (!isset($mbx)) $mbx=NULL; 
 
980
            ListAdvancedBoxes($boxes, $mbx);
1074
981
        echo '</div>';
1075
982
        echo '</small>';
1076
983
        echo '</form>'."\n";
1077
984
    } else {
1078
 
        //sqimap_get_status_mbx_tree($imap_stream,$boxes)    
1079
985
        ListBoxes($boxes);
1080
986
    }
1081
987
} /* if ($oldway) else ... */
 
988
 
 
989
       /* Next, display the refresh button. */
 
990
//       echo '<br><center><small>(<a href="../src/left_main.php?force_refresh=1" target="left">'.
 
991
//          _("refresh folder list") . '</a>)</small></center><br />';
 
992
 
 
993
 
 
994
 
1082
995
do_hook('left_main_after');
1083
996
sqimap_logout($imapConnection);
1084
997
 
1085
 
echo '</td></tr></table>' . "\n".
1086
 
    "</div></body></html>\n";
1087
 
 
1088
998
?>
 
999
</td></tr></table>
 
1000
</div></body></html>
 
 
b'\\ No newline at end of file'