Skip to content
Snippets Groups Projects
Commit d12faf54 authored by Gerhard Killesreiter's avatar Gerhard Killesreiter
Browse files

#54151, nicer formatting for contact.module, patch by Zen.

parent dae2bdbb
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -95,8 +95,12 @@ function contact_menu($may_cache) {
}
else {
if (arg(0) == 'user' && is_numeric(arg(1))) {
$items[] = array('path' => "user/". arg(1) ."/contact", 'title' => t('contact'),
'callback' => 'contact_mail_user', 'type' => MENU_LOCAL_TASK, 'weight' => 2);
$items[] = array('path' => "user/". arg(1) ."/contact",
'title' => t('contact'),
'callback' => 'contact_mail_user',
'type' => MENU_LOCAL_TASK,
'weight' => 2,
);
}
}
......@@ -201,7 +205,7 @@ function contact_admin_edit_validate($form_id, $form_values) {
$recipients = explode(',', $form_values['recipients']);
foreach($recipients as $recipient) {
if (!valid_email_address(trim($recipient))) {
form_set_error('recipients',t('%recipient is an invalid e-mail address.', array('%recipient' => theme('placeholder', $recipient))));
form_set_error('recipients', t('%recipient is an invalid e-mail address.', array('%recipient' => theme('placeholder', $recipient))));
}
}
}
......
......@@ -95,8 +95,12 @@ function contact_menu($may_cache) {
}
else {
if (arg(0) == 'user' && is_numeric(arg(1))) {
$items[] = array('path' => "user/". arg(1) ."/contact", 'title' => t('contact'),
'callback' => 'contact_mail_user', 'type' => MENU_LOCAL_TASK, 'weight' => 2);
$items[] = array('path' => "user/". arg(1) ."/contact",
'title' => t('contact'),
'callback' => 'contact_mail_user',
'type' => MENU_LOCAL_TASK,
'weight' => 2,
);
}
}
......@@ -201,7 +205,7 @@ function contact_admin_edit_validate($form_id, $form_values) {
$recipients = explode(',', $form_values['recipients']);
foreach($recipients as $recipient) {
if (!valid_email_address(trim($recipient))) {
form_set_error('recipients',t('%recipient is an invalid e-mail address.', array('%recipient' => theme('placeholder', $recipient))));
form_set_error('recipients', t('%recipient is an invalid e-mail address.', array('%recipient' => theme('placeholder', $recipient))));
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment