- 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
$oldway = 'false';
}
+if (!$use_icons ) {
+ $use_icons = 'false';
+}
+
if (!$use_php_recode ) {
$use_php_recode = 'false';
}
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";
}
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(); }
} 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(); }
}
}
}
}
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";
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";
# 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";
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
* 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,
* 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
+?>
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
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
$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];
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 .= ' ';
+ }
+ $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 .= ' ';
- }
- 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',
--- /dev/null
+<?php
+header("Location:../../../index.php");
+?>
--- /dev/null
+<?php
+ $icon_themes[] = array('NAME'=>'Default','PATH'=> 'default');
+?>
--- /dev/null
+<?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? **/
+?>
--- /dev/null
+<?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>
--- /dev/null
+<?php
+ $icon_themes[] = array('NAME'=>'None','PATH'=> 'none');
+?>
--- /dev/null
+<?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? **/
+?>
--- /dev/null
+<?php
+ $icon_themes[] = array('NAME'=>'XP','PATH'=> 'xp');
+?>
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 */
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
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();
'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"),
}
}
+/**
+ * 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');
+
+}
+
?>
* 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);
}
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;
$link = '<a target="left" style="text-decoration:none" ' .'href="left_main.php?';
if ($collapse) {
- $link .= "unfold=$mailboxURL\">$leader+ </tt>";
+ if ($use_icons && $icon_theme != 'none') {
+ $link .= "unfold=$mailboxURL\">$leader<IMG src=\"" . SM_PATH . "images/plus.png\" border=\"0\" height=\"7\" width=\"7\"> </tt>";
+ } else {
+ $link .= "unfold=$mailboxURL\">$leader+ </tt>";
+ }
} else {
- $link .= "fold=$mailboxURL\">$leader- </tt>";
+ if ($use_icons && $icon_theme != 'none') {
+ $link .= "fold=$mailboxURL\">$leader<IMG src=\"" . SM_PATH . "images/minus.png\" border=\"0\" height=\"7\" width=\"7\"> </tt>";
+ } else {
+ $link .= "fold=$mailboxURL\">$leader- </tt>";
+ }
}
$link .= '</a>';
$pre .= $link;