Corified Msg_Flags plugin, along with Jimmy's icon themes
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 24 Feb 2004 13:23:33 +0000 (13:23 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 24 Feb 2004 13:23:33 +0000 (13:23 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@6638 7612ce4b-ef26-0410-bec9-ea0150e637f0

41 files changed:
ChangeLog
config/conf.pl
config/config_default.php
doc/plugin.txt
functions/mailbox_display.php
images/themes/default/attach.gif [new file with mode: 0644]
images/themes/default/flagged.gif [new file with mode: 0644]
images/themes/default/index.php [new file with mode: 0644]
images/themes/default/msg_new.gif [new file with mode: 0644]
images/themes/default/msg_new_deleted.gif [new file with mode: 0644]
images/themes/default/msg_new_deleted_reply.gif [new file with mode: 0644]
images/themes/default/msg_new_reply.gif [new file with mode: 0644]
images/themes/default/msg_read.gif [new file with mode: 0644]
images/themes/default/msg_read_deleted.gif [new file with mode: 0644]
images/themes/default/msg_read_deleted_reply.gif [new file with mode: 0644]
images/themes/default/msg_read_reply.gif [new file with mode: 0644]
images/themes/default/prio_high.gif [new file with mode: 0644]
images/themes/default/prio_low.gif [new file with mode: 0644]
images/themes/default/theme.php [new file with mode: 0644]
images/themes/default/transparent.gif [new file with mode: 0644]
images/themes/index.php [new file with mode: 0644]
images/themes/none/index.php [new file with mode: 0644]
images/themes/none/theme.php [new file with mode: 0644]
images/themes/xp/attach.gif [new file with mode: 0644]
images/themes/xp/flagged.gif [new file with mode: 0644]
images/themes/xp/index.php [new file with mode: 0644]
images/themes/xp/msg_new.gif [new file with mode: 0644]
images/themes/xp/msg_new_deleted.gif [new file with mode: 0644]
images/themes/xp/msg_new_deleted_reply.gif [new file with mode: 0644]
images/themes/xp/msg_new_reply.gif [new file with mode: 0644]
images/themes/xp/msg_read.gif [new file with mode: 0644]
images/themes/xp/msg_read_deleted.gif [new file with mode: 0644]
images/themes/xp/msg_read_deleted_reply.gif [new file with mode: 0644]
images/themes/xp/msg_read_reply.gif [new file with mode: 0644]
images/themes/xp/prio_high.gif [new file with mode: 0644]
images/themes/xp/prio_low.gif [new file with mode: 0644]
images/themes/xp/theme.php [new file with mode: 0644]
images/themes/xp/transparent.gif [new file with mode: 0644]
include/load_prefs.php
include/options/display.php
src/left_main.php

index 8539e2f..d4f6b58 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,10 @@ Version 1.5.1 -- CVS
   - New reply citation to include date and author.
   - XSS fix.
   - Norwegian Bokmal translation uses nb_NO
+  - Integrated Msg_Flags plugin - turn on/off icons using configuration tool, menu 
+    number 11 (Tweaks), option number 3, after which users must select an icon 
+    theme in Options/Display Preferences.  "Flag"/"Unflag" buttons are implemented 
+    as separate plugin.
 
 
 Version 1.5.0
index c9ccec0..3798683 100755 (executable)
@@ -398,6 +398,10 @@ if (!$oldway ) {
        $oldway = 'false';
 }
 
+if (!$use_icons ) {
+       $use_icons = 'false';
+}
+
 if (!$use_php_recode ) {
        $use_php_recode = 'false';
 }
@@ -668,10 +672,11 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) ) {
        print $WHT. "Interface tweaks\n" . $NRM;
        print "1.  Advanced tree            : $WHT$advanced_tree$NRM\n";
        print "2.  Oldway                   : $WHT$oldway$NRM\n";
+       print "3.  Use Icons                : $WHT$use_icons$NRM\n";
        print "\n";
        print $WHT. "PHP tweaks\n" . $NRM;
-       print "3.  Use php recode functions : $WHT$use_php_recode$NRM\n";
-       print "4.  Use php iconv functions  : $WHT$use_php_iconv$NRM\n";
+       print "4.  Use php recode functions : $WHT$use_php_recode$NRM\n";
+       print "5.  Use php iconv functions  : $WHT$use_php_iconv$NRM\n";
        print "\n";
         print "R   Return to Main Menu\n";
     }
