first commit

This commit is contained in:
2024-07-15 11:28:08 +02:00
commit f52d538ea5
21891 changed files with 6161164 additions and 0 deletions

View File

@@ -0,0 +1,674 @@
<?php
/**
* @package solo
* @copyright Copyright (c)2014-2022 Nicholas K. Dionysopoulos / Akeeba Ltd
* @license GNU General Public License version 3, or later
*/
namespace Solo\View\Manage;
use Akeeba\Engine\Factory;
use Akeeba\Engine\Platform;
use Awf\Date\Date;
use Awf\Html\Select;
use Awf\Mvc\Model;
use Awf\Mvc\View;
use Awf\Pagination\Pagination;
use Awf\Text\Text;
use Awf\Utils\Template;
use DateTimeZone;
use Solo\Helper\Escape;
use Solo\Model\Profiles;
use function foo\func;
class Html extends View
{
/**
* Should I use the user's local time zone for display?
*
* @var boolean
*/
public $useLocalTime;
/**
* Time format string to use for the time zone suffix
*
* @var string
*/
public $timeZoneFormat;
/**
* The backup record for the showcomment view
*
* @var array
*/
public $record = [];
/**
* The backup record ID for the showcomment view
*
* @var int
*/
public $record_id = 0;
/**
* List of Profiles objects
*
* @var array
*/
public $profiles = [];
/**
* List of profiles for JHtmlSelect
*
* @var array
*/
public $profilesList = [];
/**
* List of frozen options for JHtmlSelect
*
* @var array
*/
public $frozenList = [];
/**
* List of records to display
*
* @var array
*/
public $items = [];
/**
* Pagination object
*
* @var Pagination
*/
public $pagination = null;
/**
* Date format for the backup start time
*
* @var string
*/
public $dateFormat = '';
/**
* Should I prompt the user ot run the configuration wizard?
*
* @var bool
*/
public $promptForBackupRestoration = false;
/**
* The record lists of this view
*
* @var \stdClass
*/
public $lists = null;
/**
* Cache the user privileges
*
* @var array
*/
public $privileges = [];
/**
* Post-processing engines per backup profile in the format profile id => post-processing enging
*
* @var array
*/
public $enginesPerProfile = [];
/**
* Should I show the browser download buttons in WordPress?
*
* @var bool
* @since 7.6.1
*/
public $showBrowserDownload;
/**
* Is PHP set up to output error to the browser?
*
* -1: Don't know; 0: no; 1 yes
*
* @var int
* @since 7.6.1
*/
public $phpErrorDisplay = -1;
public function __construct($container = null)
{
parent::__construct($container);
$this->lists = new \stdClass();
Template::addJs('media://js/solo/manage.js', $this->container->application);
}
public function onBeforeMain()
{
$user = $this->container->userManager->getUser();
$this->privileges['backup'] = $user->getPrivilege('akeeba.backup');
$this->privileges['download'] = $user->getPrivilege('akeeba.download');
$this->privileges['configure'] = $user->getPrivilege('akeeba.configure');
$document = $this->container->application->getDocument();
$router = $this->container->router;
$task = $this->container->segment->get('solo_manage_task', 'main');
/** @var \Solo\Model\Manage $model */
$model = $this->getModel();
$this->lists->order = $model->getState('filter_order', 'backupstart');
$this->lists->order_Dir = $model->getState('filter_order_Dir', 'DESC');
$this->lists->fltDescription = $model->getState('filter_description', null);
$this->lists->fltFrom = $model->getState('filter_from', null);
$this->lists->fltTo = $model->getState('filter_to', null);
$this->lists->fltOrigin = $model->getState('filter_origin', null);
$this->lists->fltProfile = $model->getState('filter_profile', null);
$this->lists->fltFrozen = $model->getState('filter_frozen', null);
$filters = $this->_getFilters();
$ordering = $this->_getOrdering();
$this->items = $model->getStatisticsListWithMeta(false, $filters, $ordering);
$containerClone = clone $this->getContainer();
$containerClone['mvc_config'] = [
'modelTemporaryInstance' => true,
'modelClearState' => true,
'modelClearInput' => true,
];
/** @var Profiles $profileModel */
$profileModel = Model::getInstance(null, 'Profiles', $containerClone);
$this->profiles = $profileModel->get(true);
$this->profilesList = [];
$this->profilesList[] = Select::option('', '&mdash;');
if (!empty($this->profiles))
{
foreach ($this->profiles as $profile)
{
$this->profilesList[] = Select::option($profile->id, $profile->description);
}
}
$this->frozenList = [
Select::option('', '' . Text::_('COM_AKEEBA_BUADMIN_LABEL_FROZEN_SELECT') . ''),
Select::option('1', Text::_('COM_AKEEBA_BUADMIN_LABEL_FROZEN_FROZEN')),
Select::option('2', Text::_('COM_AKEEBA_BUADMIN_LABEL_FROZEN_UNFROZEN')),
];
$this->pagination = $model->getPagination($filters);
// Date format
$dateFormat = $this->container->appConfig->get('dateformat', '');
$dateFormat = trim($dateFormat);
$this->dateFormat = !empty($dateFormat) ? $dateFormat : Text::_('DATE_FORMAT_LC4');
// Time zone options
$this->useLocalTime = $this->container->appConfig->get('localtime', '1') == 1;
$this->timeZoneFormat = $this->container->appConfig->get('timezonetext', 'T');
$this->enginesPerProfile = $model->getPostProcessingEnginePerProfile();
$this->showBrowserDownload = $this->container->appConfig->get('showBrowserDownload', 0) == 1;
if (function_exists('ini_get'))
{
$this->phpErrorDisplay = (ini_get('display_errors') ?: 0) ? 1 : 0;
}
// "Show warning first" download button.
Text::script('COM_AKEEBA_BUADMIN_LOG_DOWNLOAD_CONFIRM', false);
$document->addScriptOptions('akeeba.Manage.downloadURL', $router->route('index.php?option=com_akeeba&view=Manage&task=download&format=raw'));
$buttons = [
'view' => [
'task' => 'main',
'title' => 'COM_AKEEBA_BUADMIN_LOG_EDITCOMMENT',
'class' => 'akeeba-btn--grey',
'onClick' => 'akeeba.System.submitForm(\'showComment\')',
'icon' => 'akion-edit',
],
'discover' => [
'task' => 'main',
'title' => 'COM_AKEEBA_DISCOVER',
'class' => 'akeeba-btn--grey',
'url' => $router->route('index.php?view=discover'),
'icon' => 'akion-search',
],
's3import' => [
'task' => 'main',
'title' => 'COM_AKEEBA_S3IMPORT',
'class' => 'akeeba-btn--grey',
'url' => $router->route('index.php?view=s3import'),
'icon' => 'akion-ios-cloud-download',
],
'restore' => [
'task' => '',
'title' => 'COM_AKEEBA_BUADMIN_LABEL_RESTORE',
'class' => 'akeeba-btn--teal',
'onClick' => 'akeeba.System.submitForm(\'restore\')',
'icon' => 'akion-android-open',
],
'deletefiles' => [
'task' => 'main',
'title' => 'COM_AKEEBA_BUADMIN_LABEL_DELETEFILES',
'class' => 'akeeba-btn--orange',
'onClick' => 'akeeba.System.submitForm(\'deleteFiles\')',
'icon' => 'akion-trash-a',
],
'delete' => [
'task' => '',
'title' => 'SOLO_MANAGE_BTN_DELETE',
'class' => 'akeeba-btn--red',
'onClick' => 'akeeba.System.submitForm(\'remove\')',
'icon' => 'akion-trash-b',
],
];
if (!$this->privileges['configure'])
{
unset($buttons['discover']);
unset($buttons['s3import']);
unset($buttons['restore']);
}
elseif (!AKEEBABACKUP_PRO)
{
unset($buttons['restore']);
unset($buttons['discover']);
unset($buttons['s3import']);
}
if (!$this->privileges['backup'])
{
unset($buttons['delete']);
unset($buttons['deletefiles']);
}
$toolbar = $document->getToolbar();
foreach ($buttons as $button)
{
if (empty($button['task']) || ($button['task'] == $task))
{
$toolbar->addButtonFromDefinition($button);
}
}
// Should I show the prompt for the configuration wizard?
$this->promptForBackupRestoration = Platform::getInstance()->get_platform_configuration_option('show_howtorestoremodal', 1);
// "Show warning first" download button.
$confirmationText = Escape::escapeJS(Text::_('COM_AKEEBA_BUADMIN_LOG_DOWNLOAD_CONFIRM'));
$confirmationText = str_replace('\\\\n', '\\n', $confirmationText);
$newURL = Escape::escapeJS($router->route('index.php?view=manage&task=download&format=raw'));
$js = <<<JS
;// This comment is intentionally put here to prevent badly written plugins from causing a Javascript error
// due to missing trailing semicolon and/or newline in their code.
function confirmDownloadButton()
{
var answer = confirm(akeeba.System.Text._("COM_AKEEBA_BUADMIN_LOG_DOWNLOAD_CONFIRM"));
if (answer)
{
akeeba.System.submitForm('adminForm', 'download');
}
}
function confirmDownload(id, part)
{
var answer = confirm(akeeba.System.Text._("COM_AKEEBA_BUADMIN_LOG_DOWNLOAD_CONFIRM"));
var newURL = '$newURL';
if (answer)
{
var query = 'id=' + id;
if (part != '')
{
query += '&part=' + part
}
window.location = newURL + (newURL.indexOf('?') != -1 ? '&' : '?') + query;
}
}
akeeba.System.documentReady(function() {
setTimeout(function() {
akeeba.Tooltip.enableFor(document.querySelectorAll('.akeebaCommentPopover'), false);
}, 500);
});
JS;
$this->getContainer()->application->getDocument()->addScriptDeclaration($js);
// All done, show the page!
return true;
}
public function onBeforeShowComment()
{
$model = $this->getModel();
$this->record_id = $model->getState('id', -1, 'int');
$this->record = Platform::getInstance()->get_statistics($this->record_id);
$buttons = [
[
'title' => 'SOLO_BTN_SAVECLOSE',
'class' => 'akeeba-btn--green',
'onClick' => 'akeeba.System.submitForm(\'save\')',
'icon' => 'akion-checkmark-circled',
],
[
'title' => 'SOLO_BTN_CANCEL',
'class' => 'akeeba-btn--orange',
'onClick' => 'akeeba.System.submitForm(\'cancel\')',
'icon' => 'akion-close-circled',
],
];
$toolbar = $this->container->application->getDocument()->getToolbar();
foreach ($buttons as $button)
{
$toolbar->addButtonFromDefinition($button);
}
return true;
}
/**
* Translates the internal backup type (e.g. cli) to a human readable string
*
* @param string $recordType The internal backup type
*
* @return string
*/
public function translateBackupType($recordType)
{
static $backup_types = null;
if (!is_array($backup_types))
{
// Load a mapping of backup types to textual representation
$scripting = Factory::getEngineParamsProvider()->loadScripting();
$backup_types = [];
foreach ($scripting['scripts'] as $key => $data)
{
$backup_types[$key] = Text::_($data['text']);
}
}
if (array_key_exists($recordType, $backup_types))
{
return $backup_types[$recordType];
}
return '&ndash;';
}
/**
* Get the start time and duration of a backup record
*
* @param array $record A backup record
*
* @return array array(startTimeAsString, durationAsString)
*/
protected function getTimeInformation($record)
{
$utcTimeZone = new DateTimeZone('UTC');
$startTime = new Date($record['backupstart'], $utcTimeZone);
$endTime = new Date($record['backupend'], $utcTimeZone);
$duration = $endTime->toUnix() - $startTime->toUnix();
if ($duration > 0)
{
$seconds = $duration % 60;
$duration = $duration - $seconds;
$minutes = ($duration % 3600) / 60;
$duration = $duration - $minutes * 60;
$hours = $duration / 3600;
$duration = sprintf('%02d', $hours) . ':' . sprintf('%02d', $minutes) . ':' . sprintf('%02d', $seconds);
}
else
{
$duration = '';
}
$tz = $this->container->appConfig->get('timezone', 'UTC');
$user = $this->container->userManager->getUser();
$user_tz = $user->getParameters()->get('timezone', null);
if (!empty($user_tz))
{
$tz = $user_tz;
}
$tzObject = new DateTimeZone($tz);
$startTime->setTimezone($tzObject);
$timeZoneSuffix = '';
if (!empty($this->timeZoneFormat))
{
$timeZoneSuffix = $startTime->format($this->timeZoneFormat, $this->useLocalTime);
}
return [
$startTime->format($this->dateFormat, $this->useLocalTime),
$duration,
$timeZoneSuffix,
];
}
/**
* Get the class and icon for the backup status indicator
*
* @param array $record A backup record
*
* @return array array(class, icon)
*/
protected function getStatusInformation($record)
{
$statusClass = '';
switch ($record['meta'])
{
case 'ok':
$statusIcon = 'akion-checkmark';
$statusClass = 'akeeba-label--green';
break;
case 'pending':
$statusIcon = 'akion-play';
$statusClass = 'akeeba-label--orange';
break;
case 'fail':
$statusIcon = 'akion-android-cancel';
$statusClass = 'akeeba-label--red';
break;
case 'remote':
$statusIcon = 'akion-cloud';
$statusClass = 'akeeba-label--teal';
break;
default:
$statusIcon = 'akion-trash-a';
$statusClass = 'akeeba-label--grey';
break;
}
return [$statusClass, $statusIcon];
}
/**
* Get the profile name for the backup record (or "" if the profile no longer exists)
*
* @param array $record A backup record
*
* @return string
*/
protected function getProfileName($record)
{
$profileName = '&mdash;';
if (isset($this->profiles[$record['profile_id']]))
{
$profileName = $this->escape($this->profiles[$record['profile_id']]->description);
return $profileName;
}
return $profileName;
}
/**
* Returns the origin's translated name and the appropriate icon class
*
* @param array $record A backup record
*
* @return array array(originTranslation, iconClass)
*/
protected function getOriginInformation($record)
{
$originLanguageKey = 'COM_AKEEBA_BUADMIN_LABEL_ORIGIN_' . $record['origin'];
$originDescription = Text::_($originLanguageKey);
switch (strtolower($record['origin']))
{
case 'backend':
$originIcon = 'akion-android-desktop';
break;
case 'frontend':
$originIcon = 'akion-ios-world';
break;
case 'json':
$originIcon = 'akion-android-cloud';
break;
case 'cli':
$originIcon = 'akion-ios-paper-outline';
break;
default:
$originIcon = 'akion-help';
break;
}
if (empty($originLanguageKey) || ($originDescription == $originLanguageKey))
{
$originDescription = '&ndash;';
$originIcon = 'akion-help';
return [$originDescription, $originIcon];
}
return [$originDescription, $originIcon];
}
private function _getFilters()
{
$filters = [];
$task = $this->container->segment->get('solo_manage_task', 'main');
if ($this->lists->fltDescription)
{
$filters[] = [
'field' => 'description',
'operand' => 'LIKE',
'value' => $this->lists->fltDescription,
];
}
if ($this->lists->fltFrom && $this->lists->fltTo)
{
$filters[] = [
'field' => 'backupstart',
'operand' => 'BETWEEN',
'value' => $this->lists->fltFrom,
'value2' => $this->lists->fltTo,
];
}
elseif ($this->lists->fltFrom)
{
$filters[] = [
'field' => 'backupstart',
'operand' => '>=',
'value' => $this->lists->fltFrom,
];
}
elseif ($this->lists->fltTo)
{
$filters[] = [
'field' => 'backupstart',
'operand' => '<=',
'value' => $this->lists->fltTo,
];
}
if ($this->lists->fltOrigin)
{
$filters[] = [
'field' => 'origin',
'operand' => '=',
'value' => $this->lists->fltOrigin,
];
}
if ($this->lists->fltProfile)
{
$filters[] = [
'field' => 'profile_id',
'operand' => '=',
'value' => (int) $this->lists->fltProfile,
];
}
if ($this->lists->fltFrozen == 1)
{
$filters[] = [
'field' => 'frozen',
'operand' => '=',
'value' => 1,
];
}
elseif ($this->lists->fltFrozen == 2)
{
$filters[] = [
'field' => 'frozen',
'operand' => '=',
'value' => 0,
];
}
if (empty($filters))
{
$filters = null;
}
return $filters;
}
private function _getOrdering()
{
$order = [
'by' => $this->lists->order,
'order' => strtoupper($this->lists->order_Dir),
];
return $order;
}
}

