Download all files FTP
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @package Duplicator
|
||||
* @copyright (c) 2022, Snap Creek LLC
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
|
||||
|
||||
use Duplicator\Libs\Snap\SnapIO;
|
||||
use Duplicator\Package\Recovery\RecoveryStatus;
|
||||
use Duplicator\Views\ViewHelper;
|
||||
|
||||
/**
|
||||
* @var DUP_PRO_Package_Template_Entity $template
|
||||
* @var DUP_PRO_Schedule_Entity|null $schedule
|
||||
* @var bool $isList
|
||||
*/
|
||||
|
||||
if (isset($schedule)) {
|
||||
$recoveryStatus = new RecoveryStatus($schedule);
|
||||
} else {
|
||||
$recoveryStatus = new RecoveryStatus($template);
|
||||
}
|
||||
|
||||
$isRecoveable = $recoveryStatus->isRecoveable();
|
||||
$templareRecoveryAlter = new DUP_PRO_UI_Dialog();
|
||||
|
||||
if (!$isRecoveable) {
|
||||
$templareRecoveryAlter->title = (
|
||||
isset($schedule) ?
|
||||
__('Schedule: Recovery Point', 'duplicator-pro') :
|
||||
__('Template: Recovery Point', 'duplicator-pro')
|
||||
);
|
||||
$templareRecoveryAlter->width = 600;
|
||||
$templareRecoveryAlter->height = 600;
|
||||
$templareRecoveryAlter->showButtons = false;
|
||||
$templareRecoveryAlter->message = SnapIO::getInclude(
|
||||
__DIR__ . '/template-filters-info.php',
|
||||
array('recoveryStatus' => $recoveryStatus)
|
||||
);
|
||||
$templareRecoveryAlter->initAlert();
|
||||
?>
|
||||
<script>
|
||||
jQuery(document).ready(function ($) {
|
||||
$('#dup-template-recoveable-info-<?php echo $templareRecoveryAlter->getUniqueIdCounter(); ?>').click(function () {
|
||||
<?php $templareRecoveryAlter->showAlert(); ?>
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<span class="dup-template-recoveable-info-wrapper" >
|
||||
<?php
|
||||
if ($isRecoveable) {
|
||||
?>
|
||||
<?php _e('Available', 'duplicator-pro'); ?>
|
||||
<sup><?php ViewHelper::disasterIcon(); ?></sup>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<a href="javascript:void(0)"
|
||||
id="dup-template-recoveable-info-<?php echo $templareRecoveryAlter->getUniqueIdCounter(); ?>"
|
||||
class="dup-template-recoveable-info"><u><?php _e('Disabled', 'duplicator-pro'); ?></u></a>
|
||||
<?php
|
||||
}
|
||||
|
||||
if (!$isList) {
|
||||
?>
|
||||
<sup>
|
||||
<i class="fas fa-question-circle fa-sm"
|
||||
data-tooltip-title="<?php esc_attr_e("Recovery Status", 'duplicator-pro'); ?>"
|
||||
data-tooltip="<?php
|
||||
if (!isset($schedule)) {
|
||||
_e(
|
||||
"The Recovery Status can be either 'Available' or 'Disabled'.
|
||||
An 'Available' status allows the templates archive to be restored through the recovery point wizard.
|
||||
A 'Disabled' status means the archive can still be used but just not ran as a rapid recovery point.",
|
||||
'duplicator-pro'
|
||||
);
|
||||
} else {
|
||||
_e(
|
||||
"The Recovery Status can be either 'Available' or 'Disabled'.
|
||||
An 'Available' status allows the schedules archive to be restored through the recovery point wizard.
|
||||
A 'Disabled' status means the archive can still be used but just not ran as a rapid recovery point.",
|
||||
'duplicator-pro'
|
||||
);
|
||||
}
|
||||
?>"
|
||||
></i>
|
||||
</sup>
|
||||
<?php } ?>
|
||||
</span>
|
||||
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
use Duplicator\Controllers\ToolsPageController;
|
||||
use Duplicator\Core\Views\TplMng;
|
||||
use Duplicator\Package\Recovery\RecoveryStatus;
|
||||
use Duplicator\Views\ViewHelper;
|
||||
|
||||
defined('ABSPATH') || defined('DUPXABSPATH') || exit;
|
||||
|
||||
/**
|
||||
* @var RecoveryStatus $recoveryStatus
|
||||
*/
|
||||
|
||||
if ($recoveryStatus->getType() == RecoveryStatus::TYPE_SCHEDULE) {
|
||||
/** @var DUP_PRO_Schedule_Entity */
|
||||
$schedule = $recoveryStatus->getObject();
|
||||
if (($template = $schedule->getTemplate()) === false) {
|
||||
$template = new DUP_PRO_Package_Template_Entity();
|
||||
$template->name = __('Template not found', 'duplicator-pro');
|
||||
}
|
||||
$tooltipContent = esc_attr__(
|
||||
'A Schedule is not required to have a recovery point. For example if a schedule is backing up
|
||||
only a database then the recovery will always be disabled and may be desirable.',
|
||||
'duplicator-pro'
|
||||
);
|
||||
} else {
|
||||
$schedule = null;
|
||||
/** @var DUP_PRO_Package_Template_Entity */
|
||||
$template = $recoveryStatus->getObject();
|
||||
$tooltipContent = esc_attr__(
|
||||
'A Template is not required to have a recovery point. For example if backing up only a database
|
||||
then the recovery will always be disabled and may be desirable.',
|
||||
'duplicator-pro'
|
||||
);
|
||||
}
|
||||
?>
|
||||
<div class="dup-recover-dlg-title">
|
||||
<b><?php ViewHelper::disasterIcon(); ?> <?php _e('Status', 'duplicator-pro'); ?>:</b>
|
||||
<?php _e('Disabled', 'duplicator-pro'); ?>
|
||||
<sup>
|
||||
<i class="fas fa-question-circle fa-xs"
|
||||
data-tooltip-title="<?php _e('Recovery Status', 'duplicator-pro'); ?>"
|
||||
data-tooltip="<?php echo $tooltipContent; ?>">
|
||||
</i>
|
||||
</sup>
|
||||
</div>
|
||||
|
||||
<div class="dup-recover-dlg-subinfo">
|
||||
<table>
|
||||
<?php if ($recoveryStatus->getType() == RecoveryStatus::TYPE_SCHEDULE) { ?>
|
||||
<tr>
|
||||
<td><b><?php _e("Schedule", 'duplicator-pro'); ?>:</b></td>
|
||||
<td> <?php echo esc_html($schedule->name); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> <b><?php _e("Template", 'duplicator-pro'); ?>:</b></td>
|
||||
<td>
|
||||
<a href="<?php echo esc_url(ToolsPageController::getTemplateEditURL($template->getId())); ?>" >
|
||||
<?php echo esc_html($template->name); ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } else { ?>
|
||||
<tr>
|
||||
<td> <b><?php _e("Template", 'duplicator-pro'); ?>:</b> </td>
|
||||
<td><?php echo esc_html($template->name); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b><?php esc_html_e('Notes', 'duplicator-pro'); ?>:</b> </td>
|
||||
<td><?php echo (strlen($template->notes)) ? $template->notes : __("- no notes -", 'duplicator-pro'); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
TplMng::getInstance()->render(
|
||||
'parts/recovery/exclude_data_box',
|
||||
array('recoverStatus' => $recoveryStatus)
|
||||
);
|
||||
Reference in New Issue
Block a user