X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fleft_main.php;h=5690cec02be350b8197efa052b10598d86002601;hb=8df4c9294fffc58cba49b68d1ee4954a3168d326;hp=83175f63ae67eaf741072c6deb4ff675ddadea95;hpb=82d304a0501324b276cabab1870755d5352bd21c;p=squirrelmail.git
diff --git a/src/left_main.php b/src/left_main.php
index 83175f63..5690cec0 100644
--- a/src/left_main.php
+++ b/src/left_main.php
@@ -9,11 +9,14 @@
* This is the code for the left bar. The left bar shows the folders
* available, and has cookie information.
*
- * $Id$
+ * @version $Id$
* @package squirrelmail
*/
-/** Path for SquirrelMail required files. */
+/**
+ * Path for SquirrelMail required files.
+ * @ignore
+ */
define('SM_PATH','../');
/* SquirrelMail required files. */
@@ -49,10 +52,10 @@ function formatMailboxName($imapConnection, $box_array) {
$status = array('','');
if (($unseen_notify == 2 && $real_box == 'INBOX') ||
$unseen_notify == 3) {
- $tmp_status = create_unseen_string($real_box, $box_array, $imapConnection, $unseen_type );
- if ($status !== false) {
- $status = $tmp_status;
- }
+ $tmp_status = create_unseen_string($real_box, $box_array, $imapConnection, $unseen_type );
+ if ($status !== false) {
+ $status = $tmp_status;
+ }
}
list($unseen_string, $unseen) = $status;
$special_color = ($use_special_folder_color && isSpecialMailbox($real_box));
@@ -61,12 +64,12 @@ function formatMailboxName($imapConnection, $box_array) {
$line = '';
/* If there are unseen message, bold the line. */
- if ($unseen > 0) { $line .= ''; }
+ if ($unseen > 0) { $line .= ''; }
/* Create the link for this folder. */
if ($status !== false) {
- $line .= '';
+ $line .= '';
}
if ($special_color) {
$line .= "";
@@ -74,20 +77,20 @@ function formatMailboxName($imapConnection, $box_array) {
if ( $mailbox == 'INBOX' ) {
$line .= _("INBOX");
} else {
- $line .= str_replace(' ',' ',$mailbox);
+ $line .= str_replace(array(' ','<','>'),array(' ','<','>'),$mailbox);
}
if ($special_color == TRUE)
$line .= '';
if ($status !== false) {
- $line .= '';
+ $line .= '';
}
/* If there are unseen message, close bolding. */
- if ($unseen > 0) { $line .= ""; }
+ if ($unseen > 0) { $line .= ""; }
/* Print unseen information. */
if ($unseen_string != '') {
- $line .= " $unseen_string";
+ $line .= " $unseen_string";
}
/* If it's the trash folder, show a purge link when needed */
@@ -99,8 +102,8 @@ function formatMailboxName($imapConnection, $box_array) {
if (($numMessages > 0) or ($box_array['parent'] == 1)) {
$urlMailbox = urlencode($real_box);
$line .= "\n\n" .
- " ("._("purge").")" .
- "";
+ ' ['._("Purge").']' .
+ '';
}
}
@@ -178,13 +181,13 @@ function create_collapse_link($boxnum) {
'href="left_main.php?';
if ($boxes[$boxnum]['collapse'] == SM_BOX_COLLAPSED) {
if ($use_icons && $icon_theme != 'none') {
- $link .= "unfold=$mailbox\">";
+ $link .= "unfold=$mailbox\">';
} else {
$link .= "unfold=$mailbox\">+";
}
} else {
if ($use_icons && $icon_theme != 'none') {
- $link .= "fold=$mailbox\">";
+ $link .= "fold=$mailbox\">';
} else {
$link .= "fold=$mailbox\">-";
}
@@ -222,7 +225,7 @@ function create_unseen_string($boxName, $boxArray, $imapConnection, $unseen_type
$status = sqimap_status_messages($imapConnection, $boxName);
$boxUnseenCount = $status['UNSEEN'];
if ($boxUnseenCount === false) {
- return false;
+ return false;
}
if ($unseen_type == 2) {
$boxMessageCount = $status['MESSAGES'];
@@ -242,10 +245,10 @@ function create_unseen_string($boxName, $boxArray, $imapConnection, $unseen_type
/* Collect the counts for this subfolder. */
if (($boxName != $boxes[$i]['unformatted'])
- && (substr($boxes[$i]['unformatted'], 0, $curBoxLength) == $boxName)
- && !in_array('noselect', $boxes[$i]['flags'])) {
- $status = sqimap_status_messages($imapConnection, $boxes[$i]['unformatted']);
- $subUnseenCount = $status['UNSEEN'];
+ && (substr($boxes[$i]['unformatted'], 0, $curBoxLength) == $boxName)
+ && !in_array('noselect', $boxes[$i]['flags'])) {
+ $status = sqimap_status_messages($imapConnection, $boxes[$i]['unformatted']);
+ $subUnseenCount = $status['UNSEEN'];
if ($unseen_type == 2) {
$subMessageCount = $status['MESSAGES'];;
}
@@ -294,8 +297,8 @@ function is_parent_box($curbox_name, $parbox_name) {
function ListBoxes ($boxes, $j=0 ) {
global $data_dir, $username, $startmessage, $color, $unseen_notify, $unseen_type,
- $move_to_trash, $trash_folder, $collapse_folders, $imapConnection,
- $use_icons, $icon_theme;
+ $move_to_trash, $trash_folder, $collapse_folders, $imapConnection,
+ $use_icons, $icon_theme, $use_special_folder_color;
if (!isset($boxes) || empty($boxes))
return;
@@ -352,13 +355,13 @@ function ListBoxes ($boxes, $j=0 ) {
$link = '$leader ";
+ $link .= "unfold=$mailboxURL\">$leader ';
} else {
$link .= "unfold=$mailboxURL\">$leader+ ";
}
} else {
if ($use_icons && $icon_theme != 'none') {
- $link .= "fold=$mailboxURL\">$leader ";
+ $link .= "fold=$mailboxURL\">$leader ';
} else {
$link .= "fold=$mailboxURL\">$leader- ";
}
@@ -377,7 +380,7 @@ function ListBoxes ($boxes, $j=0 ) {
if ($unseen > 0) {
$pre .= '';
}
- $pre .= "";
+ $pre .= "";
if ($unseen > 0) {
$end .= '';
}
@@ -386,7 +389,7 @@ function ListBoxes ($boxes, $j=0 ) {
if ($unseen > 0) {
$pre .= '';
}
- $pre .= "";
+ $pre .= "";
if ($unseen > 0) {
$end .= '';
}
@@ -395,15 +398,15 @@ function ListBoxes ($boxes, $j=0 ) {
$end .= " $unseen_string";
}
$end .= "\n\n" .
- " ("._("purge").")" .
- "";
+ ' ['._("Purge").']'.
+ '';
}
} else {
if (!$boxes->is_noselect) {
if ($unseen > 0) {
$pre .= '';
}
- $pre .= "";
+ $pre .= "";
if ($unseen > 0) {
$end .= '';
}
@@ -418,20 +421,20 @@ function ListBoxes ($boxes, $j=0 ) {
$font = '';
$fontend = '';
- if ($boxes->is_special) {
+ if ($use_special_folder_color && $boxes->is_special) {
$font = "";
$fontend = "";
}
// let plugins fiddle with end of line
$end .= concat_hook_function('left_main_after_each_folder',
- array(isset($numMessages) ? $numMessages : '',
+ array(isset($numMessages) ? $numMessages : '',
$boxes->mailboxname_full, $imapConnection));
$end .= '';
if (!$boxes->is_root) {
- echo "" . $pre .$font. $boxes->mailboxname_sub .$fontend . $end. '
' . "\n";
+ echo "" . $pre .$font. str_replace(array(' ','<','>'),array(' ','<','>'),$boxes->mailboxname_sub) .$fontend . $end. '
' . "\n";
$j++;
}
@@ -444,7 +447,7 @@ function ListBoxes ($boxes, $j=0 ) {
function ListAdvancedBoxes ($boxes, $mbx, $j='ID.0000' ) {
global $data_dir, $username, $startmessage, $color, $unseen_notify, $unseen_type,
- $move_to_trash, $trash_folder, $collapse_folders;
+ $move_to_trash, $trash_folder, $collapse_folders, $use_special_folder_color;
if (!isset($boxes) || empty($boxes))
return;
@@ -499,7 +502,7 @@ function ListAdvancedBoxes ($boxes, $mbx, $j='ID.0000' ) {
if ($unseen > 0) { $pre .= ''; }
/* color special boxes */
- if ($boxes->is_special) {
+ if ($use_special_folder_color && $boxes->is_special) {
$pre .= "";
$end .= '';
}
@@ -516,17 +519,17 @@ function ListAdvancedBoxes ($boxes, $mbx, $j='ID.0000' ) {
if (! isset($numMessages)) {
$numMessages = $boxes->total;
}
- $pre = "" . $pre;
+ $pre = "" . $pre;
$end .= '';
if ($numMessages > 0) {
$urlMailbox = urlencode($mailbox);
$end .= "\n\n" .
- " ("._("purge").")" .
- "";
+ ' ['._("Purge").']'.
+ '';
}
} else {
if (!$boxes->is_noselect) { /* \Noselect boxes can't be selected */
- $pre = "" . $pre;
+ $pre = "" . $pre;
$end .= '';
}
}
@@ -534,7 +537,7 @@ function ListAdvancedBoxes ($boxes, $mbx, $j='ID.0000' ) {
// let plugins fiddle with end of line
global $imapConnection;
$end .= concat_hook_function('left_main_after_each_folder',
- array(isset($numMessages) ? $numMessages : '',
+ array(isset($numMessages) ? $numMessages : '',
$boxes->mailboxname_full, $imapConnection));
if (!$boxes->is_root) {
@@ -558,7 +561,7 @@ function ListAdvancedBoxes ($boxes, $mbx, $j='ID.0000' ) {
}
if (!isset($boxes->mbxs[0])) {
echo ' ' . html_tag( 'div',
- ''. $pre . $folder_img . ''. $boxes->mailboxname_sub . $end,
+ ''. $pre . $folder_img . ''. str_replace(array(' ','<','>'),array(' ','<','>'),$boxes->mailboxname_sub) . $end,
'left', '', 'class="mbx_sub" id="' .$j. '"' ) . "\n";
} else {
/* get collapse information */
@@ -660,7 +663,7 @@ if (! isset($oldway) || $oldway=="" ) {
if ($advanced_tree) {
$xtra .= <<
+