Corified Msg_Flags plugin, along with Jimmy's icon themes
[squirrelmail.git] / src / left_main.php
index dda2b3c7221c5a338e92c6eff79499ea21f225b1..fadc96c60bfdbf1585f23e27333a218d82410cc0 100644 (file)
@@ -101,12 +101,15 @@ function formatMailboxName($imapConnection, $box_array) {
             $line .= "\n<small>\n" .
                     "&nbsp;&nbsp;(<A HREF=\"empty_trash.php\" style=\"text-decoration:none\">"._("purge")."</A>)" .
                     "</small>";
-        } else {
-          $line .= concat_hook_function('left_main_after_each_folder',
-                 array(isset($numMessages) ? $numMessages : '',$real_box,$imapConnection));
         }
     }
 
+
+    // let plugins fiddle with end of line
+    $line .= concat_hook_function('left_main_after_each_folder',
+        array(isset($numMessages) ? $numMessages : '', $real_box, $imapConnection));
+
+
     /* Return the final product. */
     return ($line);
 }
@@ -167,23 +170,27 @@ function compute_folder_children(&$parbox, $boxcount) {
  * currently appropriate.
  */
 function create_collapse_link($boxnum) {
-    global $boxes, $imapConnection, $unseen_notify, $color;
+    global $boxes, $imapConnection, $unseen_notify, $color, $use_icons, $icon_theme;
     $mailbox = urlencode($boxes[$boxnum]['unformatted']);
 
     /* Create the link for this collapse link. */
     $link = '<a target="left" style="text-decoration:none" ' .
             'href="left_main.php?';
     if ($boxes[$boxnum]['collapse'] == SM_BOX_COLLAPSED) {
-        $link .= "unfold=$mailbox\">+";
+        if ($use_icons && $icon_theme != 'none') {
+            $link .= "unfold=$mailbox\"><IMG src=\"" . SM_PATH . "images/plus.png\" border=\"0\" height=\"7\" width=\"7\">";
+        } else {
+            $link .= "unfold=$mailbox\">+";
+        }
     } else {
-        $link .= "fold=$mailbox\">-";
+        if ($use_icons && $icon_theme != 'none') {
+            $link .= "fold=$mailbox\"><IMG src=\"" . SM_PATH . "images/minus.png\" border=\"0\" height=\"7\" width=\"7\">";
+        } else {
+            $link .= "fold=$mailbox\">-";
+        }
     }
     $link .= '</a>';
 
-    $hooklink = do_hook_function('create_collapse_link',$link);
-    if ($hooklink != '')
-        $link = $hooklink;
-
     /* Return the finished product. */
     return ($link);
 }
@@ -287,7 +294,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;
+           $move_to_trash, $trash_folder, $collapse_folders, $imapConnection, 
+           $use_icons, $icon_theme;
 
     if (!isset($boxes) || empty($boxes))
         return;
@@ -343,9 +351,17 @@ function ListBoxes ($boxes, $j=0 ) {
 
         $link = '<a target="left" style="text-decoration:none" ' .'href="left_main.php?';
         if ($collapse) {
-            $link .= "unfold=$mailboxURL\">$leader+&nbsp;</tt>";
+            if ($use_icons && $icon_theme != 'none') {
+                $link .= "unfold=$mailboxURL\">$leader<IMG src=\"" . SM_PATH . "images/plus.png\" border=\"0\" height=\"7\" width=\"7\">&nbsp;</tt>";
+            } else {
+                $link .= "unfold=$mailboxURL\">$leader+&nbsp;</tt>";
+            }
         } else {
-            $link .= "fold=$mailboxURL\">$leader-&nbsp;</tt>";
+            if ($use_icons && $icon_theme != 'none') {
+                $link .= "fold=$mailboxURL\">$leader<IMG src=\"" . SM_PATH . "images/minus.png\" border=\"0\" height=\"7\" width=\"7\">&nbsp;</tt>";
+            } else {
+                $link .= "fold=$mailboxURL\">$leader-&nbsp;</tt>";
+            }
         }
         $link .= '</a>';
         $pre .= $link;
@@ -406,6 +422,12 @@ function ListBoxes ($boxes, $j=0 ) {
         $font = "<font color=\"$color[11]\">";
         $fontend = "</font>";
     }
+
+    // let plugins fiddle with end of line
+    $end .= concat_hook_function('left_main_after_each_folder',
+        array(isset($numMessages) ? $numMessages : '', 
+              $boxes->mailboxname_full, $imapConnection));
+
     $end .= '</nobr>';
 
     if (!$boxes->is_root) {
@@ -509,6 +531,12 @@ 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 : '', 
+              $boxes->mailboxname_full, $imapConnection));
+
     if (!$boxes->is_root) {
         if ($use_folder_images) {
             if ($boxes->is_inbox) {