You are here

function hosting_task_restore_form in Hostmaster (Aegir) 6

Customize the task confirmation form for restore.

This adds the backup listing to the confirmation dialog.

File

modules/hosting/task/hosting_task.module, line 420
Web server node type is defined here.

Code

function hosting_task_restore_form($node) {
  $list = hosting_site_backup_list($node->nid);
  if (sizeof($list)) {
    $form['bid'] = array(
      '#type' => 'radios',
      '#title' => t('Backups'),
      '#options' => $list,
      '#required' => TRUE,
    );
  }
  else {
    $form['no_backups'] = array(
      '#type' => 'item',
      '#title' => t('Backups'),
      '#value' => t('There are no valid backups available.'),
    );
  }
  return $form;
}