@@ -790,7 +795,7 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) ) {
             elsif ( $command == 10 ) { $allow_thread_sort        = command312(); }
             elsif ( $command == 11 ) { $allow_server_sort        = command313(); }
             elsif ( $command == 12 ) { $allow_charset_search     = command314(); }
-                       elsif ( $command == 13 ) { $session_name             = command316(); }
+            elsif ( $command == 13 ) { $session_name             = command316(); }
         } elsif ( $menu == 5 ) {
             if ( $command == 1 ) { command41(); }
             elsif ( $command == 2 ) { $theme_css = command42(); }
@@ -822,8 +827,9 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) ) {
         } elsif ( $menu == 11 ) {
             if    ( $command == 1 ) { $advanced_tree  = commandB1(); }
             elsif ( $command == 2 ) { $oldway                = commandB2(); }
-            elsif ( $command == 3 ) { $use_php_recode = commandB3(); }
-            elsif ( $command == 4 ) { $use_php_iconv  = commandB4(); }
+            elsif ( $command == 3 ) { $use_icons      = commandB3(); }
+            elsif ( $command == 4 ) { $use_php_recode = commandB4(); }
+            elsif ( $command == 5 ) { $use_php_iconv  = commandB5(); }
         }
     }
 }
@@ -2984,8 +2990,33 @@ sub commandB2 {
     }
     return $oldway;
 }
