X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=include%2Foptions%2Ffolder.php;h=20e4cf79cec157677aead09642a3fe6b79a537aa;hb=f197ec8835b64975ff47dc6cd86dae75605baebf;hp=451def5a0864addb48397a1ae0d1347e1bc4f249;hpb=045ec1a17de3de6297f2dfc576db99f5edbdb15b;p=squirrelmail.git diff --git a/include/options/folder.php b/include/options/folder.php index 451def5a..20e4cf79 100644 --- a/include/options/folder.php +++ b/include/options/folder.php @@ -5,7 +5,7 @@ * * Displays all options relating to folders * - * @copyright © 1999-2006 The SquirrelMail Project Team + * @copyright 1999-2016 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package squirrelmail @@ -33,11 +33,12 @@ define('SMOPT_GRP_FOLDERSELECT', 2); * @return array all option information */ function load_optpage_data_folder() { - global $username, $imapServerAddress, $imapPort; - global $folder_prefix, $default_folder_prefix, $show_prefix_option; + global $username, $imapServerAddress, $imapPort, $imap_stream_options, + $oTemplate, $nbsp, $folder_prefix, $default_folder_prefix, + $show_prefix_option; /* Get some imap data we need later. */ - $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0); + $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imap_stream_options); $boxes = sqimap_mailbox_list($imapConnection); /* Build a simple array into which we will build options. */ @@ -64,7 +65,7 @@ function load_optpage_data_folder() { } $trash_folder_values = array(SMPREF_NONE => '[ '._("Do not use Trash").' ]', - 'whatever' => $boxes); + 'ignore' => $boxes); $optvals[SMOPT_GRP_SPCFOLDER][] = array( 'name' => 'trash_folder', 'caption' => _("Trash Folder"), @@ -75,7 +76,7 @@ function load_optpage_data_folder() { ); $draft_folder_values = array(SMPREF_NONE => '[ '._("Do not use Drafts").' ]', - 'whatever' => $boxes); + 'ignore' => $boxes); $optvals[SMOPT_GRP_SPCFOLDER][] = array( 'name' => 'draft_folder', 'caption' => _("Draft Folder"), @@ -86,7 +87,7 @@ function load_optpage_data_folder() { ); $sent_folder_values = array(SMPREF_NONE => '[ '._("Do not use Sent").' ]', - 'whatever' => $boxes); + 'ignore' => $boxes); $optvals[SMOPT_GRP_SPCFOLDER][] = array( 'name' => 'sent_folder', 'caption' => _("Sent Folder"), @@ -96,6 +97,13 @@ function load_optpage_data_folder() { 'save' => 'save_option_sent_folder' ); + $optvals[SMOPT_GRP_SPCFOLDER][] = array( + 'name' => 'translate_special_folders', + 'caption' => _("Translate Special Folders"), + 'type' => SMOPT_TYPE_BOOLEAN, + 'refresh' => SMOPT_REFRESH_FOLDERLIST + ); + $optvals[SMOPT_GRP_SPCFOLDER][] = array( 'name' => 'save_reply_with_orig', 'caption' => _("Save Replies with Original Message"), @@ -226,9 +234,13 @@ function load_optpage_data_folder() { '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") . '"'), + 'posvals' => array( + SMPREF_MAILBOX_SELECT_LONG => + _("Long:") . ' "' . _("Folder") . $delim . _("Subfolder") . '"', + SMPREF_MAILBOX_SELECT_INDENTED => + _("Indented:") . " \"$nbsp$nbsp$nbsp$nbsp" . _("Subfolder") . '"', + SMPREF_MAILBOX_SELECT_DELIMITED => + _("Delimited:") . " \".$nbsp" . _("Subfolder") . '"'), 'htmlencoded' => true ); @@ -247,44 +259,63 @@ function load_optpage_data_folder() { /** * Saves the trash folder option. + * @param object $option SquirrelOption object + * @since 1.3.2 */ function save_option_trash_folder($option) { global $data_dir, $username; - /* Set move to trash on or off. */ - $trash_on = ($option->new_value == SMPREF_NONE ? SMPREF_OFF : SMPREF_ON); - setPref($data_dir, $username, 'move_to_trash', $trash_on); + if (strtolower($option->new_value)=='inbox') { + // make sure that it is not INBOX + error_option_save(_("You can't select INBOX as Trash folder.")); + } else { + /* Set move to trash on or off. */ + $trash_on = ($option->new_value == SMPREF_NONE ? SMPREF_OFF : SMPREF_ON); + setPref($data_dir, $username, 'move_to_trash', $trash_on); - /* Now just save the option as normal. */ - save_option($option); + /* Now just save the option as normal. */ + save_option($option); + } } /** * Saves the sent folder option. + * @param object $option SquirrelOption object + * @since 1.3.2 */ function save_option_sent_folder($option) { global $data_dir, $username; - /* Set move to sent on or off. */ - $sent_on = ($option->new_value == SMPREF_NONE ? SMPREF_OFF : SMPREF_ON); - setPref($data_dir, $username, 'move_to_sent', $sent_on); + if (strtolower($option->new_value)=='inbox') { + // make sure that it is not INBOX + error_option_save(_("You can't select INBOX as Sent folder.")); + } else { + /* Set move to sent on or off. */ + $sent_on = ($option->new_value == SMPREF_NONE ? SMPREF_OFF : SMPREF_ON); + setPref($data_dir, $username, 'move_to_sent', $sent_on); - /* Now just save the option as normal. */ - save_option($option); + /* Now just save the option as normal. */ + save_option($option); + } } /** * Saves the draft folder option. + * @param object $option SquirrelOption object + * @since 1.3.2 */ function save_option_draft_folder($option) { global $data_dir, $username; - /* Set move to draft on or off. */ - $draft_on = ($option->new_value == SMPREF_NONE ? SMPREF_OFF : SMPREF_ON); - setPref($data_dir, $username, 'save_as_draft', $draft_on); - - /* Now just save the option as normal. */ - save_option($option); + if (strtolower($option->new_value)=='inbox') { + // make sure that it is not INBOX + error_option_save(_("You can't select INBOX as Draft folder.")); + } else { + /* Set move to draft on or off. */ + $draft_on = ($option->new_value == SMPREF_NONE ? SMPREF_OFF : SMPREF_ON); + setPref($data_dir, $username, 'save_as_draft', $draft_on); + + /* Now just save the option as normal. */ + save_option($option); + } } - -?> \ No newline at end of file