View File

@@ -0,0 +1,49 @@
<?php
/**
* @package solo
* @copyright Copyright (c)2014-2019 Nicholas K. Dionysopoulos / Akeeba Ltd
* @license GNU GPL version 3 or later
*/
use Awf\Text\Text;
defined('_AKEEBA') or die();
/** @var \Solo\View\Manage\Html $this */
$router = $this->container->router;
$token = $this->container->session->getCsrfToken()->getValue();
?>
<form name="adminForm" id="adminForm" action="<?php echo $router->route('index.php?view=manage') ?>" method="post"
class="akeeba-form--horizontal--with-hidden" role="form">
<div class="form-group">
<label class="control-label col-sm-3" for="description">
<?php echo Text::_('COM_AKEEBA_BUADMIN_LABEL_DESCRIPTION'); ?>
</label>
<div class="col-sm-9">
<input type="text" name="description" maxlength="255" size="50"
value="<?php echo $this->record['description'] ?>"
class="form-control" />
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-3" for="comment">
<?php echo Text::_('COM_AKEEBA_BUADMIN_LABEL_COMMENT'); ?>
</label>
<div class="col-sm-9">
<textarea id="comment" name="comment" rows="5" cols="73"
autocomplete="off"><?php echo $this->record['comment'] ?></textarea>
</div>
</div>
<div class="akeeba-hidden-fields-container">
<input type="hidden" name="task" value="" />
<input type="hidden" name="id" value="<?php echo $this->record['id'] ?>" />
<input type="hidden" name="token" value="<?php echo $token ?>">
</div>
</form>