-# php recode
+# use icons
 sub commandB3 {
+    print "Enabling this option will cause icons to be used instead of text\n";
+    print "markers next to each message in mailbox lists that represent\n";
+    print "new, read, flagged, and deleted messages, as well as those that\n";
+    print "have been replied to and forwarded. Icons are also used next to\n";
+    print "(un)expanded folders in the folder list (Oldway = false).  These\n";
+    print "icons are quite small, but will obviously be more of a resource\n";
+    print "drain than text markers.\n";
+    print "\n";
+
+    if ( lc($use_icons) eq "true" ) {
+        $default_value = "y";
+    } else {
+        $default_value = "n";
+    }
+    print "Use icons? (y/n) [$WHT$default_value$NRM]: $WHT";
+    $use_icons = <STDIN>;
+    if ( ( $use_icons =~ /^y\n/i ) || ( ( $use_icons =~ /^\n/ ) && ( $default_value eq "y" ) ) ) {
+        $use_icons = "true";
+    } else {
+        $use_icons = "false";
+    }
+    return $use_icons;
+}
+# php recode
+sub commandB4 {
     print "Enable this option if you want to use php recode functions to read\n";
     print "emails written in charset that differs from the one that is set in\n";
     print "translation selected by user. Code is experimental, it might cause\n";
@@ -3008,7 +3039,7 @@ sub commandB3 {
     return $use_php_recode;
 }
 # php iconv
-sub commandB4 {
+sub commandB5 {
     print "Enable this option if you want to use php iconv functions to read\n";
     print "emails written in charset that differs from the one that is set in\n";
     print "translation selected by user. Code is experimental, it works only\n";
@@ -3278,18 +3309,20 @@ sub save_data {
        # boolean
         print CF "\$addrbook_global_listing = $addrbook_global_listing;\n\n";
        # boolean
-               print CF "\$no_list_for_subscribe = $no_list_for_subscribe;\n";
+        print CF "\$no_list_for_subscribe = $no_list_for_subscribe;\n";
 
        # string
-               print CF "\$smtp_auth_mech = '$smtp_auth_mech';\n";
-               print CF "\$imap_auth_mech = '$imap_auth_mech';\n";
+        print CF "\$smtp_auth_mech = '$smtp_auth_mech';\n";
+       # string
+        print CF "\$imap_auth_mech = '$imap_auth_mech';\n";
        # boolean
-           print CF "\$use_imap_tls = $use_imap_tls;\n";
-               print CF "\$use_smtp_tls = $use_smtp_tls;\n";
-
-               print CF "\$session_name = '$session_name';\n";
+        print CF "\$use_imap_tls = $use_imap_tls;\n";
+       # boolean
+        print CF "\$use_smtp_tls = $use_smtp_tls;\n";
+       # string
+        print CF "\$session_name = '$session_name';\n";
 
-           print CF "\n";
+       print CF "\n";
 
        # boolean
        print CF "\$advanced_tree = $advanced_tree;\n";
@@ -3298,6 +3331,9 @@ sub save_data {
        print CF "\$oldway = $oldway;\n";
        print CF "\n";
        # boolean
+       print CF "\$use_icons = $use_icons;\n";
+       print CF "\n";
+       # boolean
        print CF "\$use_php_recode = $use_php_recode;\n";
        print CF "\n";
        # boolean
index 581130c..bbe4389 100644 (file)
@@ -649,6 +649,10 @@ $advanced_tree = false;
  */
 $oldway = false;
 /**
+ * Use icons for message and folder markers
+ */
+$use_icons = false;
+/**
  * Use experimental code with php recode functions when reading messages with
  * different encoding. This code is faster that original SM functions,
  * but it require php with recode support.
@@ -695,4 +699,4 @@ $config_use_color = 2;
  * sent and regular output to begin, which will majorly screw
  * things up when we try to send more headers later.
  */
-?>
\ No newline at end of file
+?>
index 7a4783a..ecbfc0c 100644 (file)
@@ -240,7 +240,6 @@ but may be out of date soon thereafter.  You never know.  ;-)
   get_pref                       functions/file_prefs.php        hook_func
   special_mailbox                functions/imap_mailbox.php      hook_func
   % rename_or_delete_folder      functions/imap_mailbox.php      hook_func
-  msg_envelope                   functions/mailbox_display.php   do_hook
   mailbox_index_before           functions/mailbox_display.php   do_hook
   mailbox_form_before            functions/mailbox_display.php   do_hook
   mailbox_index_after            functions/mailbox_display.php   do_hook
@@ -268,7 +267,6 @@ but may be out of date soon thereafter.  You never know.  ;-)
   left_main_after_each_folder    src/left_main.php               concat_hook
   left_main_before               src/left_main.php               do_hook
   left_main_after                src/left_main.php               do_hook
-  create_collapse_link           src/left_main.php               hook_func
   login_cookie                   src/login.php                   do_hook
   login_top                      src/login.php                   do_hook
   login_form                     src/login.php                   do_hook
index b4b8b54..6e93c81 100644 (file)
@@ -58,7 +58,9 @@ function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox,
            $allow_server_sort,    /* enable/disable server-side sorting */
            $truncate_sender,      /* number of characters for From/To field (<= 0 for unchanged) */
            $email_address,
-           $show_recipient_instead;    /* show recipient name instead of default identity */
+           $show_recipient_instead,    /* show recipient name instead of default identity */
+           $use_icons,            /* indicates to use icons or text markers */
+           $icon_theme;           /* icons theming */
 
     $color_string = $color[4];
 
@@ -274,41 +276,102 @@ function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox,
                 echo html_tag( 'td', $td_str, 'left', $hlt_color );
                 break;
             case 5: /* flags */
-                $stuff = false;
-                $td_str = "<b><small>";
 
-                if (isset($msg['FLAG_ANSWERED']) && $msg['FLAG_ANSWERED'] == true) {
-                    $td_str .= _("A");
-                    $stuff = true;
-                }
-                if ($msg['TYPE0'] == 'multipart') {
-                    $td_str .= '+';
-                    $stuff = true;
+                // icon message markers
+                //
+                if ($use_icons && $icon_theme != 'none') {
+                    $td_str = "<b><small>";
+                    if (isset($msg['FLAG_FLAGGED']) && $msg['FLAG_FLAGGED'] == true) {
+                        $td_str .= _('<IMG SRC="' . SM_PATH . 'images/themes/' . $icon_theme . '/flagged.gif" border="0" height="10" width="10"> ');
+                    }
+                    if ($default_use_priority) {
+                        if ( ($msg['PRIORITY'] == 1) || ($msg['PRIORITY'] == 2) ) {
+                            $td_str .= '<IMG SRC="' . SM_PATH . 'images/themes/' . $icon_theme . '/prio_high.gif" border="0" height="10" width="5"> ';
+                        }
+                        else if ($msg['PRIORITY'] == 5) {
+                            $td_str .= '<IMG SRC="' . SM_PATH . 'images/themes/' . $icon_theme . '/prio_low.gif" border="0" height="10" width="5"> ';
+                        }
+                        else
+                        {
+                            $td_str .= '<IMG SRC="' . SM_PATH . 'images/themes/' . $icon_theme . '/transparent.gif" border="0" width="5"> ';
+                        }
+                    }
+                    if ($msg['TYPE0'] == 'multipart') {
+                        $td_str .= '<IMG SRC="' . SM_PATH . 'images/themes/' . $icon_theme . '/attach.gif" border="0" height="10" width="6">';
+                    }
+                    else
+                    {
+                        $td_str .= '<IMG SRC="' . SM_PATH . 'images/themes/' . $icon_theme . '/transparent.gif" border="0" width="6">';
+                    }
+
+                    $msg_icon = '';
+                    if (!isset($msg['FLAG_SEEN']) || ($msg['FLAG_SEEN']) == false)
+                    {
+                        $msg_alt = '(' . _("New") . ')';
+                        $msg_title = '(' . _("New") . ')';
+                        $msg_icon .= SM_PATH . 'images/themes/' . $icon_theme . '/msg_new';
+                    }
+                    else
+                    {
+                        $msg_alt = '(' . _("Read") . ')';
+                        $msg_title = '(' . _("Read") . ')';
+                        $msg_icon .= SM_PATH . 'images/themes/' . $icon_theme . '/msg_read';
+                    }
+                    if (isset($msg['FLAG_DELETED']) && ($msg['FLAG_DELETED']) == true)
+                    {
+                        $msg_icon .= '_deleted';
+                    }
+                    if (isset($msg['FLAG_ANSWERED']) && ($msg['FLAG_ANSWERED']) == true)
+                    {
+                        $msg_icon .= '_reply';
+                    }
+                    $td_str .= '<IMG SRC="' . $msg_icon . '.gif" border="0" alt="'. $msg_alt . '" title="' . $msg_title . '" height="12" width="18" >';
+                    $td_str .= '</small></b>';
+                    echo html_tag( 'td',
+                                   $td_str,
+                                   'right',
+                                   $hlt_color,
+                                   'nowrap' );
                 }
-                if ($default_use_priority) {
-                    if ( ($msg['PRIORITY'] == 1) || ($msg['PRIORITY'] == 2) ) {
-                        $td_str .= "<font color=\"$color[1]\">!</font>";
+
+
+                // plain text message markers
+                //
+                else {
+                    $stuff = false;
+                    $td_str = "<b><small>";
+                    if (isset($msg['FLAG_ANSWERED']) && $msg['FLAG_ANSWERED'] == true) {
+                        $td_str .= _("A");
                         $stuff = true;
                     }
-                    if ($msg['PRIORITY'] == 5) {
-                        $td_str .= "<font color=\"$color[8]\">?</font>";
+                    if ($msg['TYPE0'] == 'multipart') {
+                        $td_str .= '+';
                         $stuff = true;
                     }
+                    if ($default_use_priority) {
+                        if ( ($msg['PRIORITY'] == 1) || ($msg['PRIORITY'] == 2) ) {
+                            $td_str .= "<font color=\"$color[1]\">!</font>";
+                            $stuff = true;
+                        }
+                        if ($msg['PRIORITY'] == 5) {
+                            $td_str .= "<font color=\"$color[8]\">?</font>";
+                            $stuff = true;
+                        }
+                    }
+                    if (isset($msg['FLAG_DELETED']) && $msg['FLAG_DELETED'] == true) {
+                        $td_str .= "<font color=\"$color[1]\">D</font>";
+                        $stuff = true;
+                    }
+                    if (!$stuff) {
+                        $td_str .= '&nbsp;';
+                    }
+                    $td_str .= '</small></b>';
+                    echo html_tag( 'td',
+                                   $td_str,
+                                   'center',
+                                   $hlt_color,
+                                   'nowrap' );
                 }
-                if (isset($msg['FLAG_DELETED']) && $msg['FLAG_DELETED'] == true) {
-                    $td_str .= "<font color=\"$color[1]\">D</font>";
-                    $stuff = true;
-                }
-                if (!$stuff) {
-                    $td_str .= '&nbsp;';
-                }
-                do_hook("msg_envelope");
-                $td_str .= '</small></b>';
-                echo html_tag( 'td',
-                               $td_str,
-                               'center',
-                               $hlt_color,
-                               'nowrap' );
                 break;
             case 6: /* size */
                 echo html_tag( 'td',
diff --git a/images/themes/default/attach.gif b/images/themes/default/attach.gif
new file mode 100644 (file)
index 0000000..b2bc63b
Binary files /dev/null and b/images/themes/default/attach.gif differ
diff --git a/images/themes/default/flagged.gif b/images/themes/default/flagged.gif
new file mode 100644 (file)
index 0000000..8d595a1
Binary files /dev/null and b/images/themes/default/flagged.gif differ
diff --git a/images/themes/default/index.php b/images/themes/default/index.php
new file mode 100644 (file)
index 0000000..f86109e
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+header("Location:../../../index.php");
+?>
diff --git a/images/themes/default/msg_new.gif b/images/themes/default/msg_new.gif
new file mode 100644 (file)
index 0000000..e455c09
Binary files /dev/null and b/images/themes/default/msg_new.gif differ
diff --git a/images/themes/default/msg_new_deleted.gif b/images/themes/default/msg_new_deleted.gif
new file mode 100644 (file)
index 0000000..b30057b
Binary files /dev/null and b/images/themes/default/msg_new_deleted.gif differ
diff --git a/images/themes/default/msg_new_deleted_reply.gif b/images/themes/default/msg_new_deleted_reply.gif
new file mode 100644 (file)
index 0000000..e34818f
Binary files /dev/null and b/images/themes/default/msg_new_deleted_reply.gif differ
diff --git a/images/themes/default/msg_new_reply.gif b/images/themes/default/msg_new_reply.gif
new file mode 100644 (file)
index 0000000..359c9ab
Binary files /dev/null and b/images/themes/default/msg_new_reply.gif differ
diff --git a/images/themes/default/msg_read.gif b/images/themes/default/msg_read.gif
new file mode 100644 (file)
index 0000000..782ec65
Binary files /dev/null and b/images/themes/default/msg_read.gif differ
diff --git a/images/themes/default/msg_read_deleted.gif b/images/themes/default/msg_read_deleted.gif
new file mode 100644 (file)
index 0000000..d2f2bd9
Binary files /dev/null and b/images/themes/default/msg_read_deleted.gif differ
diff --git a/images/themes/default/msg_read_deleted_reply.gif b/images/themes/default/msg_read_deleted_reply.gif
new file mode 100644 (file)
index 0000000..6c37740
Binary files /dev/null and b/images/themes/default/msg_read_deleted_reply.gif differ
diff --git a/images/themes/default/msg_read_reply.gif b/images/themes/default/msg_read_reply.gif
new file mode 100644 (file)
index 0000000..f4d681d
Binary files /dev/null and b/images/themes/default/msg_read_reply.gif differ
diff --git a/images/themes/default/prio_high.gif b/images/themes/default/prio_high.gif
new file mode 100644 (file)
index 0000000..a62b701
Binary files /dev/null and b/images/themes/default/prio_high.gif differ
diff --git a/images/themes/default/prio_low.gif b/images/themes/default/prio_low.gif
new file mode 100644 (file)
index 0000000..fcee5cb
Binary files /dev/null and b/images/themes/default/prio_low.gif differ
diff --git a/images/themes/default/theme.php b/images/themes/default/theme.php
new file mode 100644 (file)
index 0000000..3596026
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+    $icon_themes[] = array('NAME'=>'Default','PATH'=> 'default');
+?>
diff --git a/images/themes/default/transparent.gif b/images/themes/default/transparent.gif
new file mode 100644 (file)
index 0000000..3a09af5
Binary files /dev/null and b/images/themes/default/transparent.gif differ
diff --git a/images/themes/index.php b/images/themes/index.php
new file mode 100644 (file)
index 0000000..9d9ed2c
--- /dev/null
@@ -0,0 +1,14 @@
+<?php
+/**
+ ** index.php
+ **
+ ** This file simply takes any attempt to view source files
+ ** and sends those people to the login screen. At this
+ ** point no attempt is made to see if the person is logged
+ ** or not.
+ **/
+
+header("Location:../index.php");
+
+/** pretty impressive huh? **/
+?>
diff --git a/images/themes/none/index.php b/images/themes/none/index.php
new file mode 100644 (file)
index 0000000..a9aa9d1
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * index.php -- Displays the main frameset
+ *
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Licensed under the GNU GPL. For full terms see the file COPYING.
+ *
+ * Redirects to the login page.
+ *
+ * $Id$
+ */
+
+header("Location: src/login.php\n\n");
+
+?>
+<html></html>
diff --git a/images/themes/none/theme.php b/images/themes/none/theme.php
new file mode 100644 (file)
index 0000000..5a0c1d9
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+    $icon_themes[] = array('NAME'=>'None','PATH'=> 'none');
+?>
diff --git a/images/themes/xp/attach.gif b/images/themes/xp/attach.gif
new file mode 100644 (file)
index 0000000..8153a60
Binary files /dev/null and b/images/themes/xp/attach.gif differ
diff --git a/images/themes/xp/flagged.gif b/images/themes/xp/flagged.gif
new file mode 100644 (file)
index 0000000..249e1d8
Binary files /dev/null and b/images/themes/xp/flagged.gif differ
diff --git a/images/themes/xp/index.php b/images/themes/xp/index.php
new file mode 100644 (file)
index 0000000..9d9ed2c
--- /dev/null
@@ -0,0 +1,14 @@
+<?php
+/**
+ ** index.php
+ **
+ ** This file simply takes any attempt to view source files
+ ** and sends those people to the login screen. At this
+ ** point no attempt is made to see if the person is logged
+ ** or not.
+ **/
+
+header("Location:../index.php");
+
+/** pretty impressive huh? **/
+?>
diff --git a/images/themes/xp/msg_new.gif b/images/themes/xp/msg_new.gif
new file mode 100644 (file)
index 0000000..63dd651
Binary files /dev/null and b/images/themes/xp/msg_new.gif differ
diff --git a/images/themes/xp/msg_new_deleted.gif b/images/themes/xp/msg_new_deleted.gif
new file mode 100644 (file)
index 0000000..6d59218
Binary files /dev/null and b/images/themes/xp/msg_new_deleted.gif differ
diff --git a/images/themes/xp/msg_new_deleted_reply.gif b/images/themes/xp/msg_new_deleted_reply.gif
new file mode 100644 (file)
index 0000000..0a89f98
Binary files /dev/null and b/images/themes/xp/msg_new_deleted_reply.gif differ
diff --git a/images/themes/xp/msg_new_reply.gif b/images/themes/xp/msg_new_reply.gif
new file mode 100644 (file)
index 0000000..c857f13
Binary files /dev/null and b/images/themes/xp/msg_new_reply.gif differ
diff --git a/images/themes/xp/msg_read.gif b/images/themes/xp/msg_read.gif
new file mode 100644 (file)
index 0000000..2014f9c
Binary files /dev/null and b/images/themes/xp/msg_read.gif differ
diff --git a/images/themes/xp/msg_read_deleted.gif b/images/themes/xp/msg_read_deleted.gif
new file mode 100644 (file)
index 0000000..be7d546
Binary files /dev/null and b/images/themes/xp/msg_read_deleted.gif differ
diff --git a/images/themes/xp/msg_read_deleted_reply.gif b/images/themes/xp/msg_read_deleted_reply.gif
new file mode 100644 (file)
index 0000000..10d49b0
Binary files /dev/null and b/images/themes/xp/msg_read_deleted_reply.gif differ
diff --git a/images/themes/xp/msg_read_reply.gif b/images/themes/xp/msg_read_reply.gif
new file mode 100644 (file)
index 0000000..d875a7d
Binary files /dev/null and b/images/themes/xp/msg_read_reply.gif differ
diff --git a/images/themes/xp/prio_high.gif b/images/themes/xp/prio_high.gif
new file mode 100644 (file)
index 0000000..2da0612
Binary files /dev/null and b/images/themes/xp/prio_high.gif differ
diff --git a/images/themes/xp/prio_low.gif b/images/themes/xp/prio_low.gif
new file mode 100644 (file)
index 0000000..420c066
Binary files /dev/null and b/images/themes/xp/prio_low.gif differ
diff --git a/images/themes/xp/theme.php b/images/themes/xp/theme.php
new file mode 100644 (file)
index 0000000..2999692
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+    $icon_themes[] = array('NAME'=>'XP','PATH'=> 'xp');
+?>
diff --git a/images/themes/xp/transparent.gif b/images/themes/xp/transparent.gif
new file mode 100644 (file)
index 0000000..35d42e8
Binary files /dev/null and b/images/themes/xp/transparent.gif differ
index eea76b3..c83436f 100644 (file)
@@ -77,6 +77,9 @@ if (!defined('download_php')) {
     sqsession_register($theme_css, 'theme_css'); 
 }
 
+// user's icon theme, if using icons
+$icon_theme = getPref($data_dir, $username, 'icon_theme', 'none' );
+
 $use_javascript_addr_book = getPref($data_dir, $username, 'use_javascript_addr_book', $default_use_javascript_addr_book);
 
 /* Load the user's special folder preferences */
index 9d9397f..ac209ce 100644 (file)
@@ -17,6 +17,20 @@ define('SMOPT_GRP_GENERAL', 0);
 define('SMOPT_GRP_MAILBOX', 1);
 define('SMOPT_GRP_MESSAGE', 2);
 
+// load icon themes if in use
+global $use_icons;
+if ($use_icons) {
+    global $icon_themes;
+    $dirName = SM_PATH . 'images/themes';
+    $d = dir($dirName);
+    while($dir = $d->read()) {
+        if ($dir != "." && $dir != "..") {
+            if (is_dir($dirName."/".$dir) && file_exists("$dirName/$dir/theme.php"))
+                include("$dirName/$dir/theme.php");
+        }
+    }
+}
+
 /**
  * This function builds an array with all the information about
  * the options available to the user, and returns it. The options
@@ -33,7 +47,7 @@ define('SMOPT_GRP_MESSAGE', 2);
 function load_optpage_data_display() {
     global $theme, $language, $languages, $js_autodetect_results,
     $compose_new_win, $default_use_mdn, $squirrelmail_language, $allow_thread_sort,
-    $optmode, $show_alternative_names, $available_languages;
+    $optmode, $show_alternative_names, $available_languages, $use_icons;
 
     /* Build a simple array into which we will build options. */
     $optgrps = array();
@@ -174,6 +188,26 @@ function load_optpage_data_display() {
         'refresh' => SMOPT_REFRESH_NONE
     );
 
+echo "use icons? $use_icons<br>";
+    if ($use_icons) {
+        global $icon_themes, $icon_theme;
+        $temp = array();
+        for ($count = 0; $count < sizeof($icon_themes); $count++) {
+            $temp[$count] = $icon_themes[$count]['NAME'];
+            if ($icon_theme == $icon_themes[$count]['PATH'])
+                $value = $count;
+        }
+        $optvals[SMOPT_GRP_MAILBOX][] = array(
+            'name'          => 'icon_theme',
+            'caption'       => _("Message Flags Icon Theme"),
+            'type'          => SMOPT_TYPE_STRLIST,
+            'refresh'       => SMOPT_REFRESH_NONE,
+            'posvals'       => $temp,
+            'initial_value' => $value,
+            'save'          => 'icon_theme_save'
+        );
+    }
+
     $optvals[SMOPT_GRP_MAILBOX][] = array(
         'name'    => 'page_selector',
         'caption' => _("Enable Page Selector"),
@@ -450,4 +484,22 @@ function save_option_javascript_autodetect($option) {
     }
 }
 
+/** 
+ * This function saves the user's icon theme setting
+ */
+function icon_theme_save($option) {
+
+    global $icon_themes, $data_dir, $username;
+
+
+    // Don't assume the new value is there, double check 
+    // and only save if found 
+    //
+    if (isset($icon_themes[$option->new_value]['PATH']))
+        setPref($data_dir, $username, 'icon_theme', $icon_themes[$option->new_value]['PATH']);
+    else
+       setPref($data_dir, $username, 'icon_theme', 'none');
+
+}
+
 ?>
index 29a689f..fadc96c 100644 (file)
@@ -170,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);
 }
@@ -290,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;
@@ -346,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;