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;
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 $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
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
63 $optvals[SMOPT_GRP_CONTACT
][] = array(
65 'caption' => _("Reply To"),
66 'type' => SMOPT_TYPE_STRING
,
67 'refresh' => SMOPT_REFRESH_NONE
,
68 'size' => SMOPT_SIZE_HUGE
71 $identities_link_value = '<A HREF="options_identities.php">'
72 . _("Edit Advanced Identities")
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
83 /*** Load the Reply Citation Options into the array ***/
84 $optgrps[SMOPT_GRP_REPLY
] = _("Reply Citation Options");
85 $optvals[SMOPT_GRP_REPLY
] = array();
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"))
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
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
114 /*** Load the Signature Options into the array ***/
115 $optgrps[SMOPT_GRP_SIG
] = _("Signature Options");
116 $optvals[SMOPT_GRP_SIG
] = array();
118 $optvals[SMOPT_GRP_SIG
][] = array(
119 'name' => 'use_signature',
120 'caption' => _("Use Signature"),
121 'type' => SMOPT_TYPE_BOOLEAN
,
122 'refresh' => SMOPT_REFRESH_NONE
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
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'
141 /* Assemble all this together and return it as our result. */
149 /******************************************************************/
150 /** Define any specialized save functions for this option page. ***/
151 /******************************************************************/
153 function save_option_signature($option) {
154 global $data_dir, $username;
155 setSig($data_dir, $username, $option->new_value
);