X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=include%2Foptions%2Ffolder.php;h=863fd607ff0529dbd0a99986a6828cb2a066bb7e;hb=aedb660543d1100fd763b1ba4d003a5123fafd9e;hp=f103cbc96794e8d69fbce239cccd636c55fe84e4;hpb=08185f2a7631c3a12cb1ac085fec3be471b56b00;p=squirrelmail.git diff --git a/include/options/folder.php b/include/options/folder.php index f103cbc9..863fd607 100644 --- a/include/options/folder.php +++ b/include/options/folder.php @@ -3,25 +3,37 @@ /** * options_folder.php * - * Copyright (c) 1999-2002 The SquirrelMail Project Team + * Copyright (c) 1999-2003 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * * Displays all options relating to folders * * $Id$ + * @package squirrelmail */ -/* Path for SquirrelMail required files. */ -define('SM_PATH','../'); - -/* SquirrelMail required files. */ +/** SquirrelMail required files. */ require_once(SM_PATH . 'functions/imap.php'); +require_once(SM_PATH . 'functions/imap_general.php'); -/* Define the group constants for the folder options page. */ +/* Define the group constants for the folder options page. */ define('SMOPT_GRP_SPCFOLDER', 0); define('SMOPT_GRP_FOLDERLIST', 1); +define('SMOPT_GRP_FOLDERSELECT', 2); -/* Define the optpage load function for the folder options page. */ +/** + * This function builds an array with all the information about + * the options available to the user, and returns it. The options + * are grouped by the groups in which they are displayed. + * For each option, the following information is stored: + * - name: the internal (variable) name + * - caption: the description of the option in the UI + * - type: one of SMOPT_TYPE_* + * - refresh: one of SMOPT_REFRESH_* + * - size: one of SMOPT_SIZE_* + * - save: the name of a function to call when saving this option + * @return array all option information + */ function load_optpage_data_folder() { global $username, $key, $imapServerAddress, $imapPort; global $folder_prefix, $default_folder_prefix, $show_prefix_option; @@ -30,7 +42,6 @@ function load_optpage_data_folder() { $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); $boxes = sqimap_mailbox_list($imapConnection); - sqimap_logout($imapConnection); /* Build a simple array into which we will build options. */ $optgrps = array(); @@ -55,46 +66,44 @@ function load_optpage_data_folder() { ); } - $special_folder_values = array(); - foreach ($boxes as $folder) { - if (strtolower($folder['unformatted']) != 'inbox') { - $real_value = $folder['unformatted-dm']; - $disp_value = str_replace(' ', ' ', $folder['formatted']); - $special_folder_values[$real_value] = $disp_value; - } - } - - $trash_none = array(SMPREF_NONE => _("Do not use Trash")); - $trash_folder_values = array_merge($trash_none, $special_folder_values); + $trash_folder_values = array(SMPREF_NONE => '[ '._("Do not use Trash").' ]', + 'whatever' => $boxes); $optvals[SMOPT_GRP_SPCFOLDER][] = array( 'name' => 'trash_folder', 'caption' => _("Trash Folder"), - 'type' => SMOPT_TYPE_STRLIST, + 'type' => SMOPT_TYPE_FLDRLIST, 'refresh' => SMOPT_REFRESH_FOLDERLIST, 'posvals' => $trash_folder_values, 'save' => 'save_option_trash_folder' ); - - $sent_none = array(SMPREF_NONE => _("Do not use Sent")); - $sent_folder_values = array_merge($sent_none, $special_folder_values); + + $draft_folder_values = array(SMPREF_NONE => '[ '._("Do not use Drafts").' ]', + 'whatever' => $boxes); + $optvals[SMOPT_GRP_SPCFOLDER][] = array( + 'name' => 'draft_folder', + 'caption' => _("Draft Folder"), + 'type' => SMOPT_TYPE_FLDRLIST, + 'refresh' => SMOPT_REFRESH_FOLDERLIST, + 'posvals' => $draft_folder_values, + 'save' => 'save_option_draft_folder' + ); + + $sent_folder_values = array(SMPREF_NONE => '[ '._("Do not use Sent").' ]', + 'whatever' => $boxes); $optvals[SMOPT_GRP_SPCFOLDER][] = array( 'name' => 'sent_folder', 'caption' => _("Sent Folder"), - 'type' => SMOPT_TYPE_STRLIST, + 'type' => SMOPT_TYPE_FLDRLIST, 'refresh' => SMOPT_REFRESH_FOLDERLIST, 'posvals' => $sent_folder_values, 'save' => 'save_option_sent_folder' ); - - $draft_none = array(SMPREF_NONE => _("Do not use Drafts")); - $draft_folder_values = array_merge($draft_none, $special_folder_values); + $optvals[SMOPT_GRP_SPCFOLDER][] = array( - 'name' => 'draft_folder', - 'caption' => _("Draft Folder"), - 'type' => SMOPT_TYPE_STRLIST, - 'refresh' => SMOPT_REFRESH_FOLDERLIST, - 'posvals' => $draft_folder_values, - 'save' => 'save_option_draft_folder' + 'name' => 'save_reply_with_orig', + 'caption' => _("Save Replies with Original Message"), + 'type' => SMOPT_TYPE_BOOLEAN, + 'refresh' => SMOPT_REFRESH_FOLDERLIST ); /*** Load the General Options into the array ***/ @@ -157,7 +166,7 @@ function load_optpage_data_folder() { 'type' => SMOPT_TYPE_STRLIST, 'refresh' => SMOPT_REFRESH_FOLDERLIST, 'posvals' => array(SMPREF_UNSEEN_ONLY => _("Only Unseen"), - SMPREF_UNSEEN_TOTAL => _("Unseen and Total")) + SMPREF_UNSEEN_TOTAL => _("Unseen and Total")) ); $optvals[SMOPT_GRP_FOLDERLIST][] = array( @@ -167,6 +176,14 @@ function load_optpage_data_folder() { 'refresh' => SMOPT_REFRESH_FOLDERLIST ); + $optvals[SMOPT_GRP_FOLDERLIST][] = array( + 'name' => 'unseen_cum', + 'caption' => _("Enable Cumulative Unread Message Notification"), + 'type' => SMOPT_TYPE_BOOLEAN, + 'refresh' => SMOPT_REFRESH_FOLDERLIST + ); + + $optvals[SMOPT_GRP_FOLDERLIST][] = array( 'name' => 'date_format', 'caption' => _("Show Clock on Folders Panel"), @@ -174,9 +191,9 @@ function load_optpage_data_folder() { 'refresh' => SMOPT_REFRESH_FOLDERLIST, 'posvals' => array( '1' => 'MM/DD/YY HH:MM', '2' => 'DD/MM/YY HH:MM', - '3' => 'DDD, HH:MM', - '4' => 'HH:MM:SS', - '5' => 'HH:MM', + '3' => _("Show weekday and time"), + '4' => _("Show time with seconds"), + '5' => _("Show time"), '6' => _("No Clock")), ); @@ -186,7 +203,7 @@ function load_optpage_data_folder() { 'type' => SMOPT_TYPE_STRLIST, 'refresh' => SMOPT_REFRESH_FOLDERLIST, 'posvals' => array(SMPREF_TIME_12HR => _("12-hour clock"), - SMPREF_TIME_24HR => _("24-hour clock")) + SMPREF_TIME_24HR => _("24-hour clock")) ); $optvals[SMOPT_GRP_FOLDERLIST][] = array( @@ -206,17 +223,38 @@ function load_optpage_data_folder() { 9 => '9') ); + + /*** Load the General Options into the array ***/ + $optgrps[SMOPT_GRP_FOLDERSELECT] = _("Folder Selection Options"); + $optvals[SMOPT_GRP_FOLDERSELECT] = array(); + + $delim = sqimap_get_delimiter($imapConnection); + $optvals[SMOPT_GRP_FOLDERSELECT][] = array( + 'name' => 'mailbox_select_style', + 'caption' => _("Selection List Style"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => array( 0 => _("Long: ") . '"' . _("Folder") . $delim . _("Subfolder") . '"', + 1 => _("Indented: ") . '"    ' . _("Subfolder") . '"', + 2 => _("Delimited: ") . '". ' . _("Subfolder") . '"') + ); + /* Assemble all this together and return it as our result. */ $result = array( 'grps' => $optgrps, 'vals' => $optvals ); + sqimap_logout($imapConnection); return ($result); } /******************************************************************/ /** Define any specialized save functions for this option page. ***/ /******************************************************************/ + +/** + * Saves the trash folder option. + */ function save_option_trash_folder($option) { global $data_dir, $username; @@ -228,6 +266,9 @@ function save_option_trash_folder($option) { save_option($option); } +/** + * Saves the sent folder option. + */ function save_option_sent_folder($option) { global $data_dir, $username; @@ -239,6 +280,9 @@ function save_option_sent_folder($option) { save_option($option); } +/** + * Saves the draft folder option. + */ function save_option_draft_folder($option) { global $data_dir, $username;