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);
22 /* Define the optpage load function for the personal options page. */
23 function load_optpage_data_personal() {
24 global $data_dir, $username, $edit_identity, $edit_name;
25 global $full_name, $reply_to, $email_address;
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');
32 /* Build a simple array into which we will build options. */
36 /******************************************************/
37 /* LOAD EACH GROUP OF OPTIONS INTO THE OPTIONS ARRAY. */
38 /******************************************************/
40 /*** Load the Contact Information Options into the array ***/
41 $optgrps[SMOPT_GRP_CONTACT
] = _("Name and Address Options");
42 $optvals[SMOPT_GRP_CONTACT
] = array();
44 /* Build a simple array into which we will build options. */
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
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
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
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
83 $optvals[SMOPT_GRP_CONTACT
][] = array(
85 'caption' => _("Reply To"),
86 'type' => SMOPT_TYPE_STRING
,
87 'refresh' => SMOPT_REFRESH_NONE
,
88 'size' => SMOPT_SIZE_HUGE
92 $identities_link_value = '<A HREF="options_identities.php">'
93 . _("Edit Advanced Identities")
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
105 /*** Load the Reply Citation Options into the array ***/
106 $optgrps[SMOPT_GRP_REPLY
] = _("Reply Citation Options");
107 $optvals[SMOPT_GRP_REPLY
] = array();
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"))
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
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
136 /*** Load the Signature Options into the array ***/
137 $optgrps[SMOPT_GRP_SIG
] = _("Signature Options");
138 $optvals[SMOPT_GRP_SIG
] = array();
140 $optvals[SMOPT_GRP_SIG
][] = array(
141 'name' => 'use_signature',
142 'caption' => _("Use Signature"),
143 'type' => SMOPT_TYPE_BOOLEAN
,
144 'refresh' => SMOPT_REFRESH_NONE
147 $optvals[SMOPT_GRP_SIG
][] = array(
148 'name' => 'prefix_sig',
149 'caption' => _("Prefix Signature with '-- ' Line"),
150 'type' => SMOPT_TYPE_BOOLEAN
,
151 'refresh' => SMOPT_REFRESH_NONE
154 $optvals[SMOPT_GRP_SIG
][] = array(
155 'name' => 'signature_abs',
156 'caption' => _("Signature"),
157 'type' => SMOPT_TYPE_TEXTAREA
,
158 'refresh' => SMOPT_REFRESH_NONE
,
159 'size' => SMOPT_SIZE_MEDIUM
,
160 'save' => 'save_option_signature'
163 /* Assemble all this together and return it as our result. */
171 /******************************************************************/
172 /** Define any specialized save functions for this option page. ***/
173 /******************************************************************/
175 function save_option_signature($option) {
176 global $data_dir, $username;
177 setSig($data_dir, $username, $option->new_value
);