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,85 @@
<?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\Update;
use Awf\Mvc\View;
use Awf\Registry\Registry;
use Awf\Text\Text;
use Awf\Utils\Template;
use Solo\Model\Main;
use Solo\Model\Update;
class Html extends View
{
/**
* The update information registry
*
* @var Registry
*/
public $updateInfo;
public $needsDownloadId;
public function display($tpl = null)
{
Template::addJs('media://js/solo/update.js', $this->container->application);
return parent::display($tpl);
}
public function onBeforeMain()
{
/** @var Update $model */
$model = $this->getModel();
/** @var Main $modelMain */
$modelMain = $this->getModel('Main');
$this->updateInfo = $model->getUpdateInformation();
$this->needsDownloadId = $modelMain->needsDownloadID();
if ($this->updateInfo->get('stuck', 0))
{
$this->layout = 'stuck';
}
return true;
}
public function onBeforeDownload()
{
Text::script('SOLO_UPDATE_ERR_INVALIDDOWNLOADID');
$token = $this->getContainer()->session->getCsrfToken()->getValue();
$router = $this->getContainer()->router;
$ajaxUrl = $router->route('index.php?view=update&task=downloader&format=raw');
$nextStepUrl = $router->route('index.php?view=update&task=extract&token=' . $token);
$document = $this->getContainer()->application->getDocument();
$document->addScriptOptions('akeeba.System.params.AjaxURL', $ajaxUrl);
$document->addScriptOptions('akeeba.Update.nextStepUrl', $nextStepUrl);
$document->addScriptOptions('akeeba.Update.autoAction', 'startDownload');
return true;
}
public function onBeforeExtract()
{
$router = $this->getContainer()->router;
$ajaxUrl = \Awf\Uri\Uri::base(false, $this->container) . 'restore.php';
$finalizeUrl = $router->route('index.php?view=update&task=finalise');
$password = $this->getModel()->getState('update_password', '');
$document = $this->getContainer()->application->getDocument();
$document->addScriptOptions('akeeba.System.params.AjaxURL', $ajaxUrl);
$document->addScriptOptions('akeeba.Update.finaliseUrl', $finalizeUrl);
$document->addScriptOptions('akeeba.System.params.password', $password);
$document->addScriptOptions('akeeba.Update.autoAction', 'pingExtract');
return true;
}
}

View File

@@ -0,0 +1,153 @@
<?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\Update\Html $this */
$router = $this->container->router;
$releaseNotes = $this->updateInfo->get('releasenotes');
$infoUrl = $this->updateInfo->get('infourl');
$requirePlatformName = $this->container->segment->get('platformNameForUpdates', 'php');
?>
<?php if (!empty($releaseNotes)): ?>
<div class="modal fade" id="releaseNotesPopup" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none">
<div class="akeeba-renderer-fef <?php echo ($this->getContainer()->appConfig->get('darkmode', -1) == 1) ? 'akeeba-renderer-fef--dark' : '' ?>">
<h4 class="modal-title" id="myModalLabel">
<?php echo Text::_('SOLO_UPDATE_RELEASENOTES'); ?>
</h4>
<div>
<p>
<?php echo $releaseNotes; ?>
</p>
</div>
</div>
</div>
<?php endif; ?>
<?php if ($this->needsDownloadId): ?>
<div id="solo-error-update-nodownloadid" class="akeeba-block--failure">
<p>
<?php echo Text::_('SOLO_UPDATE_ERROR_NEEDSAUTH'); ?>
</p>
</div>
<?php endif; ?>
<?php if (!$this->updateInfo->get('loadedUpdate', 1)): ?>
<div class="akeeba-block--failure" id="solo-error-update-noconnection">
<h3>
<?php echo Text::_('SOLO_UPDATE_NOCONNECTION_HEAD') ?>
</h3>
<p>
<?php echo Text::sprintf('SOLO_UPDATE_NOCONNECTION_BODY', $this->getModel()->getUpdateStreamURL()) ?>
</p>
</div>
<?php elseif ($this->updateInfo->get('hasUpdate', 0)): ?>
<div class="akeeba-block--warning" id="solo-warning-update-found">
<h3>
<?php echo Text::_('SOLO_UPDATE_HASUPDATES_HEAD') ?>
</h3>
</div>
<?php elseif (!$this->updateInfo->get('minstabilityMatch', 0)): ?>
<div class="akeeba-block--info" id="solo-error-update-minstability">
<h3>
<?php echo Text::_('SOLO_UPDATE_MINSTABILITY_HEAD') ?>
</h3>
</div>
<?php elseif (!$this->updateInfo->get('platformMatch', 0)): ?>
<div class="akeeba-block--failure" id="solo-error-update-platform-mismatch">
<h3>
<?php if (empty($requirePlatformName) || ($requirePlatformName == 'php')): ?>
<?php echo Text::_('SOLO_UPDATE_PLATFORM_HEAD') ?>
<?php elseif ($requirePlatformName == 'wordpress'): ?>
<?php echo Text::_('SOLO_UPDATE_WORDPRESS_PLATFORM_HEAD') ?>
<?php elseif ($requirePlatformName == 'joomla'): ?>
<?php echo Text::_('SOLO_UPDATE_JOOMLA_PLATFORM_HEAD') ?>
<?php endif; ?>
</h3>
</div>
<?php else: ?>
<div class="akeeba-block--success" id="solo-success-update-uptodate">
<h3>
<?php echo Text::_('SOLO_UPDATE_NOUPDATES_HEAD') ?>
</h3>
</div>
<?php endif; ?>
<table class="liveupdate-infotable akeeba-table--striped">
<tr>
<td><?php echo Text::_('SOLO_UPDATE_CURRENTVERSION') ?></td>
<td>
<span class="akeeba-label--info">
<?php echo AKEEBABACKUP_VERSION ?>
</span>
</td>
</tr>
<tr>
<td><?php echo Text::_('SOLO_UPDATE_LATESTVERSION') ?></td>
<td>
<span class="akeeba-label--success">
<?php echo $this->updateInfo->get('version') ?>
</span>
</td>
</tr>
<tr>
<td><?php echo Text::_('SOLO_UPDATE_LATESTRELEASED') ?></td>
<td><?php echo $this->updateInfo->get('date') ?></td>
</tr>
<tr>
<td><?php echo Text::_('SOLO_UPDATE_DOWNLOADURL') ?></td>
<td>
<a href="<?php echo $this->updateInfo->get('link') ?>">
<?php echo $this->escape($this->updateInfo->get('link')) ?>
</a>
</td>
</tr>
<?php if (!empty($releaseNotes) || !empty($infoUrl)): ?>
<tr>
<td><?php echo Text::_('SOLO_UPDATE_RELEASEINFO') ?></td>
<td>
<?php if (!empty($releaseNotes)): ?>
<a href="#" id="btnLiveUpdateReleaseNotes"
onclick="akeeba.Modal.open({inherit: '#releaseNotesPopup', width: '80%'}); return false;">
<?php echo Text::_('SOLO_UPDATE_RELEASENOTES') ?>
</a>
<?php endif; ?>
<?php if (!empty($releaseNotes) && !empty($infoUrl)): ?>
&nbsp;&bull;&nbsp;
<?php endif; ?>
<?php if (!empty($infoUrl)): ?>
<a href="<?php echo $infoUrl ?>" target="_blank" class="btn btn-link">
<?php echo Text::_('SOLO_UPDATE_READMOREINFO') ?>
</a>
<?php endif; ?>
</td>
</tr>
<?php endif; ?>
</table>
<p>
<?php if ($this->updateInfo->get('hasUpdate', 0)): ?>
<?php $disabled = $this->needsDownloadId ? 'disabled="disabled"' : '' ?>
<a <?php echo $disabled ?>
href="<?php echo $router->route('index.php?view=update&task=download') ?>"
class="akeeba-btn--large--primary">
<span class="akion-chevron-right"></span>
<?php echo Text::_('SOLO_UPDATE_DO_UPDATE') ?>
</a>
<?php endif; ?>
<a href="<?php echo $router->route('index.php?view=update&force=1') ?>"
class="akeeba-btn--grey">
<span class="akion-refresh"></span>
<?php echo Text::_('SOLO_UPDATE_REFRESH_INFO') ?>
</a>
</p>

