squirrelmail-Bugs-488332
[squirrelmail.git] / src / options_personal.php
1 <?php
2
3 /**
4 * options_personal.php
5 *
6 * Copyright (c) 1999-2001 The SquirrelMail Development Team
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 */
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() {
24 global $data_dir, $username;
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');
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 /******************************************************/
39
40 /*** Load the Contact Information Options into the array ***/
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
47 $optvals[SMOPT_GRP_CONTACT][] = array(
48 'name' => 'full_name',
49 'caption' => _("Full Name"),
50 'type' => SMOPT_TYPE_STRING,
51 'refresh' => SMOPT_REFRESH_NONE,
52 'size' => SMOPT_SIZE_HUGE
53 );
54
55 $optvals[SMOPT_GRP_CONTACT][] = array(
56 'name' => 'email_address',
57 'caption' => _("Email Address"),
58 'type' => SMOPT_TYPE_STRING,
59 'refresh' => SMOPT_REFRESH_NONE,
60 'size' => SMOPT_SIZE_HUGE
61 );
62
63 $optvals[SMOPT_GRP_CONTACT][] = array(
64 'name' => 'reply_to',
65 'caption' => _("Reply To"),
66 'type' => SMOPT_TYPE_STRING,
67 'refresh' => SMOPT_REFRESH_NONE,
68 'size' => SMOPT_SIZE_HUGE
69 );
70
71 $identities_link_value = '<A HREF="options_identities.php">'
72 . _("Edit Advanced Identities")
73 . '</A> '
74 . _("(discards changes made on this form so far)");
75 $optvals[SMOPT_GRP_CONTACT][] = array(
76 'name' => 'identities_link',
77 'caption' => _("Multiple Identities"),
78 'type' => SMOPT_TYPE_COMMENT,
79 'refresh' => SMOPT_REFRESH_NONE,
80 'comment' => $identities_link_value
81 );
82
83 /*** Load the Reply Citation Options into the array ***/
84 $optgrps[SMOPT_GRP_REPLY] = _("Reply Citation Options");
85 $optvals[SMOPT_GRP_REPLY] = array();
86
87 $optvals[SMOPT_GRP_REPLY][] = array(
88 'name' => 'reply_citation_style',
89 'caption' => _("Reply Citation Style"),
90 'type' => SMOPT_TYPE_STRLIST,
91 'refresh' => SMOPT_REFRESH_NONE,
92 'posvals' => array(SMPREF_NONE => _("No Citation"),
93 'author_said' => _("AUTHOR Said"),
94 'quote_who' => _("Quote Who XML"),
95 'user-defined' => _("User-Defined"))
96 );
97
98 $optvals[SMOPT_GRP_REPLY][] = array(
99 'name' => 'reply_citation_start',
100 'caption' => _("User-Defined Citation Start"),
101 'type' => SMOPT_TYPE_STRING,
102 'refresh' => SMOPT_REFRESH_NONE,
103 'size' => SMOPT_SIZE_MEDIUM
104 );
105
106 $optvals[SMOPT_GRP_REPLY][] = array(
107 'name' => 'reply_citation_end',
108 'caption' => _("User-Defined Citation End"),
109 'type' => SMOPT_TYPE_STRING,
110 'refresh' => SMOPT_REFRESH_NONE,
111 'size' => SMOPT_SIZE_MEDIUM
112 );
113
114 /*** Load the Signature Options into the array ***/
115 $optgrps[SMOPT_GRP_SIG] = _("Signature Options");
116 $optvals[SMOPT_GRP_SIG] = array();
117
118 $optvals[SMOPT_GRP_SIG][] = array(
119 'name' => 'use_signature',
120 'caption' => _("Use Signature"),
121 'type' => SMOPT_TYPE_BOOLEAN,
122 'refresh' => SMOPT_REFRESH_NONE
123 );
124
125 $optvals[SMOPT_GRP_SIG][] = array(
126 'name' => 'prefix_sig',
127 'caption' => _("Prefix Signature with '-- ' Line"),
128 'type' => SMOPT_TYPE_BOOLEAN,
129 'refresh' => SMOPT_REFRESH_NONE
130 );
131
132 $optvals[SMOPT_GRP_SIG][] = array(
133 'name' => 'signature_abs',
134 'caption' => _("Signature"),
135 'type' => SMOPT_TYPE_TEXTAREA,
136 'refresh' => SMOPT_REFRESH_NONE,
137 'size' => SMOPT_SIZE_MEDIUM,
138 'save' => 'save_option_signature'
139 );
140
141 /* Assemble all this together and return it as our result. */
142 $result = array(
143 'grps' => $optgrps,
144 'vals' => $optvals
145 );
146 return ($result);
147 }
148
149 /******************************************************************/
150 /** Define any specialized save functions for this option page. ***/
151 /******************************************************************/
152
153 function save_option_signature($option) {
154 global $data_dir, $username;
155 setSig($data_dir, $username, $option->new_value);
156 }
157
158 ?>