X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Foptions_folder.php;h=3ee491017ee85e37ce2f8a12c51bf9e3da96986f;hb=deaa6c6af85d84b0ea6cb6b307579c0e72487f65;hp=442d5c26f42ff61b2a8a30dc5771b6681cfa7671;hpb=a440e68fce61ad2cd09fe0bc2bb89972b788a92f;p=squirrelmail.git diff --git a/src/options_folder.php b/src/options_folder.php index 442d5c26..3ee49101 100644 --- a/src/options_folder.php +++ b/src/options_folder.php @@ -1,57 +1,56 @@ -
- - -
- - - - - -
- -

- - - - - - - 'folder_prefix', + 'caption' => _("Folder Path"), + 'type' => SMOPT_TYPE_STRING, + 'refresh' => SMOPT_REFRESH_FOLDERLIST, + 'size' => SMOPT_SIZE_LARGE + ); + } + $special_folder_values = array(); foreach ($boxes as $folder) { if (strtolower($folder['unformatted']) != 'inbox') { @@ -63,35 +62,42 @@ $trash_none = array(SMPREF_NONE => _("Do not use Trash")); $trash_folder_values = array_merge($trash_none, $special_folder_values); - $optvals[] = array( + $optvals[SMOPT_GRP_SPCFOLDER][] = array( 'name' => 'trash_folder', 'caption' => _("Trash Folder"), 'type' => SMOPT_TYPE_STRLIST, 'refresh' => SMOPT_REFRESH_FOLDERLIST, - 'posvals' => $trash_folder_values + '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); - $optvals[] = array( + $optvals[SMOPT_GRP_SPCFOLDER][] = array( 'name' => 'sent_folder', 'caption' => _("Sent Folder"), 'type' => SMOPT_TYPE_STRLIST, 'refresh' => SMOPT_REFRESH_FOLDERLIST, - 'posvals' => $sent_folder_values + 'posvals' => $sent_folder_values, + 'save' => 'save_option_sent_folder' ); - $drafts_none = array(SMPREF_NONE => _("Do not use Drafts")); + $draft_none = array(SMPREF_NONE => _("Do not use Drafts")); $draft_folder_values = array_merge($draft_none, $special_folder_values); - $optvals[] = array( + $optvals[SMOPT_GRP_SPCFOLDER][] = array( 'name' => 'draft_folder', 'caption' => _("Draft Folder"), 'type' => SMOPT_TYPE_STRLIST, 'refresh' => SMOPT_REFRESH_FOLDERLIST, - 'posvals' => $draft_folder_values + 'posvals' => $draft_folder_values, + 'save' => 'save_option_draft_folder' ); - $optvals[] = array( + /*** Load the General Options into the array ***/ + $optgrps[SMOPT_GRP_FOLDERLIST] = _("Folder List Options"); + $optvals[SMOPT_GRP_FOLDERLIST] = array(); + + $optvals[SMOPT_GRP_FOLDERLIST][] = array( 'name' => 'location_of_bar', 'caption' => _("Location of Folder List"), 'type' => SMOPT_TYPE_STRLIST, @@ -104,7 +110,7 @@ for ($lsv = 100; $lsv <= 300; $lsv += 10) { $left_size_values[$lsv] = "$lsv " . _("pixels"); } - $optvals[] = array( + $optvals[SMOPT_GRP_FOLDERLIST][] = array( 'name' => 'left_size', 'caption' => _("Width of Folder List"), 'type' => SMOPT_TYPE_STRLIST, @@ -123,7 +129,7 @@ $left_refresh_values[$lr_val] = ($lr_val/60) . " $minute_str"; } } - $optvals[] = array( + $optvals[SMOPT_GRP_FOLDERLIST][] = array( 'name' => 'left_refresh', 'caption' => _("Auto Refresh Folder List"), 'type' => SMOPT_TYPE_STRLIST, @@ -131,9 +137,9 @@ 'posvals' => $left_refresh_values ); - $optvals[] = array( + $optvals[SMOPT_GRP_FOLDERLIST][] = array( 'name' => 'unseen_notify', - 'caption' => _("Enable Unseen Message Notification"), + 'caption' => _("Enable Unread Message Notification"), 'type' => SMOPT_TYPE_STRLIST, 'refresh' => SMOPT_REFRESH_FOLDERLIST, 'posvals' => array(SMPREF_UNSEEN_NONE => _("No Notification"), @@ -141,23 +147,23 @@ SMPREF_UNSEEN_ALL => _("All Folders")) ); - $optvals[] = array( + $optvals[SMOPT_GRP_FOLDERLIST][] = array( 'name' => 'unseen_type', - 'caption' => _("Unseen Message Notification Type"), + 'caption' => _("Unread Message Notification Type"), 'type' => SMOPT_TYPE_STRLIST, 'refresh' => SMOPT_REFRESH_FOLDERLIST, 'posvals' => array(SMPREF_UNSEEN_ONLY => _("Only Unseen"), SMPREF_UNSEEN_TOTAL => _("Unseen and Total")) ); - $optvals[] = array( + $optvals[SMOPT_GRP_FOLDERLIST][] = array( 'name' => 'collapse_folders', 'caption' => _("Enable Collapsable Folders"), 'type' => SMOPT_TYPE_BOOLEAN, 'refresh' => SMOPT_REFRESH_FOLDERLIST ); - $optvals[] = array( + $optvals[SMOPT_GRP_FOLDERLIST][] = array( 'name' => 'date_format', 'caption' => _("Show Clock on Folders Panel"), 'type' => SMOPT_TYPE_STRLIST, @@ -170,7 +176,7 @@ '6' => _("No Clock")), ); - $optvals[] = array( + $optvals[SMOPT_GRP_FOLDERLIST][] = array( 'name' => 'hour_format', 'caption' => _("Hour Format"), 'type' => SMOPT_TYPE_STRLIST, @@ -179,40 +185,65 @@ SMPREF_TIME_24HR => _("24-hour clock")) ); + $optvals[SMOPT_GRP_FOLDERLIST][] = array( + 'name' => 'search_memory', + 'caption' => _("Memory Search"), + 'type' => SMOPT_TYPE_STRLIST, + 'refresh' => SMOPT_REFRESH_NONE, + 'posvals' => array( 0 => _("Disabled"), + 1 => '1', + 2 => '2', + 3 => '3', + 4 => '4', + 5 => '5', + 6 => '6', + 7 => '7', + 8 => '8', + 9 => '9') + ); - /* Build all these values into an array of SquirrelOptions objects. */ - $options = createOptionArray($optvals); + /* Assemble all this together and return it as our result. */ + $result = array( + 'grps' => $optgrps, + 'vals' => $optvals + ); + return ($result); +} - /* Print the row for each option. */ - foreach ($options as $option) { - if ($option->type != SMOPT_TYPE_HIDDEN) { - echo "\n"; - echo ' \n"; - echo ' \n"; - echo "\n"; - } else { - echo $option->createHTMLWidget(); - } - } +/******************************************************************/ +/** Define any specialized save functions for this option page. ***/ +/******************************************************************/ +function save_option_trash_folder($option) { + global $data_dir, $username; - // if( $unseen_notify == '' ) - // $unseen_notify = '2'; + /* 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); - - echo ''; - do_hook("options_folders_inside"); - OptionSubmit( 'submit_folder' ); -?> + /* Now just save the option as normal. */ + save_option($option); +} -
: - -
'; - else - echo '
'; -?> -
' - . $option->caption . ":' . $option->createHTMLWidget() . "

-
+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); -
+ /* Now just save the option as normal. */ + save_option($option); +} -
- +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); +} + +?>