You are here

function avatar_selection_delete_form_validate in Avatar Selection 5.2

Same name and namespace in other branches
  1. 5 avatar_selection.module \avatar_selection_delete_form_validate()
  2. 6 avatar_selection.admin.inc \avatar_selection_delete_form_validate()
  3. 7 avatar_selection.admin.inc \avatar_selection_delete_form_validate()

Validate the submission.

Check if Delete has been chosen AND a checkbox has been selected.

Parameters

$form_id: The form id.

$form_values: Array containing the form values submitted.

File

./avatar_selection.module, line 945
The Avatar Selection module allows the user to pick an avatar image from a list already loaded by an administrative user, and to the administrator to disable uploading other avatar files by the user.

Code

function avatar_selection_delete_form_validate($form_id, $form_values) {
  if ($form_values['op'] == t('Delete')) {
    if (count(array_filter($form_values['images'])) == 0) {
      form_set_error('images', t('Please select images to delete.'));
    }
  }
}