From 2589ba9a483a7e220b7ddc962de91d542ee67cc8 Mon Sep 17 00:00:00 2001 From: tokul Date: Sat, 9 Oct 2004 12:52:43 +0000 Subject: [PATCH] use folder list instead of string list in order to follow 'mailbox_select_style' setting. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8175 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- plugins/sent_subfolders/setup.php | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/plugins/sent_subfolders/setup.php b/plugins/sent_subfolders/setup.php index 34dcb0df..93b7eb5a 100644 --- a/plugins/sent_subfolders/setup.php +++ b/plugins/sent_subfolders/setup.php @@ -130,19 +130,13 @@ function sent_subfolders_optpage_loadhook_folders() { 'save' => 'save_option_sent_subfolders_setting' ); - $sent_subfolders_base_values = array(); - foreach ($boxes as $folder) { - if (strtolower($folder['unformatted']) != 'inbox') { - $real_value = $folder['unformatted-dm']; - $disp_value = str_replace(' ', ' ', $folder['formatted']); - $sent_subfolders_base_values[$real_value] = $disp_value; - } - } + $filtered_folders=array_filter($boxes, "filter_folders"); + $sent_subfolders_base_values = array('whatever'=>$filtered_folders); $optvals[] = array( 'name' => 'sent_subfolders_base', 'caption' => _("Base Sent Folder"), - 'type' => SMOPT_TYPE_STRLIST, + 'type' => SMOPT_TYPE_FLDRLIST, 'refresh' => SMOPT_REFRESH_FOLDERLIST, 'posvals' => $sent_subfolders_base_values ); @@ -152,6 +146,18 @@ function sent_subfolders_optpage_loadhook_folders() { $optpage_data['vals'][SMOPT_GRP_SENT_SUBFOLDERS] = $optvals; } +/** + * Defines folder filtering rules + * + * Callback function that should exclude some folders from folder listing. + * @param array $fldr list of folders. See sqimap_mailbox_list + * @return boolean returns true, if folder has to included in folder listing + * @access private + */ +function filter_folders($fldr) { + return strtolower($fldr['unformatted'])!='inbox'; +} + /** * Saves sent_subfolder_options */ -- 2.25.1