allow to select the archive to restore from

Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
szaimen 2021-12-07 19:10:05 +01:00
parent badd8d02a9
commit 63e0849215
8 changed files with 63 additions and 15 deletions

View file

@ -83,6 +83,30 @@ class ConfigurationManager
return $lastBackupTime;
}
public function GetBackupTimes() : array {
if (!file_exists(DataConst::GetBackupArchivesList())) {
return $array[] = '';
}
$content = file_get_contents(DataConst::GetBackupArchivesList());
if ($content === "") {
return $array[] = '';
}
$backupLines = explode("\n", $content);
$backupTimes = array();
foreach($backupLines as $lines) {
$backupTimesTemp = explode(",", $lines);
$backupTimes[] = $backupTimesTemp[1];
}
if (!is_array($backupTimes)) {
return $array[] = '';
}
return $backupTimes;
}
public function wasStartButtonClicked() : bool {
if (isset($this->GetConfig()['wasStartButtonClicked'])) {
return true;
@ -152,6 +176,15 @@ class ConfigurationManager
return $config['backup-mode'];
}
public function GetSelectedRestoreTime() : string {
$config = $this->GetConfig();
if(!isset($config['selected-restore-time'])) {
$config['selected-restore-time'] = '';
}
return $config['selected-restore-time'];
}
public function GetAIOURL() : string {
$config = $this->GetConfig();
if(!isset($config['AIO_URL'])) {