You are here

function hosting_task_restore_form in Hosting 7.3

Same name and namespace in other branches
  1. 5 task/hosting_task.module \hosting_task_restore_form()
  2. 6.2 task/hosting_task.module \hosting_task_restore_form()
  3. 7.4 task/hosting_task.module \hosting_task_restore_form()

Customize the task confirmation form for restore.

This adds the backup listing to the confirmation dialog.

File

task/hosting_task.module, line 648
Web server node type is defined here.

Code

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