6 * Copyright (c) 1999-2002 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
9 * Displays all options relating to personal information
14 require_once('../functions/imap.php');
15 require_once('../functions/array.php');
17 /* Define the group constants for the personal options page. */
18 define('SMOPT_GRP_CONTACT', 0);
19 define('SMOPT_GRP_REPLY', 1);
20 define('SMOPT_GRP_SIG', 2);
21 define('SMOPT_GRP_TZ', 3);
23 /* Define the optpage load function for the personal options page. */
24 function load_optpage_data_personal() {
25 global $data_dir, $username, $edit_identity, $edit_name,
26 $full_name, $reply_to, $email_address, $signature;
28 /* Set the values of some global variables. */
29 $full_name = getPref($data_dir, $username, 'full_name');
30 $reply_to = getPref($data_dir, $username, 'reply_to');
31 $email_address = getPref($data_dir, $username, 'email_address');
32 $signature = getSig($data_dir, $username, 'g');
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 Contact Information Options into the array ***/
43 $optgrps[SMOPT_GRP_CONTACT
] = _("Name and Address Options");
44 $optvals[SMOPT_GRP_CONTACT
] = array();
46 /* Build a simple array into which we will build options. */
49 if ($edit_identity ||
$edit_name) {
50 $optvals[SMOPT_GRP_CONTACT
][] = array(
51 'name' => 'full_name',
52 'caption' => _("Full Name"),
53 'type' => SMOPT_TYPE_STRING
,
54 'refresh' => SMOPT_REFRESH_NONE
,
55 'size' => SMOPT_SIZE_HUGE
58 $optvals[SMOPT_GRP_CONTACT
][] = array(
59 'name' => 'full_name',
60 'caption' => _("Full Name"),
61 'type' => SMOPT_TYPE_COMMENT
,
62 'refresh' => SMOPT_REFRESH_NONE
,
63 'comment' => $full_name
68 $optvals[SMOPT_GRP_CONTACT
][] = array(
69 'name' => 'email_address',
70 'caption' => _("Email Address"),
71 'type' => SMOPT_TYPE_STRING
,
72 'refresh' => SMOPT_REFRESH_NONE
,
73 'size' => SMOPT_SIZE_HUGE
76 $optvals[SMOPT_GRP_CONTACT
][] = array(
77 'name' => 'email_address',
78 'caption' => _("Email Address"),
79 'type' => SMOPT_TYPE_COMMENT
,
80 'refresh' => SMOPT_REFRESH_NONE
,
81 'comment' => $email_address
85 $optvals[SMOPT_GRP_CONTACT
][] = array(
87 'caption' => _("Reply To"),
88 'type' => SMOPT_TYPE_STRING
,
89 'refresh' => SMOPT_REFRESH_NONE
,
90 'size' => SMOPT_SIZE_HUGE
93 $optvals[SMOPT_GRP_CONTACT
][] = array(
94 'name' => 'signature',
95 'caption' => _("Signature"),
96 'type' => SMOPT_TYPE_TEXTAREA
,
97 'refresh' => SMOPT_REFRESH_NONE
,
98 'size' => SMOPT_SIZE_MEDIUM
,
99 'save' => 'save_option_signature'
102 if ($edit_identity) {
103 $identities_link_value = '<A HREF="options_identities.php">'
104 . _("Edit Advanced Identities")
106 . _("(discards changes made on this form so far)");
107 $optvals[SMOPT_GRP_CONTACT
][] = array(
108 'name' => 'identities_link',
109 'caption' => _("Multiple Identities"),
110 'type' => SMOPT_TYPE_COMMENT
,
111 'refresh' => SMOPT_REFRESH_NONE
,
112 'comment' => $identities_link_value
116 $TZ_ARRAY[SMPREF_NONE
] = _("Same as server");
117 $fd = fopen('../locale/timezones.cfg','r');
118 while (!feof ($fd)) {
119 $zone = fgets($fd, 1024);
122 $TZ_ARRAY["$zone"] = "$zone";
127 $optgrps[SMOPT_GRP_TZ
] = _("Timezone Options");
128 $optvals[SMOPT_GRP_TZ
] = array();
130 $optvals[SMOPT_GRP_TZ
][] = array(
131 'name' => 'timezone',
132 'caption' => _("Your current timezone"),
133 'type' => SMOPT_TYPE_STRLIST
,
134 'refresh' => SMOPT_REFRESH_NONE
,
135 'posvals' => $TZ_ARRAY
138 /*** Load the Reply Citation Options into the array ***/
139 $optgrps[SMOPT_GRP_REPLY
] = _("Reply Citation Options");
140 $optvals[SMOPT_GRP_REPLY
] = array();
142 $optvals[SMOPT_GRP_REPLY
][] = array(
143 'name' => 'reply_citation_style',
144 'caption' => _("Reply Citation Style"),
145 'type' => SMOPT_TYPE_STRLIST
,
146 'refresh' => SMOPT_REFRESH_NONE
,
147 'posvals' => array(SMPREF_NONE
=> _("No Citation"),
148 'author_said' => _("AUTHOR Said"),
149 'quote_who' => _("Quote Who XML"),
150 'user-defined' => _("User-Defined"))
153 $optvals[SMOPT_GRP_REPLY
][] = array(
154 'name' => 'reply_citation_start',
155 'caption' => _("User-Defined Citation Start"),
156 'type' => SMOPT_TYPE_STRING
,
157 'refresh' => SMOPT_REFRESH_NONE
,
158 'size' => SMOPT_SIZE_MEDIUM
161 $optvals[SMOPT_GRP_REPLY
][] = array(
162 'name' => 'reply_citation_end',
163 'caption' => _("User-Defined Citation End"),
164 'type' => SMOPT_TYPE_STRING
,
165 'refresh' => SMOPT_REFRESH_NONE
,
166 'size' => SMOPT_SIZE_MEDIUM
169 /*** Load the Signature Options into the array ***/
170 $optgrps[SMOPT_GRP_SIG
] = _("Signature Options");
171 $optvals[SMOPT_GRP_SIG
] = array();
173 $optvals[SMOPT_GRP_SIG
][] = array(
174 'name' => 'use_signature',
175 'caption' => _("Use Signature"),
176 'type' => SMOPT_TYPE_BOOLEAN
,
177 'refresh' => SMOPT_REFRESH_NONE
180 $optvals[SMOPT_GRP_SIG
][] = array(
181 'name' => 'prefix_sig',
182 'caption' => _("Prefix Signature with '-- ' Line"),
183 'type' => SMOPT_TYPE_BOOLEAN
,
184 'refresh' => SMOPT_REFRESH_NONE
187 /* Assemble all this together and return it as our result. */
195 /******************************************************************/
196 /** Define any specialized save functions for this option page. ***/
197 /******************************************************************/
199 function save_option_signature($option) {
200 global $data_dir, $username;
201 setSig($data_dir, $username, 'g', $option->new_value
);