Skip to content
Snippets Groups Projects
Commit fd72393f authored by Ronan Dowling's avatar Ronan Dowling
Browse files

Adds routing and tabs

parent 5636b7e7
No related branches found
No related tags found
No related merge requests found
backup_migrate.quick_backup:
title: Backup and Migrate
description: ''
parent: system.admin_config_development
route_name: backup_migrate.quick_backup
backup_migrate.quick_backup:
title: Backup
route_name: backup_migrate.quick_backup
base_route: backup_migrate.quick_backup
backup_migrate.restore:
title: Restore
route_name: backup_migrate.restore
base_route: backup_migrate.quick_backup
backup_migrate.quick_backup_sub:
title: Quick Backup
route_name: backup_migrate.quick_backup
parent_id: backup_migrate.quick_backup
backup_migrate.advanced_backup:
title: Advanced Backup
route_name: backup_migrate.advanced_backup
parent_id: backup_migrate.quick_backup
backup_migrate.quick_backup:
path: '/admin/config/system/backup_migrate'
path: '/admin/config/development/backup_migrate'
defaults:
_form: '\Drupal\backup_migrate\Form\BackupMigrateQuickBackupForm'
_title: 'Quick Backup'
_title: 'Backup and Migrate'
requirements:
_permission: 'perform backup'
backup_migrate.advanced_backup:
path: '/admin/config/system/backup_migrate/export/advanced'
path: '/admin/config/development/backup_migrate/advanced'
defaults:
_form: '\Drupal\backup_migrate\Form\BackupMigrateAdvancedBackupForm'
_title: 'Advanced Backup'
requirements:
_permission: 'perform backup'
# backup_migrate.restore:
# path: '/admin/config/system/backup_migrate/restore'
# defaults:
# _form: '\Drupal\backup_migrate\Form\BackupMigrateRestoreForm'
# _title: 'Restore'
# requirements:
# _permission: 'restore from backup'
backup_migrate.restore:
path: '/admin/config/development/backup_migrate/restore'
defaults:
_form: '\Drupal\backup_migrate\Form\BackupMigrateRestoreForm'
_title: 'Restore'
requirements:
_permission: 'restore from backup'
<?php
/**
* @file
* Contains \Drupal\backup_migrate\Form\BackupMigrateQuickBackupForm.
*/
namespace Drupal\backup_migrate\Form;
use BackupMigrate\Drupal\Config\DrupalConfigHelper;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Provides a form for performing a 1-click site backup.
*/
class BackupMigrateRestoreForm extends FormBase {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'backup_migrate_ui_manual_backup_quick';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$form = array();
$bam = backup_migrate_get_service_object();
$form['quickbackup'] = array(
'#type' => 'fieldset',
"#title" => t("Restore"),
"#collapsible" => FALSE,
"#collapsed" => FALSE,
"#tree" => FALSE,
);
$form['quickbackup']['source_id'] = DrupalConfigHelper::getPluginSelector(
$bam->plugins()->getAllByOp('importFromFile'), t('Restore To'));
$form['quickbackup']['submit'] = array(
'#type' => 'submit',
'#value' => t('Restore now'),
'#weight' => 1,
);
return $form;
}
/**
* {@inheritdoc}
*/
public function validateForm(array &$form, FormStateInterface $form_state) {
parent::validateForm($form, $form_state);
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
// $config = $form_state->getValues();
// backup_migrate_perform_backup($config['source_id'], $config['destination_id']);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment