You are here

function hosting_task_backup_delete_form_validate in Hosting 7.4

Same name and namespace in other branches
  1. 6.2 site/hosting_site.backups.inc \hosting_task_backup_delete_form_validate()
  2. 7.3 site/hosting_site.backups.inc \hosting_task_backup_delete_form_validate()

Implements hosting_task_TASK_TYPE_form_validate().

File

site/hosting_site.backups.inc, line 88
Site backup functions.

Code

function hosting_task_backup_delete_form_validate($form, &$form_state) {
  if (isset($form['parameters']['no_backups'])) {
    form_set_error('no_backups', t('There are no valid backups available.'));
  }

  // Filter out unchecked backups.
  if (isset($form_state['values']['parameters'])) {
    $form_state['values']['parameters'] = array_filter($form_state['values']['parameters']);
    if (!count($form_state['values']['parameters'])) {
      form_set_error('no_backups', t('No backups were selected for deletion.'));
    }
  }
}