X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fleft_main.php;h=a04ebe8139327637a1066d1b55a5204b2f8f497b;hb=8a2e4d5b2bf13cea37d09a958ed22ae626306df2;hp=d6925c100089ea793e80800da8a2b0cc95c5b36d;hpb=a6d2e0ded21942633358a46282260c14746dd8c0;p=squirrelmail.git diff --git a/src/left_main.php b/src/left_main.php index d6925c10..a04ebe81 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -1,14 +1,14 @@ 0) { @@ -73,10 +92,14 @@ } $special_color = false; - if ((strtolower($real_box) == "inbox") || - (($real_box == $trash_folder) && ($move_to_trash)) || - (($real_box == $sent_folder) && ($move_to_sent))) - $special_color = true; + if ($use_special_folder_color) { + if ((strtolower($real_box) == 'inbox') + || (($real_box == $trash_folder) && ($move_to_trash)) + || (($real_box == $sent_folder) && ($move_to_sent)) + || (($real_box == $draft_folder) && ($save_as_draft))) { + $special_color = true; + } + } /* Start off with a blank line. */ $line = ''; @@ -85,7 +108,7 @@ if ($unseen > 0) { $line .= ''; } /* Crate the link for this folder. */ - $line .= ""; + $line .= ""; if ($special_color == true) $line .= ""; $line .= str_replace(' ',' ',$mailbox); @@ -109,7 +132,7 @@ if ($numMessages > 0) { $urlMailbox = urlencode($real_box); $line .= "\n\n"; - $line .= "   ("._("purge").")"; + $line .= "  ("._("empty").")"; $line .= "\n\n"; } } @@ -118,7 +141,11 @@ return ($line); } - if (isset($left_refresh) && ($left_refresh != "None") && ($left_refresh != "")) { + /**********************************/ + /* END OF FUNCTION - BACK TO MAIN */ + /**********************************/ + + if (isset($left_refresh) && ($left_refresh != 'none') && ($left_refresh != '')) { echo "\n"; echo "\n"; echo "\n"; @@ -130,14 +157,51 @@ $boxes = sqimap_mailbox_list($imapConnection); - echo "
"; + echo '
'; echo _("Folders") . "
\n\n"; - echo "("; + if ($date_format != 6) { + /* First, display the clock. */ + if ($hour_format == 1) { + if ($date_format == 4) { + $hr = "G:i:s"; + } else { + $hr = "G:i"; + } + } else { + if ($date_format == 4) { + $hr = "g:i:s a"; + } else { + $hr = "g:i a"; + } + } + + switch( $date_format ) { + case 1: + $clk = date("m/d/y ".$hr, time()); + break; + case 2: + $clk = date("d/m/y ".$hr, time()); + break; + case 4: + case 5: + $clk = date($hr, time()); + break; + default: + $clk = date("D, ".$hr, time()); + } + $clk = str_replace(' ',' ',$clk); + + echo '
' . str_replace(' ',' ',_("Last Refresh")) + . ": $clk
"; + } + + /* Next, display the refresh button. */ + echo '(
'; echo _("refresh folder list"); - echo ")

"; - $delimeter = sqimap_get_delimiter($imapConnection); + echo ')

'; + /* Lastly, display the folder list. */ if (isset($collapse_folders) && $collapse_folders) { /* If directed, collapse or uncollapse a folder. */ if (isset($fold)) { @@ -160,7 +224,7 @@ for ($i = 0;$i < count($boxes); $i++) { if ($boxes[$i]['visible'] == true) { $mailbox = $boxes[$i]['formatted']; - $mblevel = substr_count($boxes[$i]['unformatted'], $delimeter) + 1; + $mblevel = substr_count($boxes[$i]['unformatted'], $delimiter) + 1; /* Create the prefix for the folder name and link. */ $prefix = str_repeat(' ',$mblevel); @@ -176,11 +240,12 @@ if (in_array('noselect', $boxes[$i]['flags'])) { $line .= ""; if (ereg("^( *)([^ ]*)", $mailbox, $regs)) { + $mailbox = str_replace(' ','',$mailbox); $line .= str_replace(' ', ' ', $mailbox); } $line .= ''; } else { - $line .= formatMailboxName($imapConnection, $boxes[$i], $delimeter); + $line .= formatMailboxName($imapConnection, $boxes[$i]); } /* Put the final touches on our folder line. */ @@ -220,12 +285,12 @@ * This simple function checks if a box is another box's parent. */ function is_parent_box($curbox_name, $parbox_name) { - global $delimeter; + global $delimiter; /* Extract the name of the parent of the current box. */ - $curparts = explode($delimeter, $curbox_name); + $curparts = explode($delimiter, $curbox_name); $curname = array_pop($curparts); - $actual_parname = implode($delimeter, $curparts); + $actual_parname = implode($delimiter, $curparts); $actual_parname = substr($actual_parname,0,strlen($parbox_name)); /* Compare the actual with the given parent name. */ @@ -238,7 +303,7 @@ * status and parent (or not parent) status for all children boxes. */ function compute_folder_children(&$parbox, $boxcount) { - global $boxes; + global $boxes, $data_dir, $username; $nextbox = $parbox + 1; /* Retreive the name for the parent box. */ @@ -254,7 +319,10 @@ $boxes[$parbox]['collapse'] = $collapse; /* Otherwise, get the name of the next box. */ - $nextbox_name = $boxes[$nextbox]['unformatted']; + if (isset($boxes[$nextbox]['unformatted'])) + $nextbox_name = $boxes[$nextbox]['unformatted']; + else + $nextbox_name = ''; /* Compute any children boxes for this box. */ while (($nextbox < $boxcount) && @@ -278,5 +346,5 @@ /* Set the parent box to the current next box. */ $parbox = $nextbox; } + echo "\n"; ?> -