View File

@@ -0,0 +1,67 @@
<?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\Update\Html $this */
$router = $this->container->router;
$token = $this->container->session->getCsrfToken()->getValue();
?>
<div id="extractProgress">
<div class="akeeba-block--warning">
<span><?php echo Text::_('COM_AKEEBA_BACKUP_TEXT_BACKINGUP')?></span>
</div>
<div id="extractProgressBarContainer" class="akeeba-progress">
<div id="extractProgressBar" class="akeeba-progress-fill" role="progressbar" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
</div>
<div class="akeeba-progress-status" id="extractProgressBarInfo">0%</div>
</div>
<div class="akeeba-block--info" id="extractProgressInfo">
<h4>
<?php echo Text::_('SOLO_UPDATE_EXTRACT_LBL_EXTRACTPROGRESS') ?>
</h4>
<div id="extractProgressBarText">
<span class="akion-pie-graph"></span>
<span id="extractProgressBarTextPercent">0</span> %
<br/>
<span class="akion-android-folder-open"></span>
<span id="extractProgressBarTextIn">0 KiB</span>
<br/>
<span class="akion-stats-bars"></span>
<span id="extractProgressBarTextOut">0 KiB</span>
<br/>
<span class="akion-document-text"></span>
<span id="extractProgressBarTextFile"></span>
</div>
</div>
</div>
<div id="extractPingError" style="display: none">
<div class="akeeba-block--failure">
<h3>
<?php echo Text::_('SOLO_UPDATE_EXTRACT_ERR_CANTPING_TEXT'); ?>
</h3>
<p>
<?php echo Text::_('SOLO_UPDATE_EXTRACT_ERR_CANTPING_CONTACTHOST'); ?>
</p>
</div>
</div>
<div id="extractError" style="display: none">
<div class="akeeba-block--failure">
<h4>
<?php echo Text::_('SOLO_UPDATE_EXTRACT_ERR_EXTRACTERROR_HEADER') ?>
</h4>
<div class="panel-body" id="extractErrorText"></div>
</div>
</div>

View File

@@ -0,0 +1,32 @@
<?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\Update\Html $this */
$router = $this->container->router;
$product = Text::_('SOLO_APP_TITLE')
?>
<div class="akeeba-block--failure" id="solo-error-update-stuck">
<h3>
<?php echo Text::_('SOLO_UPDATE_STUCK_HEAD') ?>
</h3>
<p><?php echo Text::_('SOLO_UPDATE_STUCK_INFO'); ?></p>
<p><?php echo Text::sprintf('SOLO_UPDATE_NOTSUPPORTED_ALTMETHOD', $product); ?></p>
<p class="liveupdate-buttons">
<a href="<?php echo $router->route('index.php?view=update&force=1') ?>" class="akeeba-btn--primary">
<span class="akion-refresh"></span>
<?php echo Text::_('SOLO_UPDATE_REFRESH_INFO') ?>
</a>
</p>
</div>

View File

@@ -0,0 +1,3 @@
{
"show": []
}