View File

@@ -0,0 +1,279 @@
<?php
/**
* @package solo
* @copyright Copyright (c)2014-2019 Nicholas K. Dionysopoulos / Akeeba Ltd
* @license GNU GPL version 3 or later
*/
use Awf\Text\Text;
defined('_AKEEBA') or die();
// Used for type hinting
/** @var \Solo\View\Manage\Html $this */
$router = $this->container->router;
$token = $this->container->session->getCsrfToken()->getValue();
$dateFormat = $this->getContainer()->appConfig->get('dateformat', '');
$dateFormat = trim($dateFormat);
$dateFormat = !empty($dateFormat) ? $dateFormat : Text::_('DATE_FORMAT_LC4');
$dateFormat = !empty($dateFormat) ? $dateFormat : Text::_('DATE_FORMAT_LC4');
// Timezone settings
$serverTimezone = new DateTimeZone($this->container->appConfig->get('timezone', 'UTC'));
$useLocalTime = $this->container->appConfig->get('localtime', '1') == 1;
$timeZoneFormat = $this->container->appConfig->get('timezonetext', 'T');
$urlIncludeFolders = addslashes($this->getContainer()->router->route('index.php?view=extradirs&task=ajax'));
$urlBrowser = addslashes($this->getContainer()->router->route('index.php?view=browser&processfolder=1&tmpl=component&folder='));
?>
<?php echo $this->loadAnyTemplate('Main/paypal'); ?>
<?php
// Restoration information prompt
$proKey = (defined('AKEEBABACKUP_PRO') && AKEEBABACKUP_PRO) ? 'PRO' : 'CORE';
if (\Akeeba\Engine\Platform::getInstance()->get_platform_configuration_option('show_howtorestoremodal', 1)):
echo $this->loadAnyTemplate('Manage/howtorestore_modal');
endif; ?>
<div class="akeeba-block--info">
<h4><?php echo Text::_('COM_AKEEBA_BUADMIN_LABEL_HOWDOIRESTORE_LEGEND') ?></h4>
<p>
<?php echo Text::sprintf('COM_AKEEBA_BUADMIN_LABEL_HOWDOIRESTORE_TEXT_' . $proKey,
'https://www.akeebabackup.com/videos/1214-akeeba-solo/1637-abts05-restoring-site-new-server.html',
$router->route('index.php?view=Transfer'),
'https://www.akeebabackup.com/latest-kickstart-core.zip'
); ?>
</p>
</div>
<form action="<?php echo $router->route('index.php?view=manage') ?>" method="post" name="adminForm" id="adminForm"
role="form" class="akeeba-form">
<table class="akeeba-table--striped" id="itemsList">
<thead>
<tr>
<th width="20">
<input type="checkbox" name="toggle" value="" onclick="akeeba.System.checkAll(this);"/>
</th>
<th width="20" class="akeeba-hidden-phone">
<?php echo \Awf\Html\Grid::sort('COM_AKEEBA_BUADMIN_LABEL_ID', 'id', $this->lists->order_Dir, $this->lists->order, 'default'); ?>
</th>
<th width="30%">
<?php echo \Awf\Html\Grid::sort('COM_AKEEBA_BUADMIN_LABEL_DESCRIPTION', 'description', $this->lists->order_Dir, $this->lists->order, 'default'); ?>
</th>
<th class="akeeba-hidden-phone">
<?php echo \Awf\Html\Grid::sort('COM_AKEEBA_BUADMIN_LABEL_PROFILEID', 'profile_id', $this->lists->order_Dir, $this->lists->order, 'default'); ?>
</th>
<th width="80">
<?php echo \Awf\Html\Grid::sort('COM_AKEEBA_BUADMIN_LABEL_DURATION', 'backupstart', $this->lists->order_Dir, $this->lists->order, 'default'); ?>
</th>
<th width="80">
<?php echo Text::_('COM_AKEEBA_BUADMIN_LABEL_STATUS'); ?>
</th>
<th width="110" class="akeeba-hidden-phone">
<?php echo Text::_('COM_AKEEBA_BUADMIN_LABEL_SIZE'); ?>
</th>
<th class="akeeba-hidden-phone">
<?php echo Text::_('COM_AKEEBA_BUADMIN_LABEL_MANAGEANDDL'); ?>
</th>
</tr>
<tr>
<td></td>
<td class="akeeba-hidden-phone"></td>
<td>
<input type="text" name="filter_description" id="description"
onchange="document.adminForm.submit();" style="width: 100%;"
value="<?php echo $this->escape($this->lists->fltDescription) ?>"
placeholder="<?php echo Text::_('SOLO_MANAGE_FIELD_DESCRIPTION') ?>">
</td>
<td class="akeeba-hidden-phone">
<?php echo \Awf\Html\Select::genericList($this->profileList, 'filter_profile', array(
'onchange' => "document.forms.adminForm.submit()",
'width' => '100%'
), 'value', 'text', $this->lists->fltProfile); ?>
</td>
<td></td>
<td></td>
<td colspan="2" class="akeeba-hidden-phone"></td>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="11" class="center"><?php echo $this->pagination->getListFooter(); ?></td>
</tr>
</tfoot>
<tbody>
<?php if (!empty($this->list)): ?>
<?php $i = 0;
foreach ($this->list as $record):?>
<?php
$check = \Awf\Html\Grid::id(++$i, $record['id']);
$backupId = isset($record['backupid']) ? $record['backupid'] : '';
if (array_key_exists($record['type'], $this->backupTypes))
{
$type = $this->backupTypes[$record['type']];
}
else
{
$type = '&ndash;';
}
$gmtTimezone = new DateTimeZone('GMT');
$startTime = new \Awf\Date\Date($record['backupstart'], $gmtTimezone);
$endTime = new \Awf\Date\Date($record['backupend'], $gmtTimezone);
if ($useLocalTime)
{
$startTime->setTimezone($serverTimezone);
}
$duration = $endTime->toUnix() - $startTime->toUnix();
if ($duration > 0)
{
$seconds = $duration % 60;
$duration = $duration - $seconds;
$minutes = ($duration % 3600) / 60;
$duration = $duration - $minutes * 60;
$hours = $duration / 3600;
$duration = sprintf('%02d', $hours) . ':' . sprintf('%02d', $minutes) . ':' . sprintf('%02d', $seconds);
}
else
{
$duration = '';
}
// Label class based on status
$status = Text::_('COM_AKEEBA_BUADMIN_LABEL_STATUS_' . $record['meta']);
$statusClass = '';
switch ($record['meta'])
{
case 'ok':
$statusIcon = 'akion-checkmark';
$statusClass = 'akeeba-label--green';
break;
case 'pending':
$statusIcon = 'akion-play';
$statusClass = 'akeeba-label--orange';
break;
case 'fail':
$statusIcon = 'akion-android-cancel';
$statusClass = 'akeeba-label--red';
break;
case 'remote':
$statusIcon = 'akion-cloud';
$statusClass = 'akeeba-label--teal';
break;
default:
$statusIcon = 'akion-trash-a';
$statusClass = 'akeeba-label--grey';
break;
}
$edit_link = $router->route('index.php?view=manage&task=showComment&id=' . $record['id'] . '&token=' . $token);
if (empty($record['description']))
{
$record['description'] = Text::_('COM_AKEEBA_BUADMIN_LABEL_NODESCRIPTION');
}
list($originDescription, $originIcon) = $this->getOriginInformation($record);
?>
<tr>
<td>
<?php echo $check; ?>
</td>
<td class="akeeba-hidden-phone">
<?php echo $record['id']; ?>
</td>
<td>
<span class="akeeba-label--grey akeebaCommentPopover" rel="popover"
data-original-title="<?php echo Text::_('COM_AKEEBA_BUADMIN_LABEL_ORIGIN'); ?>"
data-content="<?php echo htmlentities($originDescription) ?>"
style="padding: 0.4em 0.6em;"
><span class="<?php echo $originIcon ?>"></span></span>
<?php if (!empty($record['comment'])): ?>
<span class="akeebaCommentPopover"
data-content="<?php echo $this->escape($record['comment']) ?>"
style="padding: 0.4em 0.6em;"
><span class="akion-help-circled"></span></span>
<?php endif; ?>
<a href="<?php echo $edit_link; ?>">
<?php echo $this->escape($record['description']) ?>
</a>
<br/>
<div class="akeeba-buadmin-startdate"
title="<?php echo Text::_('COM_AKEEBA_BUADMIN_LABEL_START') ?>">
<small>
<span class="akion-calendar"></span>
<?php echo $startTime->format($dateFormat, true); ?>
<?php echo empty($timeZoneFormat) ? '' : $startTime->format($timeZoneFormat, true); ?>
</small>
</div>
</td>
<td class="akeeba-hidden-phone">
<?php
$profileName = '&mdash;';
if (isset($this->profiles[$record['profile_id']]))
{
$profileName = $this->escape($this->profiles[$record['profile_id']]->description);
}
?>
#<?php echo $record['profile_id'] ?>. <?php echo $profileName ?>
<br/>
<small>
<em><?php echo $type ?></em>
</small>
</td>
<td>
<?php if ($duration): ?>
<?php echo $duration; ?>
<?php endif; ?>
</td>
<td>
<span class="<?php echo $statusClass; ?> akeebaCommentPopover" rel="popover"
data-original-title="<?php echo Text::_('COM_AKEEBA_BUADMIN_LABEL_STATUS') ?>"
data-content="<?php echo $status ?>"
style="padding: 0.4em 0.6em;"
>
<span class="<?php echo $statusIcon; ?>"></span>
</span>
</td>
<td class="akeeba-hidden-phone"><?php echo ($record['meta'] == 'ok') ? \Solo\Helper\Format::fileSize($record['size']) : ($record['total_size'] > 0 ? "(<i>" . \Solo\Helper\Format::fileSize($record['total_size']) . "</i>)" : '&mdash;') ?></td>
<td class="akeeba-hidden-phone">
<?php echo $this->loadAnyTemplate('Manage/manage_column', array(
'record' => &$record,
)); ?>
</td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr>
<td colspan="11">
<?php echo Text::_('SOLO_LBL_NO_RECORDS') ?>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
<div class="akeeba-hidden-fields-container">
<input type="hidden" name="boxchecked" id="boxchecked" value="0">
<input type="hidden" name="task" id="task" value="default">
<input type="hidden" name="filter_order" id="filter_order" value="<?php echo $this->lists->order ?>">
<input type="hidden" name="filter_order_Dir" id="filter_order_Dir" value="<?php echo $this->lists->order_Dir ?>">
<input type="hidden" name="token" value="<?php echo $token ?>">
</div>
</form>

