- added "High Contrast" theme submitted by Casey A. Peel <cpeel@localhost.localdomain>
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 14 Jul 2000 08:36:15 +0000 (08:36 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 14 Jul 2000 08:36:15 +0000 (08:36 +0000)
- fixed a few things in mime.txt
- added configurable message statuses on folder list

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@616 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
README
config/conf.pl
config/config_default.php
config/high_contrast_theme.php [new file with mode: 0644]
doc/mime.txt
functions/imap_general.php
src/left_main.php
src/load_prefs.php
src/options.php
src/options_folder.php

index 7f97f0853d9bdda7079734298962c72f1ca3a6c2..c00e389eb2d357b02d9bc6d9a0cd7724b8be2a97 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 Version 0.5pre1 -- DEVELOPMENT
 ------------------------------
+- Folder list now shows configurable details about messages
 - It is now possible to select multiple subscribes/unsubscribes
 - Removed a bunch of annoying "success" screens, improved navigation
 - Better IMAP session handling
diff --git a/README b/README
index c894b819ffdbc60312e0536f9d298de677c00b52..303c02c408f000d255b07ecafdda83fe7886fd4f 100644 (file)
--- a/README
+++ b/README
@@ -28,6 +28,11 @@ emails from people just telling us that they're using SquirrelMail.  If you
 have a few minutes, please send us an email to let us know!  You can send
 it to our mailing list:  squirrelmail-list@sourceforge.net
 
+You can also go to the page below and fill out a small form to get listed
+with the list of people already using SquirrelMail.
+
+   http://www.squirrelmail.org/index.php3?page=16
+
 Contact:
 --------
 It is pretty easy to get in contact with the developers if you need help or
index a05223e07c6e6585a7e75b84519f2a911d0385e1..a8648ff02a592f41fd50007a6a6f051197e0bb8a 100755 (executable)
@@ -111,6 +111,12 @@ if ($useSendmail ne "true") {
 if (!$sendmail_path) {
    $sendmail_path = "/usr/sbin/sendmail";
 }
+if (!$default_unseen_notify) {
+   $default_unseen_notify = 2;
+}
+if (!$default_unseen_type) {
+   $default_unseen_type = 1;
+}
 
 #####################################################################################
 
@@ -168,6 +174,8 @@ while (($command ne "q") && ($command ne "Q")) {
       print "9.  Auto Expunge               : $WHT$auto_expunge$NRM\n";
       print "10. Default Sub. of INBOX      : $WHT$default_sub_of_inbox$NRM\n";
       print "11. Show 'Contain Sub.' Option : $WHT$show_contain_subfolders_option$NRM\n";
+      print "12. Default Unseen Notify      : $WHT$default_unseen_notify$NRM\n";
+      print "13. Default Unseen Type        : $WHT$default_unseen_type$NRM\n";
       print "\n";
       print "R   Return to Main Menu\n";
    } elsif ($menu == 4) {
@@ -261,6 +269,8 @@ while (($command ne "q") && ($command ne "Q")) {
          elsif ($command == 9) { $auto_expunge                   = command29 (); }
          elsif ($command == 10){ $default_sub_of_inbox           = command210(); }
          elsif ($command == 11){ $show_contain_subfolders_option = command211(); }
+         elsif ($command == 12){ $default_unseen_notify          = command212(); }
+         elsif ($command == 13){ $default_unseen_type            = command213(); }
       } elsif ($menu == 4) {
          if    ($command == 1) { $default_charset    = command31 (); }
          elsif ($command == 2) { $data_dir           = command33 (); }
@@ -754,6 +764,43 @@ sub command211 {
    return $show_contain_subfolders_option;
 }
 
+# Default Unseen Notify 
+sub command212 {
+   print "This option specifies where the users will receive notification\n";
+   print "about unseen messages by default.  This is of course an option that\n";
+   print "can be changed on a user level.\n";
+   print "  1 = No notification\n";
+   print "  2 = Only on the INBOX\n";
+   print "  3 = On all folders\n";
+   print "\n";
+   
+   print "Which one should be default (1,2,3)? [$WHT$default_unseen_notify$NRM]: $WHT";
+   $new_show = <STDIN>;
+   if ($new_show =~ /^[1|2|3]\n/i) {
+      $default_unseen_notify = $new_show;
+   }
+   $default_unseen_notify =~ s/[\r|\n]//g;
+   return $default_unseen_notify;
+}
+
+# Default Unseen Type 
+sub command213 {
+   print "Here you can define the default way that unseen messages will be displayed\n";
+   print "to the user in the folder listing on the left side.\n";
+   print "  1 = Only unseen messages   (4)\n";
+   print "  2 = Unseen and Total messages  (4/27)\n";
+   print "\n";
+   
+   print "Which one should be default (1,2)? [$WHT$default_unseen_type$NRM]: $WHT";
+   $new_show = <STDIN>;
+   if ($new_show =~ /^[1|2]\n/i) {
+      $default_unseen_type = $new_show;
+   }
+   $default_unseen_type =~ s/[\r|\n]//g;
+   return $default_unseen_type;
+}
+
+
 ############# GENERAL OPTIONS #####################
 
 # Default Charset
@@ -1132,6 +1179,8 @@ sub save_data {
    print FILE "\t\$auto_expunge                     =  $auto_expunge;\n";
    print FILE "\t\$default_sub_of_inbox             =  $default_sub_of_inbox;\n";
    print FILE "\t\$show_contain_subfolders_option   =  $show_contain_subfolders_option;\n";
+   print FILE "\t\$default_unseen_notify            =  $default_unseen_notify;\n";
+   print FILE "\t\$default_unseen_type              =  $default_unseen_type;\n";
    print FILE "\n";
 
    print FILE "\t\$default_charset   = \"$default_charset\";\n";
index 2e6dc03f9bc184bc465f8cbfe1cf8d0231a799ff..719dfaba52c7cd84fa646ee08c684179f06a0e84 100644 (file)
     $theme[9]["PATH"] = "../config/bluesteel_theme.php";
     $theme[9]["NAME"] = "Blue Steel";
 
+    $theme[10]["PATH"] = "../config/high_contrast_theme.php";
+    $theme[10]["NAME"] = "High Contrast";
+
 //  LDAP server(s)
 //
 //    Array of arrays with LDAP server parameters. See
 
  $default_use_javascript_addr_book = false;
 
+ // these next two options set the defaults for the way that the users see
+ // their folder list.
+ //   $default_unseen_notify   specifies whether or not the users will see
+ //                            the number of unseen in each folder by default
+ //                            and alsy which folders to do this to.
+ //                            1=none, 2=inbox, 3=all
+ //   $default_unseen_type     specifies the type of notification to give the
+ //                            users by default.
+ //                            1=(4), 2=(4,25)
+
+ $default_unseen_notify = 2;
+ $default_unseen_type   = 1;
 ?>
diff --git a/config/high_contrast_theme.php b/config/high_contrast_theme.php
new file mode 100644 (file)
index 0000000..d0e7f80
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+   /** Author:       Casey A. Peel
+       Date:         July 13, 2000
+       Theme Name:   "High Contrast"
+
+    **/
+
+    $color[0]   = "#818181"; // (light gray)     TitleBar
+    $color[1]   = "#FF0000"; // (red)
+    $color[2]   = "#CC0000"; // (light red)      Warning/Error Messages
+    $color[3]   = "#008080"; // (green-blue)     Left Bar Background
+    $color[4]   = "#FFFFFF"; // (white)          Normal Background
+    $color[5]   = "#FFFF00"; // (light yellow)   Table Headers
+    $color[6]   = "#000000"; // (black)          Text on left bar
+    $color[7]   = "#0000FF"; // (blue)           Links
+    $color[8]   = "#000000"; // (black)          Normal text
+    $color[9]   = "#C0C0C0"; // (mid-gray)       Darker version of #0
+    $color[10]  = "#808080"; // (dark gray)      Darker version of #9
+    $color[11]  = "#FFFFFF"; // (white)          Special Folders color
+?>
index 1636119c88cd64c53e182984966ff17f744174ec..7c5d316a500ab8011309c2bbaf63da37747b06dd 100644 (file)
-mime.txt
-by Luke Ehresman
-June 22, 2000 - Last updated: June 22, 2000
+SquirrelMail MIME Support Introduction
+======================================
 
-Who should read this?
----------------------
-   The intended audience for this document are people who want to understand how
-   the MIME code works.  This is a technical documentation of how mime.php 
-   works and how it parses a MIME encoded message.
+The intended audience for this document are people who want to understand how
+the MIME code works.  This is a technical documentation of how mime.php 
+works and how it parses a MIME encoded message.
 
 
 Object Structure
 ----------------
-   There are two objects that are used: "message" and "msg_header".  here is a
-   brief overview of what each object contains.
+There are two objects that are used: "message" and "msg_header".  here is a
+brief overview of what each object contains.
 
-   msg_header
-      Contains variables for all the necessary parts of the header of a
-      message.  This includes (but is not limited to) the following:  to, from,
-      subject, type (type0), subtype (type1), filename ...
+msg_header
+   Contains variables for all the necessary parts of the header of a
+   message.  This includes (but is not limited to) the following:  to, from,
+   subject, type (type0), subtype (type1), filename ...
       
-   message
-      This contains the structure for the message.  It contains two parts:
-      $header and $entities[].  $header is of type msg_header, and $entities[]
-      is an array of type $message.  The $entities[] array is optional.  If
-      it does not exist, then we are at a leaf node, and have an actual
-      attachment (entity) that can be displayed.  Here is a tree view of how
-      this object functions.
-
-      header
-      entities
-         |
-         +--- header
-         |
-         +--- header
-         |    entities
-         |       |
-         |       +--- header
-         |       |
-         |       +--- header
-         |
-         +--- header
+message
+   This contains the structure for the message.  It contains two parts:
+   $header and $entities[].  $header is of type msg_header, and $entities[]
+   is an array of type $message.  The $entities[] array is optional.  If
+   it does not exist, then we are at a leaf node, and have an actual
+   attachment (entity) that can be displayed.  Here is a tree view of how
+   this object functions.
+
+   header
+   entities
+      |
+      +--- header
+      |
+      +--- header
+      |    entities
+      |       |
+      |       +--- header
+      |       |
+      |       +--- header
+      |
+      +--- header
 
 
 Getting the Structure
 ---------------------
-   Previously (version 0.4 and below), SquirrelMail handled all the parsing of
-   the email message.  It would read the entire message in, search for 
-   boundaries, and created an array similar to the $message object discribed
-   above.  This was very inefficient.
+Previously (version 0.4 and below), SquirrelMail handled all the parsing of
+the email message.  It would read the entire message in, search for 
+boundaries, and created an array similar to the $message object discribed
+above.  This was very inefficient.
 
-   Currently, all the parsing of the body of the message takes place on the
-   IMAP server itself.  According to RFC 2060 section 7.4.2, we can use the
-   BODYSTRUCTURE function which will return the structure of the body (imagine
-   that).  It goes into detail of how the bodystructure should be formatted,
-   and we have based our new MIME support on this specification.  
+Currently, all the parsing of the body of the message takes place on the
+IMAP server itself.  According to RFC 2060 section 7.4.2, we can use the
+BODYSTRUCTURE function which will return the structure of the body (imagine
+that).  It goes into detail of how the bodystructure should be formatted,
+and we have based our new MIME support on this specification.  
 
-   A simple text/plain message would have a BODYSTRUCTURE similar to the 
-   following:
+A simple text/plain message would have a BODYSTRUCTURE similar to the 
+following:
 
-      ("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL NIL "7BIT" 1152 23)
+   ("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL NIL "7BIT" 1152 23)
 
-   A more complicated multipart message with an attachment would look like:   
+A more complicated multipart message with an attachment would look like:   
 
-      (("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL NIL "7BIT" 1152 23)("TEXT" 
-      "PLAIN" ("CHARSET" "US-ASCII" "NAME" "cc.diff") 
-      "<960723163407.20117h@cac.washington.edu>" "Compiler diff" "BASE64" 
-      4554 73) "MIXED"))
+   (("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL NIL "7BIT" 1152 23)("TEXT" 
+   "PLAIN" ("CHARSET" "US-ASCII" "NAME" "cc.diff") 
+   "<960723163407.20117h@cac.washington.edu>" "Compiler diff" "BASE64" 
+   4554 73) "MIXED"))
    
-   Our MIME functionality implements different functions that recursively
-   run through this text and parses out the structure of the message.  If you
-   want to learn more about how the structure of a message is returned with
-   the BODYSTRUCTURE function, please see RFC 2060 section 7.4.2.
+Our MIME functionality implements different functions that recursively
+run through this text and parses out the structure of the message.  If you
+want to learn more about how the structure of a message is returned with
+the BODYSTRUCTURE function, please see RFC 2060 section 7.4.2.
 
-   NOTE:  SquirrelMail passes the MIME Torture Test written by Mark
-          Crispin (author of the IMAP protocol).  This message is crazy!  It
-          has about 30 parts nested inside each other.  A very good test, 
-          and SquirrelMail passed it.  It can be found here:
+NOTE:  SquirrelMail passes the MIME Torture Test written by Mark
+       Crispin (author of the IMAP protocol).  This message is crazy!  It
+       has about 30 parts nested inside each other.  A very good test, 
+       and SquirrelMail passed it.  It can be found here:
 
-          ftp://ftp.lysator.liu.se/mirror/unix/imapd/mime/torture-test.mbox
+       ftp://ftp.lysator.liu.se/mirror/unix/imapd/mime/torture-test.mbox
 
 Getting the Body
 ----------------
-   Once all of the structure of the message has been read into the $message
-   object, we then need to display the body of one entity.  There are a number
-   of ways we decide which entity to display at a certain time, and I won't go
-   into that here.  
+Once all of the structure of the message has been read into the $message
+object, we then need to display the body of one entity.  There are a number
+of ways we decide which entity to display at a certain time, and I won't go
+into that here.  
 
-   Each entity has its own ID.  Entity IDs look something like "1.2.1", or 
-   "4.1", or just "2".  You can find a detailed description of how entities
-   should be identified by reading RFC 2060 section 6.4.5.  To fetch the body
-   of a particular entity, we use the function "BODY[<section>]".  For 
-   instance, if we were wanting to return entity 1.2.1, we would send the
-   IMAP server the command: "a001 FETCH <msg_id> BODY[1.2.1]".
+Each entity has its own ID.  Entity IDs look something like "1.2.1", or 
+"4.1", or just "2".  You can find a detailed description of how entities
+should be identified by reading RFC 2060 section 6.4.5.  To fetch the body
+of a particular entity, we use the function "BODY[<section>]".  For 
+instance, if we were wanting to return entity 1.2.1, we would send the
+IMAP server the command: "a001 FETCH <msg_id> BODY[1.2.1]".
 
-   This returns a string of the entire body.  Based upon what is in the header,
-   we may need to decode it or do other things to it.
+This returns a string of the entire body.  Based upon what is in the header,
+we may need to decode it or do other things to it.
 
 
 Closing Notes  
 -------------
-   That is basically how it works.  There is a variable in mime.php called
-   $debug_mime that is defined at the top of that file.  If you set it to true,
-   it will output all kinds of valuable information while it tries to decode
-   the MIME message.
+That is basically how it works.  There is a variable in mime.php called
+$debug_mime that is defined at the top of that file.  If you set it to true,
+it will output all kinds of valuable information while it tries to decode
+the MIME message.
 
-   The code in mime.php is pretty well documented, so you might want to poke
-   around there as well to find out more details of how this works.
-   
-   If you have questions about this, please direct them to our mailing list:
-   squirrelmail-list@sourceforge.net
+The code in mime.php is pretty well documented, so you might want to poke
+around there as well to find out more details of how this works.
+
+If you have questions about this, please direct them to our mailing list:
+squirrelmail-list@sourceforge.net
index 133e9851b402dedd028ba781bb09a31898f4297d..81426acf3a18e996b0a56ddc96af0fdedf3f8eb3 100755 (executable)
    }
 
 
-   
    /******************************************************************************
     **  Returns the number of unseen messages in this folder 
     ******************************************************************************/
index d4224a3a059290157db7e1d39f8b6457ab8be47a..0e6ef6c7b09cc2d687a3b13629ae3002d08f7c0d 100644 (file)
    function formatMailboxName($imapConnection, $mailbox, $real_box, $delimeter, $unseen) {
                global $folder_prefix, $trash_folder, $sent_folder;
                global $color, $move_to_sent, $move_to_trash;
+      global $unseen_notify, $unseen_type;
 
       $mailboxURL = urlencode($real_box);
-               if($real_box=="INBOX") {
+
+      if ($unseen_notify == 2 && $real_box == "INBOX") {
+             $unseen = sqimap_unseen_messages($imapConnection, $numUnseen, $real_box);
+         if ($unseen_type == 1 && $unseen > 0) {
+            $unseen_string = "($unseen)";
+            $unseen_found = true;
+         } else if ($unseen_type == 2) {
+            $numMessages = sqimap_get_num_messages($imapConnection, $real_box);
+            $unseen_string = "<font color=\"$color[11]\">($unseen/$numMessages)</font>";
+            $unseen_found = true;
+         }
+      } else if ($unseen_notify == 3) {
              $unseen = sqimap_unseen_messages($imapConnection, $numUnseen, $real_box);
-               }
+         if ($unseen_type == 1 && $unseen > 0) {
+            $unseen_string = "($unseen)";
+            $unseen_found = true;
+         } else if ($unseen_type == 2) {
+            $numMessages = sqimap_get_num_messages($imapConnection, $real_box);
+            $unseen_string = "<font color=\"$color[11]\">($unseen/$numMessages)</font>";
+            $unseen_found = true;
+         }
+      }
 
       $line .= "<NOBR>";
       if ($unseen > 0)
       if ($unseen > 0)
          $line .= "</B>";
 
-      if ($unseen > 0) {
-         $line .= "&nbsp;<small>($unseen)</small>";
+      if ($unseen_found) {
+         $line .= "&nbsp;<small>$unseen_string</small>";
       }
 
       if (($move_to_trash == true) && ($real_box == $trash_folder)) {
          $urlMailbox = urlencode($real_box);
          $line .= "\n<small>\n";
-         $line .= "  &nbsp;&nbsp;&nbsp;&nbsp;(<B><A HREF=\"empty_trash.php\" style=\"text-decoration:none\">"._("purge")."</A></B>)";
+         $line .= "  &nbsp;&nbsp;(<B><A HREF=\"empty_trash.php\" style=\"text-decoration:none\">"._("purge")."</A></B>)";
          $line .= "\n</small>\n";
       }
       $line .= "</NOBR>";
index 6047a8154c828c1d4abb5d2cce4846bdbf6efdde..726dafb6cbb17716c9c13cb2ad387af8a23d429c 100644 (file)
       $move_to_trash = $default_move_to_trash;
 
 
+   $unseen_type = getPref($data_dir, $username, "unseen_type");
+   if ($default_unseen_type == "")
+      $default_unseen_type = 1;
+   if ($unseen_type == "")
+      $unseen_type = $default_unseen_type;
+
+   $unseen_notify = getPref($data_dir, $username, "unseen_notify");
+   if ($default_unseen_notify == "")
+      $default_unseen_notify = 2;
+   if ($unseen_notify == "")
+      $unseen_notify = $default_unseen_notify;
+
+
    $folder_prefix = getPref($data_dir, $username, "folder_prefix");
    if ($folder_prefix == "")
       $folder_prefix = $default_folder_prefix;
index c099cb8c4c52da81e54589883b5d0f3594177e7b..7e34591b214243fc5b0642ea549714c45be96ec1 100644 (file)
@@ -85,6 +85,8 @@
          setPref($data_dir, $username, "sent_folder", "");
       } 
       setPref($data_dir, $username, "folder_prefix", $folderprefix);
+      setPref($data_dir, $username, "unseen_notify", $unseennotify);
+      setPref($data_dir, $username, "unseen_type", $unseentype);
       echo "<br><center><b>"._("Successfully saved folder preferences!")."</b><br>";
       echo "<a href=\"left_main.php\" target=left>"._("Refresh Folders")."</a></center><br>";
    }
index 7beab5fa96f226e0ef04533ad011163d7338bd92..a6a035398366a3a04a98d65fe3eecda26548d592 100644 (file)
@@ -46,9 +46,9 @@
             <td align=right nowrap><? echo _("Folder Path"); ?>:
             </td><td>
 <? if (isset ($folder_prefix))
-      echo "         <input type=text name=folderprefix value=\"$folder_prefix\" size=50><br>";
+      echo "         <input type=text name=folderprefix value=\"$folder_prefix\" size=35><br>";
    else
-      echo "         <input type=text name=folderprefix value=\"$default_folder_prefix\" size=50><br>";
+      echo "         <input type=text name=folderprefix value=\"$default_folder_prefix\" size=35><br>";
 ?>
             </td>
          </tr>
       echo "</SELECT></TT>\n";
    echo "</td></tr>";  
 ?>
+         <tr>
+            <td valign=top align=right>
+               <br>
+               <? echo _("Unseen message notification"); ?>:
+            </td>
+            <td>
+               <input type=radio name=unseennotify value=1<? if ($unseen_notify == 1) echo " checked"; ?>> <? echo _("No notification") ?><br>
+               <input type=radio name=unseennotify value=2<? if ($unseen_notify != 1 && $unseen_notify != 3) echo " checked"; ?>> <? echo _("Only INBOX") ?><br>
+               <input type=radio name=unseennotify value=3<? if ($unseen_notify == 3) echo " checked"; ?>> <? echo _("All Folders") ?><br>
+               <br>
+            </td>
+         </tr>
+         <tr>
+            <td valign=top align=right>
+               <br>
+               <? echo _("Unseen message notification type"); ?>:
+            </td>
+            <td>
+               <input type=radio name=unseentype value=1<? if ($unseen_type < 2 || $unseen_type > 2) echo " checked"; ?>> <? echo _("Only unseen"); ?> - (4)<br> 
+               <input type=radio name=unseentype value=2<? if ($unseen_type == 2) echo " checked"; ?>> <? echo _("Unseen and Total"); ?> - (4/27)
+            </td>
+         </tr>
          <tr>
             <td>&nbsp;
             </td><td>