Add a new Options section "compose". Move some options from Display
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 18 Jan 2005 18:58:53 +0000 (18:58 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 18 Jan 2005 18:58:53 +0000 (18:58 +0000)
Preferences there - DP was way overcrowded with options not logically
sorted. This is just a simple re-arranging of some options, as a
simple attempt to at least clean things up a small bit.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8677 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
include/options/compose.php [new file with mode: 0644]
include/options/display.php
src/options.php

index 22ad1212d62c3fc8c09ea94ea7cf8c59022b0657..04cb4ecc93ca94b1e6766af7b68b6eda785bd077 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -183,6 +183,9 @@ Version 1.5.1 -- CVS
     file inclusions. [CAN-2005-0075] 
   - Remove Printer Friendly Clean Display config option, the cleaning
     is now always done.
+  - Create new Options section "Compose Preferences" and move some
+    options from Display Preferences there; also move some around within
+    Display Preferences.
 
 Version 1.5.0
 --------------------
diff --git a/include/options/compose.php b/include/options/compose.php
new file mode 100644 (file)
index 0000000..2f8f8c8
--- /dev/null
@@ -0,0 +1,168 @@
+<?php
+
+/**
+ * options_compose.php
+ *
+ * Copyright (c) 1999-2005 The SquirrelMail Project Team
+ * Licensed under the GNU GPL. For full terms see the file COPYING.
+ *
+ * Displays all options concerning composing of new messages
+ *
+ * @version $Id$
+ * @package squirrelmail
+ */
+
+/** Define the group constants for this options page. */
+define('SMOPT_GRP_GENERAL', 0);
+
+/**
+ * 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_compose() {
+
+    /* Build a simple array into which we will build options. */
+    $optgrps = array();
+    $optvals = array();
+
+    /******************************************************/
+    /* LOAD EACH GROUP OF OPTIONS INTO THE OPTIONS ARRAY. */
+    /******************************************************/
+    
+    /*** Load the General Options into the array ***/
+    $optgrps[SMOPT_GRP_GENERAL] = _("Message Composition");
+    $optvals[SMOPT_GRP_GENERAL] = array();
+
+    $optvals[SMOPT_GRP_GENERAL][] = array(
+        'name'    => 'editor_size',
+        'caption' => _("Width of Editor Window"),
+        'type'    => SMOPT_TYPE_INTEGER,
+        'refresh' => SMOPT_REFRESH_NONE,
+        'size'    => SMOPT_SIZE_TINY
+    );
+
+    $optvals[SMOPT_GRP_GENERAL][] = array(
+        'name'    => 'editor_height',
+        'caption' => _("Height of Editor Window"),
+        'type'    => SMOPT_TYPE_INTEGER,
+        'refresh' => SMOPT_REFRESH_NONE,
+        'size'    => SMOPT_SIZE_TINY
+    );
+
+    $optvals[SMOPT_GRP_GENERAL][] = array(
+        'name'    => 'location_of_buttons',
+        'caption' => _("Location of Buttons when Composing"),
+        'type'    => SMOPT_TYPE_STRLIST,
+        'refresh' => SMOPT_REFRESH_NONE,
+        'posvals' => array(SMPREF_LOC_TOP     => _("Before headers"),
+                           SMPREF_LOC_BETWEEN => _("Between headers and message body"),
+                           SMPREF_LOC_BOTTOM  => _("After message body"))
+    );
+
+
+    $optvals[SMOPT_GRP_GENERAL][] = array(
+        'name'    => 'use_javascript_addr_book',
+        'caption' => _("Addressbook Display Format"),
+        'type'    => SMOPT_TYPE_STRLIST,
+        'refresh' => SMOPT_REFRESH_NONE,
+        'posvals' => array('1' => _("Javascript"),
+                           '0' => _("HTML"))
+    );
+    
+    $optvals[SMOPT_GRP_GENERAL][] = array(
+        'name'    => 'forward_cc',
+        'caption' => _("Include CCs when Forwarding Messages"),
+        'type'    => SMOPT_TYPE_BOOLEAN,
+        'refresh' => SMOPT_REFRESH_NONE
+    );
+
+    $optvals[SMOPT_GRP_GENERAL][] = array(
+        'name'    => 'include_self_reply_all',
+        'caption' => _("Include Me in CC when I Reply All"),
+        'type'    => SMOPT_TYPE_BOOLEAN,
+        'refresh' => SMOPT_REFRESH_NONE
+    );
+    
+    $optvals[SMOPT_GRP_GENERAL][] = array(
+        'name'    => 'compose_new_win',
+        'caption' => _("Compose Messages in New Window"),
+        'type'    => SMOPT_TYPE_BOOLEAN,
+        'refresh' => SMOPT_REFRESH_ALL
+    );
+
+    $optvals[SMOPT_GRP_GENERAL][] = array(
+        'name'    => 'compose_width',
+        'caption' => _("Width of Compose Window"),
+        'type'    => SMOPT_TYPE_INTEGER,
+        'refresh' => SMOPT_REFRESH_ALL,
+        'size'    => SMOPT_SIZE_TINY
+    );
+
+    $optvals[SMOPT_GRP_GENERAL][] = array(
+        'name'    => 'compose_height',
+        'caption' => _("Height of Compose Window"),
+        'type'    => SMOPT_TYPE_INTEGER,
+        'refresh' => SMOPT_REFRESH_ALL,
+        'size'    => SMOPT_SIZE_TINY
+    );
+
+    $optvals[SMOPT_GRP_GENERAL][] = array(
+        'name'    => 'sig_first',
+        'caption' => _("Append Signature before Reply/Forward Text"),
+        'type'    => SMOPT_TYPE_BOOLEAN,
+        'refresh' => SMOPT_REFRESH_NONE
+    );
+
+    $optvals[SMOPT_GRP_GENERAL][] = array(
+        'name'    => 'body_quote',
+        'caption' => _("Prefix for Original Message when Replying"),
+        'type'    => SMOPT_TYPE_STRING,
+        'refresh' => SMOPT_REFRESH_NONE,
+        'size'    => SMOPT_SIZE_TINY,
+        'save'    => 'save_option_reply_prefix'
+    );
+
+    $optvals[SMOPT_GRP_GENERAL][] = array(
+        'name'    => 'reply_focus',
+        'caption' => _("Cursor Position when Replying"),
+        'type'    => SMOPT_TYPE_STRLIST,
+        'refresh' => SMOPT_REFRESH_NONE,
+        'posvals' => array('' => _("To: field"),
+                           'focus' => _("Focus in body"),
+                           'select' => _("Select body"),
+                           'none' => _("No focus"))
+    );
+
+    $optvals[SMOPT_GRP_GENERAL][] = array(
+        'name'    => 'strip_sigs',
+        'caption' => _("Strip signature when replying"),
+        'type'    => SMOPT_TYPE_BOOLEAN,
+        'refresh' => SMOPT_REFRESH_NONE
+    );
+
+    /* Assemble all this together and return it as our result. */
+    $result = array(
+        'grps' => $optgrps,
+        'vals' => $optvals
+    );
+    return ($result);
+}
+
+/******************************************************************/
+/** Define any specialized save functions for this option page. ***/
+/******************************************************************/
+
+function save_option_header($option) {
+}
+
+
+?>
index e1cb17348c1a430b3e724a352dc55fae7bf81561..92d4c995c8bab36bd3ab949c3e912da63ae40e1a 100644 (file)
@@ -176,7 +176,7 @@ function load_optpage_data_display() {
 
     $optvals[SMOPT_GRP_MAILBOX][] = array(
         'name'    => 'show_num',
-        'caption' => _("Number of Messages to Index"),
+        'caption' => _("Number of Messages on one Page"),
         'type'    => SMOPT_TYPE_INTEGER,
         'refresh' => SMOPT_REFRESH_NONE,
         'size'    => SMOPT_SIZE_TINY
@@ -269,10 +269,26 @@ function load_optpage_data_display() {
         'refresh' => SMOPT_REFRESH_NONE,
         'size'    => SMOPT_SIZE_TINY
     );
+    
+    $optvals[SMOPT_GRP_MAILBOX][] = array(
+        'name'    => 'internal_date_sort',
+        'caption' => _("Sort by Received Date"),
+        'type'    => SMOPT_TYPE_BOOLEAN,
+        'refresh' => SMOPT_REFRESH_ALL
+    );
+    if ($allow_thread_sort == TRUE) {
+        $optvals[SMOPT_GRP_MAILBOX][] = array(
+            'name'    => 'sort_by_ref',
+            'caption' => _("Enable Thread Sort by References Header"),
+            'type'    => SMOPT_TYPE_BOOLEAN,
+            'refresh' => SMOPT_REFRESH_ALL
+        );
+    }
+
 
 
     /*** Load the General Options into the array ***/
-    $optgrps[SMOPT_GRP_MESSAGE] = _("Message Display and Composition");
+    $optgrps[SMOPT_GRP_MESSAGE] = _("Message Display Options");
     $optvals[SMOPT_GRP_MESSAGE] = array();
 
     $optvals[SMOPT_GRP_MESSAGE][] = array(
@@ -283,42 +299,6 @@ function load_optpage_data_display() {
         'size'    => SMOPT_SIZE_TINY
     );
 
-    $optvals[SMOPT_GRP_MESSAGE][] = array(
-        'name'    => 'editor_size',
-        'caption' => _("Width of Editor Window"),
-        'type'    => SMOPT_TYPE_INTEGER,
-        'refresh' => SMOPT_REFRESH_NONE,
-        'size'    => SMOPT_SIZE_TINY
-    );
-
-    $optvals[SMOPT_GRP_MESSAGE][] = array(
-        'name'    => 'editor_height',
-        'caption' => _("Height of Editor Window"),
-        'type'    => SMOPT_TYPE_INTEGER,
-        'refresh' => SMOPT_REFRESH_NONE,
-        'size'    => SMOPT_SIZE_TINY
-    );
-
-    $optvals[SMOPT_GRP_MESSAGE][] = array(
-        'name'    => 'location_of_buttons',
-        'caption' => _("Location of Buttons when Composing"),
-        'type'    => SMOPT_TYPE_STRLIST,
-        'refresh' => SMOPT_REFRESH_NONE,
-        'posvals' => array(SMPREF_LOC_TOP     => _("Before headers"),
-                           SMPREF_LOC_BETWEEN => _("Between headers and message body"),
-                           SMPREF_LOC_BOTTOM  => _("After message body"))
-    );
-
-
-    $optvals[SMOPT_GRP_MESSAGE][] = array(
-        'name'    => 'use_javascript_addr_book',
-        'caption' => _("Addressbook Display Format"),
-        'type'    => SMOPT_TYPE_STRLIST,
-        'refresh' => SMOPT_REFRESH_NONE,
-        'posvals' => array('1' => _("Javascript"),
-                           '0' => _("HTML"))
-    );
-
     $optvals[SMOPT_GRP_MESSAGE][] = array(
         'name'    => 'show_html_default',
         'caption' => _("Show HTML Version by Default"),
@@ -333,20 +313,6 @@ function load_optpage_data_display() {
         'refresh' => SMOPT_REFRESH_NONE
     );
 
-    $optvals[SMOPT_GRP_MESSAGE][] = array(
-        'name'    => 'forward_cc',
-        'caption' => _("Include CCs when Forwarding Messages"),
-        'type'    => SMOPT_TYPE_BOOLEAN,
-        'refresh' => SMOPT_REFRESH_NONE
-    );
-
-    $optvals[SMOPT_GRP_MESSAGE][] = array(
-        'name'    => 'include_self_reply_all',
-        'caption' => _("Include Me in CC when I Reply All"),
-        'type'    => SMOPT_TYPE_BOOLEAN,
-        'refresh' => SMOPT_REFRESH_NONE
-    );
-
     $optvals[SMOPT_GRP_MESSAGE][] = array(
         'name'    => 'show_xmailer_default',
         'caption' => _("Enable Mailer Display"),
@@ -370,76 +336,6 @@ function load_optpage_data_display() {
         );
     }
 
-    $optvals[SMOPT_GRP_MESSAGE][] = array(
-        'name'    => 'compose_new_win',
-        'caption' => _("Compose Messages in New Window"),
-        'type'    => SMOPT_TYPE_BOOLEAN,
-        'refresh' => SMOPT_REFRESH_ALL
-    );
-
-    $optvals[SMOPT_GRP_MESSAGE][] = array(
-        'name'    => 'compose_width',
-        'caption' => _("Width of Compose Window"),
-        'type'    => SMOPT_TYPE_INTEGER,
-        'refresh' => SMOPT_REFRESH_ALL,
-        'size'    => SMOPT_SIZE_TINY
-    );
-
-    $optvals[SMOPT_GRP_MESSAGE][] = array(
-        'name'    => 'compose_height',
-        'caption' => _("Height of Compose Window"),
-        'type'    => SMOPT_TYPE_INTEGER,
-        'refresh' => SMOPT_REFRESH_ALL,
-        'size'    => SMOPT_SIZE_TINY
-    );
-
-    $optvals[SMOPT_GRP_MESSAGE][] = array(
-        'name'    => 'sig_first',
-        'caption' => _("Append Signature before Reply/Forward Text"),
-        'type'    => SMOPT_TYPE_BOOLEAN,
-        'refresh' => SMOPT_REFRESH_NONE
-    );
-
-    $optvals[SMOPT_GRP_MESSAGE][] = array(
-        'name'    => 'body_quote',
-        'caption' => _("Prefix for Original Message when Replying"),
-        'type'    => SMOPT_TYPE_STRING,
-        'refresh' => SMOPT_REFRESH_NONE,
-        'size'    => SMOPT_SIZE_TINY,
-        'save'    => 'save_option_reply_prefix'
-    );
-
-    $optvals[SMOPT_GRP_MESSAGE][] = array(
-        'name'    => 'reply_focus',
-        'caption' => _("Cursor Position when Replying"),
-        'type'    => SMOPT_TYPE_STRLIST,
-        'refresh' => SMOPT_REFRESH_NONE,
-        'posvals' => array('' => _("To: field"),
-                           'focus' => _("Focus in body"),
-                           'select' => _("Select body"),
-                           'none' => _("No focus"))
-    );
-
-    $optvals[SMOPT_GRP_MESSAGE][] = array(
-        'name'    => 'strip_sigs',
-        'caption' => _("Strip signature when replying"),
-        'type'    => SMOPT_TYPE_BOOLEAN,
-        'refresh' => SMOPT_REFRESH_NONE
-    );
-
-    $optvals[SMOPT_GRP_MESSAGE][] = array(
-        'name'    => 'internal_date_sort',
-        'caption' => _("Sort by Received Date"),
-        'type'    => SMOPT_TYPE_BOOLEAN,
-        'refresh' => SMOPT_REFRESH_ALL
-    );
-    if ($allow_thread_sort == TRUE) {
-        $optvals[SMOPT_GRP_MESSAGE][] = array(
-            'name'    => 'sort_by_ref',
-            'caption' => _("Enable Thread Sort by References Header"),
-            'type'    => SMOPT_TYPE_BOOLEAN,
-            'refresh' => SMOPT_REFRESH_ALL
-        );
     $optvals[SMOPT_GRP_MESSAGE][] = array(
         'name'    => 'delete_prev_next_display',
         'caption' => _("Show 'Delete & Prev/Next' Links"),
@@ -447,7 +343,6 @@ function load_optpage_data_display() {
         'refresh' => SMOPT_REFRESH_ALL
     );
 
-    }
     /* Assemble all this together and return it as our result. */
     $result = array(
         'grps' => $optgrps,
index 85a2bd3cc60c18d6c1c37b6f2113bd6e9b9796e4..0058c3b1e0a066ca340c5d09a172e55d6c8e3ad8 100644 (file)
@@ -40,6 +40,7 @@ define('SMOPT_MODE_LINK', 'link');
 define('SMOPT_PAGE_MAIN', 'main');
 define('SMOPT_PAGE_PERSONAL', 'personal');
 define('SMOPT_PAGE_DISPLAY', 'display');
+define('SMOPT_PAGE_COMPOSE', 'compose');
 define('SMOPT_PAGE_HIGHLIGHT', 'highlight');
 define('SMOPT_PAGE_FOLDER', 'folder');
 define('SMOPT_PAGE_ORDER', 'order');
@@ -166,6 +167,12 @@ switch ($optpage) {
         $optpage_loader = 'load_optpage_data_display';
         $optpage_loadhook = 'optpage_loadhook_display';
         break;
+    case SMOPT_PAGE_COMPOSE:
+        $optpage_name   = _("Compose Preferences");
+        $optpage_file   = SM_PATH . 'include/options/compose.php';
+        $optpage_loader = 'load_optpage_data_compose';
+        $optpage_loadhook = 'optpage_loadhook_compose';
+        break;
     case SMOPT_PAGE_HIGHLIGHT:
         $optpage_name   = _("Message Highlighting");
         $optpage_file   = SM_PATH . 'include/options/highlight.php';
@@ -357,6 +364,14 @@ if ($optpage == SMOPT_PAGE_MAIN) {
         'desc' => _("The order of the message index can be rearranged and changed to contain the headers in any order you want."),
         'js'   => false
     );
+    
+    /* Build a section for Compose Options. */
+    $optpage_blocks[] = array(
+        'name' => _("Compose Preferences"),
+        'url'  => 'options.php?optpage=' . SMOPT_PAGE_COMPOSE,
+        'desc' => _("Control the behaviour and layout of writing new mail messages, replying to and forwarding messages."),
+        'js'   => false
+    );
 
     /* Build a section for plugins wanting to register an optionpage. */
     do_hook('optpage_register_block');
@@ -467,4 +482,4 @@ if ($optpage == SMOPT_PAGE_MAIN) {
 </table>
 </td></tr>
 </table>
-</body></html>
\ No newline at end of file
+</body></html>