View File

@@ -0,0 +1,60 @@
<?php
/**
* @package solo
* @copyright Copyright (c)2014-2019 Nicholas K. Dionysopoulos / Akeeba Ltd
* @license GNU GPL version 3 or later
*/
use Awf\Text\Text;
defined('_AKEEBA') or die();
/** @var $this \Solo\View\Configuration\Html */
$router = $this->container->router;
$proKey = (defined('AKEEBABACKUP_PRO') && AKEEBABACKUP_PRO) ? 'PRO' : 'CORE';
$js = <<< JS
akeeba.loadScripts.push(function(){
setTimeout(function() {
akeeba.System.howToRestoreModal = akeeba.Modal.open({
inherit: '#akeeba-config-howtorestore-bubble',
width: '80%'
});
}, 500);
});
JS;
$this->getContainer()->application->getDocument()->addScriptDeclaration($js);
?>
<div id="akeeba-config-howtorestore-bubble" style="display: none;">
<div class="akeeba-renderer-fef <?php echo ($this->getContainer()->appConfig->get('darkmode', -1) == 1) ? 'akeeba-renderer-fef--dark' : '' ?>">
<h4>
<?php echo Text::_('COM_AKEEBA_BUADMIN_LABEL_HOWDOIRESTORE_LEGEND') ?>
</h4>
<p>
<?php echo Text::sprintf('COM_AKEEBA_BUADMIN_LABEL_HOWDOIRESTORE_TEXT_' . $proKey,
'https://www.akeebabackup.com/videos/1214-akeeba-solo/1637-abts05-restoring-site-new-server.html',
$router->route('index.php?view=Transfer'),
'https://www.akeebabackup.com/latest-kickstart-core.zip'
); ?>
</p>
<div>
<a href="#" onclick="akeeba.System.howToRestoreModal.close(); document.getElementById('akeeba-config-howtorestore-bubble').style.display = 'none'" class="akeeba-btn--primary">
<span class="akion-close"></span>
<?php echo Text::_('COM_AKEEBA_BUADMIN_BTN_REMINDME'); ?>
</a>
<a href="<?php echo $router->route('index.php?view=Manage&task=hideModal') ?>" class="akeeba-btn--green">
<span class="akion-checkmark-circled"></span>
<?php echo Text::_('COM_AKEEBA_BUADMIN_BTN_DONTSHOWTHISAGAIN'); ?>
</a>
</div>
</div>
</div>

