* Cleaned up some code
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 6 Feb 2001 20:39:09 +0000 (20:39 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 6 Feb 2001 20:39:09 +0000 (20:39 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1065 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/folders.php
src/folders_delete.php
src/left_main.php

index 23d7410..a3acfa8 100644 (file)
    }
 
    for ($i = 0; $i < count($boxes); $i++) {
-      if (count($boxes[$i]["flags"]) > 0) {
-         $noinf = false;
-         for ($j = 0; $j < count($boxes[$i]["flags"]); $j++) {
-            if ($boxes[$i]["flags"][$j] == "noinferiors") {
-               $noinf = true;
-               continue;
-            }
-         }    
-         if ($noinf == false) {
-            if ((strtolower($boxes[$i]["unformatted"]) == "inbox") && ($default_sub_of_inbox == true)) {
-               $box = $boxes[$i]["unformatted"];
-               $box2 = replace_spaces($boxes[$i]["unformatted-disp"]);
-               echo "<OPTION SELECTED VALUE=\"$box\">$box2\n";
-            } else {
-               $box = $boxes[$i]["unformatted"];
-               $box2 = replace_spaces($boxes[$i]["unformatted-disp"]);
-               if (strtolower($imap_server_type) != "courier" ||
-                  strtolower($box) != "inbox.trash")
-                echo "<OPTION VALUE=\"$box\">$box2\n";
-            }
-         }
-      } else {
+      if (!in_array('noinferiors', $boxes[$i]['flags'])) {
          if ((strtolower($boxes[$i]["unformatted"]) == "inbox") && ($default_sub_of_inbox == true)) {
             $box = $boxes[$i]["unformatted"];
             $box2 = replace_spaces($boxes[$i]["unformatted-disp"]);
index d49be2d..e7d879d 100644 (file)
    else {
       for ($i = 0; $i < count($boxes); $i++) {
          if ($boxes[$i]["unformatted"] == $trash_folder) {
-            $can_move_to_trash = true;
-            for ($j = 0; $j < count($boxes[$i]["flags"]); $j++) {
-               if (strtolower($boxes[$i]["flags"][$j]) == "noinferiors")
-                 $can_move_to_trash = false;
-            }
+            $can_move_to_trash = !in_array('noinferiors', $boxes[$i]['flags']);
          }
       }
    }
index 2966c74..cf284a2 100644 (file)
       $line = "";
       $mailbox = $boxes[$i]["formatted"];
       
-      if (count($boxes[$i]["flags"])) {
-         $noselect = false;
-         for ($h = 0; $h < count($boxes[$i]["flags"]); $h++) {
-            if (strtolower($boxes[$i]["flags"][$h]) == "noselect")
-               $noselect = true;
-         }
-         if ($noselect == true) {
-            $line .= "<FONT COLOR=\"$color[10]\">";
-            $line .= replace_spaces($mailbox);
-            $line .= "</FONT>";
-         } else {
-           if (! isset($boxes[$i]["unseen"])) 
-               $boxes[$i]["unseen"] = 0;
-            $line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["unformatted"], $delimeter, $boxes[$i]["unseen"]);
-         }
+      if (in_array('noselect', $boxes[$i]['flags']) {
+         $line .= "<FONT COLOR=\"$color[10]\">";
+         $line .= replace_spaces($mailbox);
+         $line .= '</FONT>';
       } else {
-        if (!isset($boxes[$i]["unseen"])) 
-            $boxes[$i]["unseen"] = "";
+        if (! isset($boxes[$i]['unseen'])) 
+           $boxes[$i]['unseen'] = '';
          $line .= formatMailboxName($imapConnection, $mailbox, $boxes[$i]["unformatted"], $delimeter, $boxes[$i]["unseen"]);
       }
       echo "$line<BR>\n";