From 6395c46db0a732860324fa43886b6ca806ad2588 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Tue, 24 Feb 2004 13:23:33 +0000 Subject: [PATCH] Corified Msg_Flags plugin, along with Jimmy's icon themes git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@6638 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 4 + config/conf.pl | 66 +++++++--- config/config_default.php | 6 +- doc/plugin.txt | 2 - functions/mailbox_display.php | 121 +++++++++++++----- images/themes/default/attach.gif | Bin 0 -> 63 bytes images/themes/default/flagged.gif | Bin 0 -> 116 bytes images/themes/default/index.php | 3 + images/themes/default/msg_new.gif | Bin 0 -> 123 bytes images/themes/default/msg_new_deleted.gif | Bin 0 -> 170 bytes .../themes/default/msg_new_deleted_reply.gif | Bin 0 -> 187 bytes images/themes/default/msg_new_reply.gif | Bin 0 -> 139 bytes images/themes/default/msg_read.gif | Bin 0 -> 113 bytes images/themes/default/msg_read_deleted.gif | Bin 0 -> 123 bytes .../themes/default/msg_read_deleted_reply.gif | Bin 0 -> 143 bytes images/themes/default/msg_read_reply.gif | Bin 0 -> 132 bytes images/themes/default/prio_high.gif | Bin 0 -> 62 bytes images/themes/default/prio_low.gif | Bin 0 -> 60 bytes images/themes/default/theme.php | 3 + images/themes/default/transparent.gif | Bin 0 -> 807 bytes images/themes/index.php | 14 ++ images/themes/none/index.php | 17 +++ images/themes/none/theme.php | 3 + images/themes/xp/attach.gif | Bin 0 -> 282 bytes images/themes/xp/flagged.gif | Bin 0 -> 293 bytes images/themes/xp/index.php | 14 ++ images/themes/xp/msg_new.gif | Bin 0 -> 580 bytes images/themes/xp/msg_new_deleted.gif | Bin 0 -> 582 bytes images/themes/xp/msg_new_deleted_reply.gif | Bin 0 -> 591 bytes images/themes/xp/msg_new_reply.gif | Bin 0 -> 587 bytes images/themes/xp/msg_read.gif | Bin 0 -> 581 bytes images/themes/xp/msg_read_deleted.gif | Bin 0 -> 585 bytes images/themes/xp/msg_read_deleted_reply.gif | Bin 0 -> 590 bytes images/themes/xp/msg_read_reply.gif | Bin 0 -> 587 bytes images/themes/xp/prio_high.gif | Bin 0 -> 268 bytes images/themes/xp/prio_low.gif | Bin 0 -> 60 bytes images/themes/xp/theme.php | 3 + images/themes/xp/transparent.gif | Bin 0 -> 43 bytes include/load_prefs.php | 3 + include/options/display.php | 54 +++++++- src/left_main.php | 33 +++-- 41 files changed, 288 insertions(+), 58 deletions(-) create mode 100644 images/themes/default/attach.gif create mode 100644 images/themes/default/flagged.gif create mode 100644 images/themes/default/index.php create mode 100644 images/themes/default/msg_new.gif create mode 100644 images/themes/default/msg_new_deleted.gif create mode 100644 images/themes/default/msg_new_deleted_reply.gif create mode 100644 images/themes/default/msg_new_reply.gif create mode 100644 images/themes/default/msg_read.gif create mode 100644 images/themes/default/msg_read_deleted.gif create mode 100644 images/themes/default/msg_read_deleted_reply.gif create mode 100644 images/themes/default/msg_read_reply.gif create mode 100644 images/themes/default/prio_high.gif create mode 100644 images/themes/default/prio_low.gif create mode 100644 images/themes/default/theme.php create mode 100644 images/themes/default/transparent.gif create mode 100644 images/themes/index.php create mode 100644 images/themes/none/index.php create mode 100644 images/themes/none/theme.php create mode 100644 images/themes/xp/attach.gif create mode 100644 images/themes/xp/flagged.gif create mode 100644 images/themes/xp/index.php create mode 100644 images/themes/xp/msg_new.gif create mode 100644 images/themes/xp/msg_new_deleted.gif create mode 100644 images/themes/xp/msg_new_deleted_reply.gif create mode 100644 images/themes/xp/msg_new_reply.gif create mode 100644 images/themes/xp/msg_read.gif create mode 100644 images/themes/xp/msg_read_deleted.gif create mode 100644 images/themes/xp/msg_read_deleted_reply.gif create mode 100644 images/themes/xp/msg_read_reply.gif create mode 100644 images/themes/xp/prio_high.gif create mode 100644 images/themes/xp/prio_low.gif create mode 100644 images/themes/xp/theme.php create mode 100644 images/themes/xp/transparent.gif diff --git a/ChangeLog b/ChangeLog index 8539e2f6..d4f6b589 100644 --- 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 diff --git a/config/conf.pl b/config/conf.pl index c9ccec0d..3798683b 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -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 = ; + 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 diff --git a/config/config_default.php b/config/config_default.php index 581130c1..bbe4389b 100644 --- a/config/config_default.php +++ b/config/config_default.php @@ -648,6 +648,10 @@ $advanced_tree = false; * Use older way of folder listing */ $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, @@ -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 +?> diff --git a/doc/plugin.txt b/doc/plugin.txt index 7a4783ad..ecbfc0c7 100644 --- a/doc/plugin.txt +++ b/doc/plugin.txt @@ -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 diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index b4b8b546..6e93c81e 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -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 = ""; - 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 = ""; + if (isset($msg['FLAG_FLAGGED']) && $msg['FLAG_FLAGGED'] == true) { + $td_str .= _(' '); + } + if ($default_use_priority) { + if ( ($msg['PRIORITY'] == 1) || ($msg['PRIORITY'] == 2) ) { + $td_str .= ' '; + } + else if ($msg['PRIORITY'] == 5) { + $td_str .= ' '; + } + else + { + $td_str .= ' '; + } + } + if ($msg['TYPE0'] == 'multipart') { + $td_str .= ''; + } + else + { + $td_str .= ''; + } + + $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 .= ''. $msg_alt . ''; + $td_str .= ''; + echo html_tag( 'td', + $td_str, + 'right', + $hlt_color, + 'nowrap' ); } - if ($default_use_priority) { - if ( ($msg['PRIORITY'] == 1) || ($msg['PRIORITY'] == 2) ) { - $td_str .= "!"; + + + // plain text message markers + // + else { + $stuff = false; + $td_str = ""; + if (isset($msg['FLAG_ANSWERED']) && $msg['FLAG_ANSWERED'] == true) { + $td_str .= _("A"); $stuff = true; } - if ($msg['PRIORITY'] == 5) { - $td_str .= "?"; + if ($msg['TYPE0'] == 'multipart') { + $td_str .= '+'; $stuff = true; } + if ($default_use_priority) { + if ( ($msg['PRIORITY'] == 1) || ($msg['PRIORITY'] == 2) ) { + $td_str .= "!"; + $stuff = true; + } + if ($msg['PRIORITY'] == 5) { + $td_str .= "?"; + $stuff = true; + } + } + if (isset($msg['FLAG_DELETED']) && $msg['FLAG_DELETED'] == true) { + $td_str .= "D"; + $stuff = true; + } + if (!$stuff) { + $td_str .= ' '; + } + $td_str .= ''; + echo html_tag( 'td', + $td_str, + 'center', + $hlt_color, + 'nowrap' ); } - if (isset($msg['FLAG_DELETED']) && $msg['FLAG_DELETED'] == true) { - $td_str .= "D"; - $stuff = true; - } - if (!$stuff) { - $td_str .= ' '; - } - do_hook("msg_envelope"); - $td_str .= ''; - 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 index 0000000000000000000000000000000000000000..b2bc63b8edfa41376c6e0f917c7ac57390706a65 GIT binary patch literal 63 zcmZ?wbhEHbWMklFn8*ME|G@yrQ2fcl$iTqFpaT*G$ulqsOle>%TU&XdE5J|E`0&jx HCI)K&4#N== literal 0 HcmV?d00001 diff --git a/images/themes/default/flagged.gif b/images/themes/default/flagged.gif new file mode 100644 index 0000000000000000000000000000000000000000..8d595a181cdf695f59783e08ab3fbe0029ef725a GIT binary patch literal 116 zcmZ?wbhEHb diff --git a/images/themes/default/msg_new.gif b/images/themes/default/msg_new.gif new file mode 100644 index 0000000000000000000000000000000000000000..e455c09b6e463ae581a3f477c7711d6c87d20976 GIT binary patch literal 123 zcmZ?wbhEHb6k_0JSi}GV|3QGErG??xv12VQEg%j9gW^vXMg|5p1|5(JkXi<2hm5d0 z_Z(IVHLVci7D#1`;^4XK!Vo^SZ~hjJ^sru+*P%cRpyk$m4eLsey)3_%)4Z0WCuN0+=60SURviG??YXxYKbP3&X})%I|)JDlsuw F0{|8oIV=DG literal 0 HcmV?d00001 diff --git a/images/themes/default/msg_new_deleted_reply.gif b/images/themes/default/msg_new_deleted_reply.gif new file mode 100644 index 0000000000000000000000000000000000000000..e34818f5a6b87f3b5cbb6b3a88f810cd8a68f9bc GIT binary patch literal 187 zcmZ?wbhEHb6k_0G*vtR||NsAQVQM~m=Io(k=Ng(g{{Le+|z`(U#7_M}zIINkmPDo9HV&MIY6? dtA19=2jg|m#rqXYN<_!_vRAc~$qO=A0|5O0J)Zyo literal 0 HcmV?d00001 diff --git a/images/themes/default/msg_new_reply.gif b/images/themes/default/msg_new_reply.gif new file mode 100644 index 0000000000000000000000000000000000000000..359c9ab859479cf5460e9f11a2e12f754cb0e7c6 GIT binary patch literal 139 zcmZ?wbhEHb6k_0ISi}GV|NsAQVQBgPpP{9N;n=ZbEiFLyf5o3Hj0_Cy3_2hcAhit4 z0Tt=eVzgC nCnV=LJ#lh3b?9Y%dFJO8Ps;=b!PliTJCClqxiwWrh`|~FbGkHY literal 0 HcmV?d00001 diff --git a/images/themes/default/msg_read.gif b/images/themes/default/msg_read.gif new file mode 100644 index 0000000000000000000000000000000000000000..782ec6505243570b0499cd1573589e7f32c3aa30 GIT binary patch literal 113 zcmZ?wbhEHb6k_0ESi}GV|Ns9#cI;S7OAC+z761{7KUo+V7+4r|Kpc=-24*vlU6=P7 z^eJR81m21&R1@AF8)?xcm)v!Af>!XGBPu4Wnp0W%j9Sh|A8E<+1)G* F)&Q@5B}o7P literal 0 HcmV?d00001 diff --git a/images/themes/default/msg_read_deleted.gif b/images/themes/default/msg_read_deleted.gif new file mode 100644 index 0000000000000000000000000000000000000000..d2f2bd904692ebe5a495fa934ef5c24d4bf5b527 GIT binary patch literal 123 zcmZ?wbhEHb6k_0ISi}GV|AByk;n=ZbEiElzCP+~6CkrD311p0Lhyzl~!0ZsAboH#> zKGV*vm)4p(y>~FHjg$16?Jz0*=}J{=(If2Z)m@IfQgGiLl%SDgS|+O`sIpRXKC|*$ Qr7Zs=^Az`$S)0G>}Nj{pDw literal 0 HcmV?d00001 diff --git a/images/themes/default/msg_read_deleted_reply.gif b/images/themes/default/msg_read_deleted_reply.gif new file mode 100644 index 0000000000000000000000000000000000000000..6c377409070463d8d200be30844e3226aece2b5b GIT binary patch literal 143 zcmZ?wbhEHb6k_0KSi}GV|NsAQVQBf!z;Nu?v6hw=AQvd8_>+Z^fq{)d2c!a|mVr4W z!}!`+y?v(LTQ9A3b$ah$RvRbjb=zT5`qP!F){;ld@6Na+lIknaG=G7@!^)bbgh>() qOS4YC*l>eWWQix!<-{#ai}&X;JFqDdDqg#=Y!5RQ?ur~ex literal 0 HcmV?d00001 diff --git a/images/themes/default/msg_read_reply.gif b/images/themes/default/msg_read_reply.gif new file mode 100644 index 0000000000000000000000000000000000000000..f4d681dcf02a5f077a0cf3f5299dc1e1fab59928 GIT binary patch literal 132 zcmZ?wbhEHb6k_0GSi}GV|NsAQVQ4va>{v@n3y=*KV^I9b!pOkD%Af<{g48lFdq(WK zve#geK?XzMt*Amh;q9@J7F}}5R&Nfo1RI}W@^ujAxx7{3&U%@|2ipG%EN5IaXV98t c{rF5IL&RF=q}*SX=Q`q7EqNNC!oXk+03*OI`Tzg` literal 0 HcmV?d00001 diff --git a/images/themes/default/prio_high.gif b/images/themes/default/prio_high.gif new file mode 100644 index 0000000000000000000000000000000000000000..a62b7012b95b4e5b35a205cac404f59e696e2e93 GIT binary patch literal 62 zcmZ?wbhEHbWMklFn8*ME|A7EZD*j|)WME)s&;f~p>@G G7_0#?2orb! literal 0 HcmV?d00001 diff --git a/images/themes/default/prio_low.gif b/images/themes/default/prio_low.gif new file mode 100644 index 0000000000000000000000000000000000000000..fcee5cba2c5f1315a01e042ac56a1327b30b6e8d GIT binary patch literal 60 zcmZ?wbhEHbWMklBn8*ME|Ns976aN)|vM@3*Ff-_YL_zWlOuTneIxFw&nbN%|EICn& G!5RPtU=hjy literal 0 HcmV?d00001 diff --git a/images/themes/default/theme.php b/images/themes/default/theme.php new file mode 100644 index 00000000..35960263 --- /dev/null +++ b/images/themes/default/theme.php @@ -0,0 +1,3 @@ +'Default','PATH'=> 'default'); +?> diff --git a/images/themes/default/transparent.gif b/images/themes/default/transparent.gif new file mode 100644 index 0000000000000000000000000000000000000000..3a09af5168b2e51342e9dbc9cc5305541374152d GIT binary patch literal 807 xcmZ?wbhEHbWMp7u_|Cxae-w;{zz7Zj#h)yU3_zd*B0zb9frEvCk%fi98UR diff --git a/images/themes/none/index.php b/images/themes/none/index.php new file mode 100644 index 00000000..a9aa9d18 --- /dev/null +++ b/images/themes/none/index.php @@ -0,0 +1,17 @@ + + diff --git a/images/themes/none/theme.php b/images/themes/none/theme.php new file mode 100644 index 00000000..5a0c1d9a --- /dev/null +++ b/images/themes/none/theme.php @@ -0,0 +1,3 @@ +'None','PATH'=> 'none'); +?> diff --git a/images/themes/xp/attach.gif b/images/themes/xp/attach.gif new file mode 100644 index 0000000000000000000000000000000000000000..8153a60c4ac738dd4f8f10fc4455ab213694dcdf GIT binary patch literal 282 zcmZ?wbhEHbWMklBxN5-=kXW%`#kQQfDWxqlR&3aH?$V9B51u3zv~1mb%qzP1>$mTd z=dC?^`PTAvJ2T6Ab{{;IT+*3YHR;a7Cne2OzJ32u+&H`pFh4oxn6M%>TleBaNyXvX^XZ@Td-#R_QOd9 zO#ulNTlXAawtml(XRjVTeNomlv1Q_-^s=to_Z|nORG+(a^W?e93^;(|PZmZ71`7rq zkUYpw3~c5ObDE}H+M}_B_1uQY-Wc5oosyuFKGP&$G@h(cV2oZ`&?%rYZ??yU%qbF_ TBF7sgHWW-|UeLzP#9$2o`c8&B literal 0 HcmV?d00001 diff --git a/images/themes/xp/flagged.gif b/images/themes/xp/flagged.gif new file mode 100644 index 0000000000000000000000000000000000000000..249e1d8faf79cc790c4a4a6e03e5429da848f483 GIT binary patch literal 293 zcmZ?wbhEHb&7n+ZqHbHV4bVF zXY7PEe#Y-Ud@18&`SkRmTX@^20K*qoFMSI(SsQE-=2P&&gyX%B?nY~qWp*+-ER6fD zW#;7}rk`htJ$$zy=h5vM@3*STg8< zBtd>+U~@X)pvpe0#As*AiqKms0joNA+a7m#tiQ2fW6%?^mCW4<3_B(nU+(-iv1gK} dyJJJ+;Z*T9*|_SAZv_Gz4W1(Aa%GMT)&PeqbG-ln literal 0 HcmV?d00001 diff --git a/images/themes/xp/index.php b/images/themes/xp/index.php new file mode 100644 index 00000000..9d9ed2ca --- /dev/null +++ b/images/themes/xp/index.php @@ -0,0 +1,14 @@ + diff --git a/images/themes/xp/msg_new.gif b/images/themes/xp/msg_new.gif new file mode 100644 index 0000000000000000000000000000000000000000..63dd651fbfe0e6f0b3b9e0b353759032e6092e14 GIT binary patch literal 580 zcmV-K0=xZ3Nk%w1VG;lg0Oo%H|Nq$k_niLiiU0rE|Mi*G#gf*=lmGUb^UiJm{?>9? zF>zZk|M#2z?TG*GjsO4K|L%<9zGqoUGV$iH_T`k`wOLMy_r7$`@HYh zcFvqN_~(fF>50z1kJ7@B&c2TQ^Opbr*Y?|R_1tm#;&<7tOJPzrx~hWy@Ra}ht>eCA z>dI|$V@G#sOuLUX`Q(}O*nI!~&;R_x|NYYP*?Ir_w#J}Id~H$x>xIFwhWPHd`{sFb zTQKR)ZS>=dWKuKp%WUw|L1uB?}_=~ zefQ*q^xu5XxO(QlWAVywhiNVH-k83vfAr&&|M{@j#*?_If&c&iA^8LW004ggEC2ui z01^NU000M}fPaF6goTEGeTfA_L>^~e8%%zFg?%Lt0|Nk?MlF1MT!jXCUspX^P8tkF zKpj$r7%UNE0ks4oCtFW5g+f*o6(0vpFF_`12vLPMST;}>Ss-&9DRgCTg(?#;U`R?o zQ({Lvc5a1wb!j_sYe{fjD?Tzhg?=<6F%A$70{wDqOX?+{f~JZK1ZM7p$dCa=y*4%Q SC}4o&#~?^U>HJ=}M?OogQ|JU08UuXXRx$4m7 zj+f_h|Np=K`(=B1n%9H9AzvP~o!ZrXZeQQWXB+;$pY-W`@vBq0|9@}$e5w53hbdRL zrvCqPV%Mssy)*63%`xpNv^=)J^Z(BcE85+%!wf&1%HQ2@^8HE6|K}C|-}ipK)As-C zgxnaXzn`YnB{) z|JSWQo_92-==^$Aet%cWyCaET?$^}h24+Oq7e^bkXX+;S8UK7xdvt5(-_O(H{fwFl zJ<2nE&aU!5xUucm%g)c|a*HAj-(N4=x3>Q7=CJ?2_k28+|NmX@&9&a2Pv;aRyZ`-u z`qRA`&-N#Ox>@=E`|6)Bd;UJJyMAo)j+Kqy1sE9!0mYvzKt-htIv|ChIALI4+)&!o z+|t@sTGYwHuA~?dC#F+e+*DH1kNM7zX{qYsk^+%FUNJ4xrr9xU zldvf;;FD{eCM2l9rl}GiYoCy{X|q~No~)URd|;+^^E4@CtrD&bJyU5%-Q3_MrO6(m zRwadg=HBi}My^wvin;SG(o1+5|AqUviOgzN@Z{st@Va2|nSqO0n|b@56_=Kpa1{c-LqEXzGU>`hN@__|M{?@ zOR)a!h{~VQ?dZ6dMWp}xw)4_=g-4C>%5ToTj`8NOyJyF=c)puar>Rr6^3QXoWwFA8 z%(HgA*2RtUEUj#~WKuK#_L^~9FkenGVjyP! z|JlK@hObw>|M#2KwPpYHki34yY$tN+%57pFW!|+}`Q(|ps)GOfyn=B^{pWsnX-v(c z)Y8I`{rAgbAZM&+x7Ws#xT%5n5CH%H00000000000000000000A^8LW004RbEC2ui z01^NU000N9fO>+1goTEBcZmvfHc(h%Q*C&7f_Zs}bSGhX0i6p}EG0sfmOvYpZZaNL zWGhh-afFtZM*y}XTP9B_5`~r*Ybsq*IdU;}Bup)Xvw3MKS3ee21xjZIXrvl9WqC$D zFFrV9I}{FCdX{<_4+&;@a5Op{97qsFVCjN*Fik-Sd0Y@Upr+0M0U`+DX}~7Lk{LW| d3>okt35Y^?-b}!tg@F?{@f%5VSnn!Wjh;=a&ZN|wN~rSLdE>rh&$xQxzGs7EELll1 zU`{jLvsTi=k@Vt*r%|-RvxvH?g6_m&w0OSO#gnOEwXA2i#-K@jZBdGGIsf&LjX#+E z_se%_O#l7T^U`Y>QFjHy$$yne;IXUG5l z+yDE#`Q(|icD>HNkIuf1^W%#D{??{tvBQMS^y7>B=6SxYfAZd#{_TkN<&^BgWd87! z>dI~Z`mO)ZEDlfB+RT8~y|W06Q4rI=BD; literal 0 HcmV?d00001 diff --git a/images/themes/xp/msg_read.gif b/images/themes/xp/msg_read.gif new file mode 100644 index 0000000000000000000000000000000000000000..2014f9c3a32613e7ae173c3ba4b2394cf9b14f36 GIT binary patch literal 581 zcmV-L0=oT2Nk%w1VG;lg0Oo%H|MaZ?@1y_!?*ISx|M|54)NlXlrT_l%uFmdfY@>^f zt^ewz|M#2H^#5Uh$I|`x&PR6h{F7^(C&qdzyJKZ;qCT+vg>%W@^GZ+ad)L;XP$zJxtE~Mf`qT~&U2om z%*W^U@c#aJeyX(B^0VdtW@@3cdV z|J`_qkiymJ_xs_J!0-RA<^SF7`0&VU_0)X->y7FA{&94xo}|fed8dq<)r5_&U2MCP zo6C8Cw}q3@|Nrr&+5Bdb*p{5b<@^8Q`u~%h#O}mo|Nq3_^7{Yx#B+MFo1)5_q|&a? z@c;bNx90qRfUJ(p`GbbBke986j=y1IoSdP^_}Yhzl*XCS`Tzg_A^8LW004ggEC2ui z01^NU000M~fPaF6f=yg|XB32sgK%U60ulswjD$WU11tw~09ibhe zccZmu|H3n${=Zt9mbLKz_amF1{%`8q**f`R{ifFoZvRh8n|J)}|Chi26)bttJ^4t- zghL13|NrpsU*DOZ8!o(?Fn#U+*S-IrPn>=JTTAcyhi|`C)~!lOpV!>BF{@zZyQ8T~ zZ~nRc_kVHK#!FxR-~aS0r+Ceto8L1kcP7>!pSAdSLFMvw=idE)wPf9e5C3lzS2yqK znR2YKWcA$Tmz!GF|NpbQZ_2*AZ+|@g{5w5o@uOe=zY8!j5CV!nS%8X48FWAjL2<&s zzO13Nskw<;QAI1irKzN(g`d$d)5p=CKeHUWn+ZyJyFPhOwpD{M-Hi_0)V~A7x`8 zXJQ~`!-UMde#QUlq|Kt#j6j#3O{)L@=9Zkplbpn=Xtm0p(TSA4sbIBbA!_OS{;h1d zT^wKd+J~2*&VPWcY$tNFcD=7xz5eE$W@@2vbgQOiv9x%;V~u_YeU90000000000000000000000000A^8LW004OaEC2ui z01^NU000N8fO&$0f)-;ZM{tCKczA>mcmxJ!0Xd6}j(Lp)Hw7>P5@m~;m_`N#7%c-y zHYKBtaza-#Q9Mr@8f;U9n0Rpk0s~t^CLK(3XN-6+3^jO2OH~eDKy^WGRHS)QJ1$*# zT1pEzR$)aAO`3vYF<)SIcxWGV91%n)KZGD2X-+b4B-E_v;RC<{D1<_!xG;i@4iOo+ c0HA@O%_0SN60lgKBFh8{2OeOlkS7oTJ46gG8UO$Q literal 0 HcmV?d00001 diff --git a/images/themes/xp/msg_read_reply.gif b/images/themes/xp/msg_read_reply.gif new file mode 100644 index 0000000000000000000000000000000000000000..d875a7d4847ec8391439688666e3acb0309554e5 GIT binary patch literal 587 zcmV-R0<`@{Nk%w1VG;lg0Oo%HVIO7x^sN8+wEzF^|L>#!|Mvg>@n9cg|LUcMj=%r^ z#O}mo|Nhwj|M8AOnceO9j6j#pq|{+zoV?lhmYl*gHimZi`(TkJBou|{2 zo6GS2{>hZn|NPU(?f<3O{F_my$LIEQda<9V)Mk>{|NsB{;gXD$#&LA3sZ+MCY`FE* ze2kmbuvfpFp~$;u$7LaEo}|fUYN5Y@$(y3e|Nq&AjKBZy4hI%#M`4V<2amqRRj3q?4S)?!{%zqSWK>_u~5hdxN^7OR%$cy_wPZ{^p#Spv$~| z#jIzyVjyN=f5)d+v}bIimqn!b+J~xWwbJzeT^wJ+gUtWkc>n+ZA^8LW004ggEC2ui z01^NU000N5fPaF6f^kGa6k~*ogGUVo0}KKhjD%ue1vmyU0by2^e`QD<0|rf51bTic zj5Y`eW^g%qK0RP)3m=OaR0>K00R&KKcyl9mZGgi96^TWU{T zeL`M5Ck{h|Em~1(E+JeqKvESDB6Ng0Q4bqydsstG0LTD1z=sfu2^eCOknv{96#zHt Zm{^o#MFKV*YV5ec1H|FfuSGFzA5n0r`o6P1E7jF$Shs83x{r1s@C?IL|dR eG=+$@C$W6i^pbL&ur%O}0?XtiwE!L_25SIeMoifN literal 0 HcmV?d00001 diff --git a/images/themes/xp/prio_low.gif b/images/themes/xp/prio_low.gif new file mode 100644 index 0000000000000000000000000000000000000000..420c066b139d1dd2d3bb81868c7db124937e70fd GIT binary patch literal 60 zcmZ?wbhEHbWM$xDn8?KN|Nnmm1|R|f#h)yU3=B*RIv@^6o`H#XN>ba-S>L5>7Al?g IVPvod0Gi?r'XP','PATH'=> 'xp'); +?> diff --git a/images/themes/xp/transparent.gif b/images/themes/xp/transparent.gif new file mode 100644 index 0000000000000000000000000000000000000000..35d42e808f0a8017b8d52a06be2f8fec0b466a66 GIT binary patch literal 43 scmZ?wbhEHbWMp7uXkcLY|NlP&1B2pE7Dgb&paUX6G7L;iE{qJ;0LZEa`2YX_ literal 0 HcmV?d00001 diff --git a/include/load_prefs.php b/include/load_prefs.php index eea76b35..c83436fa 100644 --- a/include/load_prefs.php +++ b/include/load_prefs.php @@ -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 */ diff --git a/include/options/display.php b/include/options/display.php index 9d9397fb..ac209ce8 100644 --- a/include/options/display.php +++ b/include/options/display.php @@ -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
"; + 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'); + +} + ?> diff --git a/src/left_main.php b/src/left_main.php index 29a689fb..fadc96c6 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -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 = '+"; + if ($use_icons && $icon_theme != 'none') { + $link .= "unfold=$mailbox\">"; + } else { + $link .= "unfold=$mailbox\">+"; + } } else { - $link .= "fold=$mailbox\">-"; + if ($use_icons && $icon_theme != 'none') { + $link .= "fold=$mailbox\">"; + } else { + $link .= "fold=$mailbox\">-"; + } } $link .= ''; - $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 = '$leader+ "; + if ($use_icons && $icon_theme != 'none') { + $link .= "unfold=$mailboxURL\">$leader "; + } else { + $link .= "unfold=$mailboxURL\">$leader+ "; + } } else { - $link .= "fold=$mailboxURL\">$leader- "; + if ($use_icons && $icon_theme != 'none') { + $link .= "fold=$mailboxURL\">$leader "; + } else { + $link .= "fold=$mailboxURL\">$leader- "; + } } $link .= ''; $pre .= $link; -- 2.25.1