View File

@@ -0,0 +1,159 @@
<?php
/**
* @package solo
* @copyright Copyright (c)2014-2019 Nicholas K. Dionysopoulos / Akeeba Ltd
* @license GNU GPL version 3 or later
*/
use Awf\Text\Text;
use Solo\Helper\Utils as AkeebaHelperUtils;
defined('_AKEEBA') or die();
/** @var array $record */
/** @var Solo\View\Manage\Html $this */
$router = $this->container->router;
$cancelLabel = Text::_('SOLO_MANAGE_LBL_CANCELMODAL');
if (!isset($record['remote_filename']))
{
$record['remote_filename'] = '';
}
$archiveExists = $record['meta'] == 'ok';
$showManageRemote = in_array($record['meta'], array('ok', 'remote')) && !empty($record['remote_filename']) && (AKEEBABACKUP_PRO == 1);
$showUploadRemote = $this->privileges['backup'] && $archiveExists && @empty($record['remote_filename']) && ($this->enginesPerProfile[$record['profile_id']] != 'none') && ($record['meta'] != 'obsolete') && (AKEEBABACKUP_PRO == 1);
$showDownload = $this->privileges['download'] && $archiveExists;
$showViewLog = $this->privileges['backup'] && isset($record['backupid']) && !empty($record['backupid']);
$postProcEngine = '';
$thisPart = '';
$thisID = urlencode($record['id']);
if ($showUploadRemote)
{
$postProcEngine = $this->enginesPerProfile[$record['profile_id']];
$showUploadRemote = !empty($postProcEngine);
}
?>
<div style="display: none">
<div id="akeeba-buadmin-<?php echo $record['id'] ?>" tabindex="-1" role="dialog">
<div class="akeeba-renderer-fef <?php echo ($this->getContainer()->appConfig->get('darkmode', -1) == 1) ? 'akeeba-renderer-fef--dark' : '' ?>">
<h4><?php echo Text::_('COM_AKEEBA_BUADMIN_LBL_BACKUPINFO') ?></h4>
<p>
<strong><?php echo Text::_('COM_AKEEBA_BUADMIN_LBL_ARCHIVEEXISTS') ?></strong><br/>
<?php if ($record['meta'] == 'ok'): ?>
<span class="akeeba-label--success">
<?php echo Text::_('SOLO_YES') ?>
</span>
<?php else: ?>
<span class="akeeba-label--failure">
<?php echo Text::_('SOLO_NO') ?>
</span>
<?php endif; ?>
</p>
<p>
<strong><?php echo Text::_('COM_AKEEBA_BUADMIN_LBL_ARCHIVEPATH' . ($archiveExists ? '' : '_PAST')) ?></strong><br/>
<span class="akeeba-label--information">
<?php echo htmlentities(AkeebaHelperUtils::getRelativePath(APATH_BASE, dirname($record['absolute_path']))) ?>
</span>
</p>
<p>
<strong><?php echo Text::_('COM_AKEEBA_BUADMIN_LBL_ARCHIVENAME' . ($archiveExists ? '' : '_PAST')) ?></strong><br/>
<br/>
<code>
<?php echo htmlentities($record['archivename']); ?>
</code>
</p>
</div>
</div>
<?php if ($showDownload): ?>
<div id="akeeba-buadmin-download-<?php echo $record['id'] ?>" tabindex="-2" role="dialog">
<div class="akeeba-renderer-fef <?php echo ($this->getContainer()->appConfig->get('darkmode', -1) == 1) ? 'akeeba-renderer-fef--dark' : '' ?>">
<div class="akeeba-block--warning">
<h4>
<?php echo Text::_('COM_AKEEBA_BUADMIN_LBL_DOWNLOAD_TITLE') ?>
</h4>
<?php echo Text::_('COM_AKEEBA_BUADMIN_LBL_DOWNLOAD_WARNING') ?>
</div>
<?php if ($record['multipart'] < 2): ?>
<a class="akeeba-btn--primary--small"
href="javascript:confirmDownload('<?php echo $thisID ?>', '<?php echo $thisPart ?>');">
<span class="akion-ios-download"></span>
<?php echo Text::_('COM_AKEEBA_BUADMIN_LOG_DOWNLOAD'); ?>
</a>
<?php else: ?>
<div>
<?php echo Text::sprintf('COM_AKEEBA_BUADMIN_LBL_DOWNLOAD_PARTS', $record['multipart']); ?>
</div>
<?php for ($count = 0; $count < $record['multipart']; $count++):
$thisPart = urlencode($count);
$label = Text::sprintf('COM_AKEEBA_BUADMIN_LABEL_PART', $count);
?>
<?php if ($count > 0): ?>
&bull;
<?php endif; ?>
<a class="akeeba-btn--small--dark"
href="javascript:confirmDownload('<?php echo $thisID ?>', '<?php echo $thisPart ?>');">
<span class="akion-android-download"></span>
<?php echo $label; ?>
</a>
<?php endfor; ?>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
</div>
<?php if ($showManageRemote): ?>
<div style="padding-bottom: 3pt;">
<a class="akeeba-btn--primary akeeba_remote_management_link"
href="javascript:akeeba.Manage.onRemoteManagementClick('<?php echo $router->route('index.php?view=Remotefiles&tmpl=component&task=listActions&id=' . $record['id']) ?>', '<?php echo $router->route('index.php?view=Manage') ?>')"
>
<span class="akion-cloud"></span>
<?php echo Text::_('COM_AKEEBA_BUADMIN_LABEL_REMOTEFILEMGMT'); ?>
</a>
</div>
<?php elseif ($showUploadRemote): ?>
<a class="akeeba-btn--primary akeeba_upload"
href="javascript:akeeba.Manage.onUploadClick('<?php echo $router->route('index.php?view=Upload&tmpl=component&task=start&id=' . $record['id']) ?>', '<?php echo $router->route('index.php?view=Manage') ?>')"
title="<?php echo Text::sprintf('COM_AKEEBA_TRANSFER_DESC', Text::_("ENGINE_POSTPROC_{$postProcEngine}_TITLE")) ?>"
>
<span class="akion-android-upload"></span>
<?php echo Text::_('COM_AKEEBA_TRANSFER_TITLE') ?>
(<em><?php echo $postProcEngine ?></em>)
</a>
<?php endif; ?>
<div style="padding-bottom: 3pt">
<?php if ($showDownload): ?>
<a class="akeeba-btn--<?php echo $showManageRemote || $showUploadRemote ? 'smal--grey' : 'green'; ?>"
href="javascript:akeeba.Manage.onDownloadClick('#akeeba-buadmin-download-<?php echo (int) $record['id']; ?>')"
>
<span class="akion-android-download"></span>
<?php echo Text::_('COM_AKEEBA_BUADMIN_LOG_DOWNLOAD'); ?>
</a>
<?php endif; ?>
<?php if ($showViewLog): ?>
<a class="akeeba-btn--grey akeebaCommentPopover" <?php echo ($record['meta'] != 'obsolete') ? '' : 'disabled="disabled" onclick="return false;"' ?>
href="<?php echo $router->route('index.php?view=Log&tag=' . $this->escape($record['tag']) . '.' . $this->escape($record['backupid']) . '&task=start&profileid=' . $record['profile_id']) ?>"
data-original-title="<?php echo Text::_('COM_AKEEBA_BUADMIN_LBL_LOGFILEID'); ?>"
data-content="<?php echo $this->escape($record['backupid']) ?>"
>
<span class="akion-ios-search-strong"></span>
<?php echo Text::_('COM_AKEEBA_LOG'); ?>
</a>
<?php endif; ?>
<a class="akeeba-btn--grey--small akeebaCommentPopover"
href="javascript:akeeba.Manage.onShowInfoClick('#akeeba-buadmin-<?php echo (int)$record['id']; ?>')"
data-content="<?php echo Text::_('COM_AKEEBA_BUADMIN_LBL_BACKUPINFO'); ?>"
>
<span class="akion-information-circled"></span>
</a>
</div>

View File

@@ -0,0 +1,4 @@
{
"show": ["main"],
"order": 50
}