use folder list instead of string list in order to follow 'mailbox_select_style'
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 9 Oct 2004 12:52:43 +0000 (12:52 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 9 Oct 2004 12:52:43 +0000 (12:52 +0000)
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

index 34dcb0dfde8c25668d5c798cd49aca20f4075562..93b7eb5a38b3982e580843054fa90d2e1fa0617b 100644 (file)
@@ -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(' ', '&nbsp;', $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
  */