6 * Copyright (c) 1999-2005 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
9 * Displays all options concerning composing of new messages
12 * @package squirrelmail
15 /** Define the group constants for this options page. */
16 define('SMOPT_GRP_COMPOSE', 0);
17 define('SMOPT_GRP_COMPOSE_REPLY', 1);
20 * This function builds an array with all the information about
21 * the options available to the user, and returns it. The options
22 * are grouped by the groups in which they are displayed.
23 * For each option, the following information is stored:
24 * - name: the internal (variable) name
25 * - caption: the description of the option in the UI
26 * - type: one of SMOPT_TYPE_*
27 * - refresh: one of SMOPT_REFRESH_*
28 * - size: one of SMOPT_SIZE_*
29 * - save: the name of a function to call when saving this option
30 * @return array all option information
32 function load_optpage_data_compose() {
34 /* Build a simple array into which we will build options. */
38 /******************************************************/
39 /* LOAD EACH GROUP OF OPTIONS INTO THE OPTIONS ARRAY. */
40 /******************************************************/
42 /*** Load the General Compose Options into the array ***/
43 $optgrps[SMOPT_GRP_COMPOSE
] = _("General Message Composition");
44 $optvals[SMOPT_GRP_COMPOSE
] = array();
46 $optvals[SMOPT_GRP_COMPOSE
][] = array(
47 'name' => 'editor_size',
48 'caption' => _("Width of Editor Window"),
49 'type' => SMOPT_TYPE_INTEGER
,
50 'refresh' => SMOPT_REFRESH_NONE
,
51 'size' => SMOPT_SIZE_TINY
54 $optvals[SMOPT_GRP_COMPOSE
][] = array(
55 'name' => 'editor_height',
56 'caption' => _("Height of Editor Window"),
57 'type' => SMOPT_TYPE_INTEGER
,
58 'refresh' => SMOPT_REFRESH_NONE
,
59 'size' => SMOPT_SIZE_TINY
62 $optvals[SMOPT_GRP_COMPOSE
][] = array(
63 'name' => 'location_of_buttons',
64 'caption' => _("Location of Buttons when Composing"),
65 'type' => SMOPT_TYPE_STRLIST
,
66 'refresh' => SMOPT_REFRESH_NONE
,
67 'posvals' => array(SMPREF_LOC_TOP
=> _("Before headers"),
68 SMPREF_LOC_BETWEEN
=> _("Between headers and message body"),
69 SMPREF_LOC_BOTTOM
=> _("After message body"))
73 $optvals[SMOPT_GRP_COMPOSE
][] = array(
74 'name' => 'use_javascript_addr_book',
75 'caption' => _("Addressbook Display Format"),
76 'type' => SMOPT_TYPE_STRLIST
,
77 'refresh' => SMOPT_REFRESH_NONE
,
78 'posvals' => array('1' => _("Javascript"),
83 $optvals[SMOPT_GRP_COMPOSE
][] = array(
84 'name' => 'compose_new_win',
85 'caption' => _("Compose Messages in New Window"),
86 'type' => SMOPT_TYPE_BOOLEAN
,
87 'refresh' => SMOPT_REFRESH_ALL
90 $optvals[SMOPT_GRP_COMPOSE
][] = array(
91 'name' => 'compose_width',
92 'caption' => _("Width of Compose Window"),
93 'type' => SMOPT_TYPE_INTEGER
,
94 'refresh' => SMOPT_REFRESH_ALL
,
95 'size' => SMOPT_SIZE_TINY
98 $optvals[SMOPT_GRP_COMPOSE
][] = array(
99 'name' => 'compose_height',
100 'caption' => _("Height of Compose Window"),
101 'type' => SMOPT_TYPE_INTEGER
,
102 'refresh' => SMOPT_REFRESH_ALL
,
103 'size' => SMOPT_SIZE_TINY
107 /*** Load the General Options into the array ***/
108 $optgrps[SMOPT_GRP_COMPOSE_REPLY
] = _("Replying and Forwarding Messages");
109 $optvals[SMOPT_GRP_COMPOSE_REPLY
] = array();
111 $optvals[SMOPT_GRP_COMPOSE_REPLY
][] = array(
112 'name' => 'forward_cc',
113 'caption' => _("Include CCs when Forwarding Messages"),
114 'type' => SMOPT_TYPE_BOOLEAN
,
115 'refresh' => SMOPT_REFRESH_NONE
118 $optvals[SMOPT_GRP_COMPOSE_REPLY
][] = array(
119 'name' => 'include_self_reply_all',
120 'caption' => _("Include Me in CC when I Reply All"),
121 'type' => SMOPT_TYPE_BOOLEAN
,
122 'refresh' => SMOPT_REFRESH_NONE
125 $optvals[SMOPT_GRP_COMPOSE_REPLY
][] = array(
126 'name' => 'sig_first',
127 'caption' => _("Append Signature before Reply/Forward Text"),
128 'type' => SMOPT_TYPE_BOOLEAN
,
129 'refresh' => SMOPT_REFRESH_NONE
132 $optvals[SMOPT_GRP_COMPOSE_REPLY
][] = array(
133 'name' => 'body_quote',
134 'caption' => _("Prefix for Original Message when Replying"),
135 'type' => SMOPT_TYPE_STRING
,
136 'refresh' => SMOPT_REFRESH_NONE
,
137 'size' => SMOPT_SIZE_TINY
,
138 'save' => 'save_option_reply_prefix'
141 $optvals[SMOPT_GRP_COMPOSE_REPLY
][] = array(
142 'name' => 'reply_focus',
143 'caption' => _("Cursor Position when Replying"),
144 'type' => SMOPT_TYPE_STRLIST
,
145 'refresh' => SMOPT_REFRESH_NONE
,
146 'posvals' => array('' => _("To: field"),
147 'focus' => _("Focus in body"),
148 'select' => _("Select body"),
149 'none' => _("No focus"))
152 $optvals[SMOPT_GRP_COMPOSE_REPLY
][] = array(
153 'name' => 'strip_sigs',
154 'caption' => _("Strip signature when replying"),
155 'type' => SMOPT_TYPE_BOOLEAN
,
156 'refresh' => SMOPT_REFRESH_NONE
159 /* Assemble all this together and return it as our result. */
167 /******************************************************************/
168 /** Define any specialized save functions for this option page. ***/
170 /** You must add every function that is set in save parameter ***/
171 /******************************************************************/
174 * This function saves the reply prefix (body_quote) character(s)
175 * @param object $option
177 function save_option_reply_prefix($option) {
179 // save as "NONE" if it was blanked out
181 if (empty($option->new_value
)) $option->new_value
= 'NONE';
184 // Save the option like normal.
186 save_option($option);