contact_admin_edit_validate
modules/contact/contact.module, строка 203
- Версии
- 5
contact_admin_edit_validate(
$form_id,$form_values)- 6
contact_admin_edit_validate($form, &$form_state)
Валидатор формы страницы редактирования категорий контактов.
Код
<?php
function contact_admin_edit_validate($form_id, $form_values) {
if (empty($form_values['category'])) {
form_set_error('category', t('You must enter a category.'));
}
if (empty($form_values['recipients'])) {
form_set_error('recipients', t('You must enter one or more recipients.'));
}
else {
$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' => $recipient)));
}
}
}
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии