c36ed9cf |
1 | <?php |
cd2b7182 |
2 | |
35586184 |
3 | /** |
4 | * options_personal.php |
5 | * |
15e6162e |
6 | * Copyright (c) 1999-2002 The SquirrelMail Project Team |
35586184 |
7 | * Licensed under the GNU GPL. For full terms see the file COPYING. |
8 | * |
9 | * Displays all options relating to personal information |
10 | * |
11 | * $Id$ |
12 | */ |
cbe5423b |
13 | |
14 | require_once('../functions/imap.php'); |
15 | require_once('../functions/array.php'); |
16 | |
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 | |
22 | /* Define the optpage load function for the personal options page. */ |
23 | function load_optpage_data_personal() { |
8a7d0669 |
24 | global $data_dir, $username, $edit_identity, $edit_name; |
cbe5423b |
25 | global $full_name, $reply_to, $email_address; |
26 | |
27 | /* Set the values of some global variables. */ |
28 | $full_name = getPref($data_dir, $username, 'full_name'); |
29 | $reply_to = getPref($data_dir, $username, 'reply_to'); |
30 | $email_address = getPref($data_dir, $username, 'email_address'); |
bbcafebd |
31 | |
32 | /* Build a simple array into which we will build options. */ |
33 | $optgrps = array(); |
34 | $optvals = array(); |
35 | |
36 | /******************************************************/ |
37 | /* LOAD EACH GROUP OF OPTIONS INTO THE OPTIONS ARRAY. */ |
38 | /******************************************************/ |
bbcafebd |
39 | |
8a2e4d5b |
40 | /*** Load the Contact Information Options into the array ***/ |
bbcafebd |
41 | $optgrps[SMOPT_GRP_CONTACT] = _("Name and Address Options"); |
42 | $optvals[SMOPT_GRP_CONTACT] = array(); |
43 | |
44 | /* Build a simple array into which we will build options. */ |
45 | $optvals = array(); |
46 | |
8a7d0669 |
47 | if ($edit_identity || $edit_name) { |
48 | $optvals[SMOPT_GRP_CONTACT][] = array( |
49 | 'name' => 'full_name', |
50 | 'caption' => _("Full Name"), |
51 | 'type' => SMOPT_TYPE_STRING, |
52 | 'refresh' => SMOPT_REFRESH_NONE, |
53 | 'size' => SMOPT_SIZE_HUGE |
54 | ); |
55 | } else { |
56 | $optvals[SMOPT_GRP_CONTACT][] = array( |
57 | 'name' => 'full_name', |
58 | 'caption' => _("Full Name"), |
59 | 'type' => SMOPT_TYPE_COMMENT, |
60 | 'refresh' => SMOPT_REFRESH_NONE, |
61 | 'comment' => $full_name |
62 | ); |
63 | } |
bbcafebd |
64 | |
8a7d0669 |
65 | if ($edit_identity) { |
66 | $optvals[SMOPT_GRP_CONTACT][] = array( |
67 | 'name' => 'email_address', |
68 | 'caption' => _("Email Address"), |
69 | 'type' => SMOPT_TYPE_STRING, |
70 | 'refresh' => SMOPT_REFRESH_NONE, |
71 | 'size' => SMOPT_SIZE_HUGE |
72 | ); |
73 | } else { |
74 | $optvals[SMOPT_GRP_CONTACT][] = array( |
75 | 'name' => 'email_address', |
76 | 'caption' => _("Email Address"), |
77 | 'type' => SMOPT_TYPE_COMMENT, |
78 | 'refresh' => SMOPT_REFRESH_NONE, |
79 | 'comment' => $email_address |
80 | ); |
81 | } |
bbcafebd |
82 | |
83 | $optvals[SMOPT_GRP_CONTACT][] = array( |
84 | 'name' => 'reply_to', |
85 | 'caption' => _("Reply To"), |
86 | 'type' => SMOPT_TYPE_STRING, |
87 | 'refresh' => SMOPT_REFRESH_NONE, |
88 | 'size' => SMOPT_SIZE_HUGE |
89 | ); |
90 | |
8a7d0669 |
91 | if ($edit_identity) { |
92 | $identities_link_value = '<A HREF="options_identities.php">' |
93 | . _("Edit Advanced Identities") |
94 | . '</A> ' |
95 | . _("(discards changes made on this form so far)"); |
96 | $optvals[SMOPT_GRP_CONTACT][] = array( |
97 | 'name' => 'identities_link', |
98 | 'caption' => _("Multiple Identities"), |
99 | 'type' => SMOPT_TYPE_COMMENT, |
100 | 'refresh' => SMOPT_REFRESH_NONE, |
101 | 'comment' => $identities_link_value |
102 | ); |
103 | } |
8a2e4d5b |
104 | |
105 | /*** Load the Reply Citation Options into the array ***/ |
106 | $optgrps[SMOPT_GRP_REPLY] = _("Reply Citation Options"); |
bbcafebd |
107 | $optvals[SMOPT_GRP_REPLY] = array(); |
108 | |
109 | $optvals[SMOPT_GRP_REPLY][] = array( |
110 | 'name' => 'reply_citation_style', |
111 | 'caption' => _("Reply Citation Style"), |
112 | 'type' => SMOPT_TYPE_STRLIST, |
113 | 'refresh' => SMOPT_REFRESH_NONE, |
114 | 'posvals' => array(SMPREF_NONE => _("No Citation"), |
115 | 'author_said' => _("AUTHOR Said"), |
116 | 'quote_who' => _("Quote Who XML"), |
117 | 'user-defined' => _("User-Defined")) |
118 | ); |
119 | |
120 | $optvals[SMOPT_GRP_REPLY][] = array( |
121 | 'name' => 'reply_citation_start', |
122 | 'caption' => _("User-Defined Citation Start"), |
123 | 'type' => SMOPT_TYPE_STRING, |
124 | 'refresh' => SMOPT_REFRESH_NONE, |
125 | 'size' => SMOPT_SIZE_MEDIUM |
126 | ); |
127 | |
128 | $optvals[SMOPT_GRP_REPLY][] = array( |
129 | 'name' => 'reply_citation_end', |
130 | 'caption' => _("User-Defined Citation End"), |
131 | 'type' => SMOPT_TYPE_STRING, |
132 | 'refresh' => SMOPT_REFRESH_NONE, |
133 | 'size' => SMOPT_SIZE_MEDIUM |
134 | ); |
135 | |
8a2e4d5b |
136 | /*** Load the Signature Options into the array ***/ |
137 | $optgrps[SMOPT_GRP_SIG] = _("Signature Options"); |
138 | $optvals[SMOPT_GRP_SIG] = array(); |
bbcafebd |
139 | |
8a2e4d5b |
140 | $optvals[SMOPT_GRP_SIG][] = array( |
bbcafebd |
141 | 'name' => 'use_signature', |
142 | 'caption' => _("Use Signature"), |
143 | 'type' => SMOPT_TYPE_BOOLEAN, |
144 | 'refresh' => SMOPT_REFRESH_NONE |
145 | ); |
146 | |
8a2e4d5b |
147 | $optvals[SMOPT_GRP_SIG][] = array( |
bbcafebd |
148 | 'name' => 'prefix_sig', |
149 | 'caption' => _("Prefix Signature with '-- ' Line"), |
150 | 'type' => SMOPT_TYPE_BOOLEAN, |
151 | 'refresh' => SMOPT_REFRESH_NONE |
152 | ); |
153 | |
8a2e4d5b |
154 | $optvals[SMOPT_GRP_SIG][] = array( |
bbcafebd |
155 | 'name' => 'signature_abs', |
156 | 'caption' => _("Signature"), |
157 | 'type' => SMOPT_TYPE_TEXTAREA, |
158 | 'refresh' => SMOPT_REFRESH_NONE, |
cbe5423b |
159 | 'size' => SMOPT_SIZE_MEDIUM, |
160 | 'save' => 'save_option_signature' |
bbcafebd |
161 | ); |
162 | |
cbe5423b |
163 | /* Assemble all this together and return it as our result. */ |
164 | $result = array( |
165 | 'grps' => $optgrps, |
166 | 'vals' => $optvals |
167 | ); |
168 | return ($result); |
169 | } |
e7db48af |
170 | |
cbe5423b |
171 | /******************************************************************/ |
172 | /** Define any specialized save functions for this option page. ***/ |
173 | /******************************************************************/ |
e7db48af |
174 | |
cbe5423b |
175 | function save_option_signature($option) { |
176 | global $data_dir, $username; |
177 | setSig($data_dir, $username, $option->new_value); |
178 | } |
e7db48af |
179 | |
cbe5423b |
180 | ?> |