public function BackupMigrateQuickBackupForm::buildForm in Backup and Migrate 8.4
Same name and namespace in other branches
- 5.0.x src/Form/BackupMigrateQuickBackupForm.php \Drupal\backup_migrate\Form\BackupMigrateQuickBackupForm::buildForm()
Form constructor.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
array The form structure.
Overrides FormInterface::buildForm
File
- src/
Form/ BackupMigrateQuickBackupForm.php, line 25
Class
- BackupMigrateQuickBackupForm
- Provides a form for performing a 1-click site backup.
Namespace
Drupal\backup_migrate\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$form = [];
// Theme the form if we want it inline.
// @FIXME
// $form['#theme'] = 'backup_migrate_ui_manual_quick_backup_form_inline';.
$bam = backup_migrate_get_service_object();
$form['quickbackup'] = [
'#type' => 'fieldset',
"#title" => $this
->t("Quick Backup"),
"#collapsible" => FALSE,
"#collapsed" => FALSE,
"#tree" => FALSE,
];
$form['quickbackup']['source_id'] = DrupalConfigHelper::getSourceSelector($bam, t('Backup Source'));
$form['quickbackup']['destination_id'] = DrupalConfigHelper::getDestinationSelector($bam, t('Backup Destination'));
$form['quickbackup']['settings_profile_id'] = DrupalConfigHelper::getSettingsProfileSelector(t('Settings Profile'));
unset($form['quickbackup']['destination_id']['#options']['upload']);
// Create the service
// $bam = backup_migrate_get_service_object();
// $bam->setConfig($config);
// $bam->plugins()->get('namer')->confGet('filename');
// $form['quickbackup']['source_id'] = _backup_migrate_get_source_pulldown(\Drupal::config('backup_migrate.settings')->get('backup_migrate_source_id'));.
// $form['quickbackup']['destination'] = _backup_migrate_get_destination_pulldown('manual backup', \Drupal::config('backup_migrate.settings')->get('backup_migrate_destination_id'), \Drupal::config('backup_migrate.settings')->get('backup_migrate_copy_destination_id'));.
$form['quickbackup']['submit'] = [
'#type' => 'submit',
'#value' => $this
->t('Backup now'),
'#weight' => 1,
];
return $form;
}