return t('Enables the use of both personal and site-wide contact forms.');
case 'admin/contact':
return t('This page lets you setup <a href="%form">your site-wide contact form</a>. To do so, add one or more subjects. You can associate different recipients with each subject to route e-mails to different people. For example, you can route website feedback to the webmaster and direct product information requests to the sales department. On the <a href="%settings">settings page</a> you can customize the information shown above the contact form. This can be useful to provide additional contact information such as your postal address and telephone number.', array('%settings' => url('admin/settings/contact'), '%form' => url('contact', NULL, NULL, TRUE)));
$output = form_textarea(t('Additional information'), 'contact_form_information', variable_get('contact_form_information', t('You can leave us a message using the contact form below.')), 70, 8, t('Information to show on the <a href="%form">contact page</a>. Can be anything from submission guidelines to your postal address or telephone number.', array('%form' => url('contact'))));
return array(array('title' => t('Contact settings'), 'data' => form_checkbox(t('Personal contact form'), 'contact', 1, $edit['contact'], t('Allow other users to contact you by e-mail via <a href="%url">your personal contact form</a>. Note that your e-mail address is not made public and that privileged users such as site administrators are able to contact you even if you choose not to enable this feature.', array('%url' => "user/$user->uid/contact"))), 'weight' => 2));
$output = t('You need to provide a valid e-mail address to contact other users. Please edit your <a href="%url">user information</a>.', array('%url' => url("user/$user->uid/edit")));
$message[] = t("%name (%name-url) has sent you a message via your contact form (%form-url) at %site.", array('%name' => $user->name, '%name-url' => url("user/$user->uid", NULL, NULL, TRUE), '%form-url' => url($_GET['q'], NULL, NULL, TRUE), '%site' => variable_get('site_name', 'drupal')));
$message[] = t("If you don't want to receive such e-mails, you can change your settings at %url.", array('%url' => url("user/$account->uid", NULL, NULL, TRUE)));
$form .= form_textarea(t('Recipients'), 'recipients', $subject->recipients, 50, 4, t("Example: 'webmaster@yoursite.com' or 'sales@yoursite.com'. To specify multiple repecients, separate each e-mail address with a comma."), NULL, TRUE);
$form .= form_textarea(t('Auto-reply'), 'reply', $subject->reply, 50, 10, t("Optional auto-reply. Leave empty if you don't want to send the user an auto-reply message."));
$form .= form_submit(t('Submit'));
print theme('page', form($form));
}
function contact_admin_delete($subject) {
if ($_POST['op'] != t('Delete')) {
print theme('page', theme('confirm',
t('Are you sure you want to delete %subject?', array('%subject' => theme('placeholder', $subject))),
'admin/contact/delete/'. $subject,
t('This action cannot be undone.'),
t('Delete'),
t('Cancel')));
}
else {
db_query("DELETE FROM {contact} WHERE subject = '%s'", $subject);
drupal_goto('admin/contact');
}
}
function contact_admin() {
$result = db_query('SELECT subject, recipients FROM {contact} ORDER BY subject');
$message[] = t("%name sent a message using the contact form at %form:", array('%name' => $edit['name'], '%form' => url($_GET['q'], NULL, NULL, TRUE)));