function mass_contact_admin_edit_validate in Mass Contact 5
Same name and namespace in other branches
- 5.2 mass_contact.module \mass_contact_admin_edit_validate()
- 6 mass_contact.module \mass_contact_admin_edit_validate()
- 7 mass_contact.admin.inc \mass_contact_admin_edit_validate()
Validate the mass_contact category edit page form submission.
File
- ./
mass_contact.module, line 171 - Enables mass contact form to selected roles.
Code
function mass_contact_admin_edit_validate($form_id, $form_values) {
if (empty($form_values['category'])) {
form_set_error('category', t('You must enter a category.'));
}
$recipients = $form_values['recipients'];
foreach ($recipients as $checkr) {
if ($checkr > 1) {
return;
}
}
form_set_error('recipients', t('You must enter one or more recipients.'));
}