* 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 23d741048c29af88d67082f43f4fb086c52528ba..a3acfa8137beb7c5ccbb3249835107863019bbe7 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 d49be2d31abaaa839112e2a3eeca34a83faac41c..e7d879db70bcb3d6bf0e3c7fa2b65ccade14d0b8 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 2966c74ad2e89d95252827879990088bbaeaa132..cf284a2d1dedc47f0f97cc77219b3ffaa9a9eb83 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";