Add initial theme support to update process
This commit is contained in:
parent
9b85038203
commit
f9a68456ae
|
|
@ -3,6 +3,7 @@
|
|||
- New shorthand method for `$this->getClassExtension('Backend.Behaviors.FormController')` becomes `$this->asExtension('FormController')`.
|
||||
- Buttons inside a popup support new `data-popup-load-indicator` attribute.
|
||||
- Added a new config item to disable core updates completely (see config cms.disableCoreUpdates).
|
||||
- Added a unique alternate favicon to the Back-end area.
|
||||
|
||||
* **Build 124** (2014-07-17)
|
||||
- Improvements to Twig functions and filters.
|
||||
|
|
|
|||
|
|
@ -14,6 +14,10 @@
|
|||
.control-updatelist h5:first-of-type {
|
||||
border-top: none;
|
||||
}
|
||||
.control-updatelist h5 i {
|
||||
margin-right: 7px;
|
||||
color: #405261;
|
||||
}
|
||||
.control-updatelist h5 small {
|
||||
text-transform: none;
|
||||
float: right;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,11 @@
|
|||
border-top: none;
|
||||
}
|
||||
|
||||
i {
|
||||
margin-right: 7px;
|
||||
color: @color-text-title;
|
||||
}
|
||||
|
||||
small {
|
||||
text-transform: none;
|
||||
float: right;
|
||||
|
|
|
|||
|
|
@ -206,6 +206,16 @@ class UpdateManager
|
|||
}
|
||||
$result['plugins'] = $plugins;
|
||||
|
||||
/*
|
||||
* Strip out themes that have been installed before
|
||||
*/
|
||||
$themes = [];
|
||||
foreach (array_get($result, 'themes', []) as $code => $info) {
|
||||
if (!$this->isThemeInstalled($code))
|
||||
$themes[$code] = $info;
|
||||
}
|
||||
$result['themes'] = $themes;
|
||||
|
||||
Parameters::set('system::update.count', array_get($result, 'update', 0));
|
||||
|
||||
return $result;
|
||||
|
|
@ -433,6 +443,31 @@ class UpdateManager
|
|||
@unlink($filePath);
|
||||
}
|
||||
|
||||
//
|
||||
// Themes
|
||||
//
|
||||
|
||||
/**
|
||||
* Checks if a theme has ever been installed before.
|
||||
* @param string $name Theme code
|
||||
* @return boolean
|
||||
*/
|
||||
public function isThemeInstalled($name)
|
||||
{
|
||||
return array_key_exists($name, Parameters::get('system::theme.history', []));
|
||||
}
|
||||
|
||||
/**
|
||||
* Flags a theme as being installed, so it is not downloaded twice.
|
||||
* @param string $name Theme code
|
||||
*/
|
||||
public function setThemeInstalled($name)
|
||||
{
|
||||
$history = Parameters::get('system::theme.history', []);
|
||||
$history[$name] = Carbon::now()->timestamp;
|
||||
Parameters::set('system::theme.history', $history);
|
||||
}
|
||||
|
||||
//
|
||||
// Notes
|
||||
//
|
||||
|
|
|
|||
|
|
@ -158,7 +158,8 @@ class Updates extends Controller
|
|||
|
||||
$this->vars['core'] = array_get($result, 'core', false);
|
||||
$this->vars['hasUpdates'] = array_get($result, 'update', false);
|
||||
$this->vars['updateList'] = array_get($result, 'plugins', []);
|
||||
$this->vars['pluginList'] = array_get($result, 'plugins', []);
|
||||
$this->vars['themeList'] = array_get($result, 'themes', []);
|
||||
}
|
||||
catch (Exception $ex) {
|
||||
$this->handleError($ex);
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
<?php if ($core): ?>
|
||||
<h5>
|
||||
<i class="icon-cube"></i>
|
||||
<?= e(trans('system::lang.system.name')) ?>
|
||||
<?php if ($core['old_build']): ?>
|
||||
<?= e(trans('system::lang.updates.core_build_old', ['build'=>$core['old_build']])) ?>
|
||||
|
|
@ -26,8 +27,21 @@
|
|||
<input type="hidden" name="build" value="<?= e($core['build']) ?>" />
|
||||
<?php endif ?>
|
||||
|
||||
<?php foreach ($updateList as $code => $plugin): ?>
|
||||
<?php foreach ($themeList as $code => $theme): ?>
|
||||
<h5>
|
||||
<i class="icon-picture-o"></i>
|
||||
<?= e(array_get($theme, 'name', 'Unknown')) ?>
|
||||
<small>Theme</small>
|
||||
</h5>
|
||||
<dl>
|
||||
<dt><?= e(array_get($theme, 'version', 'v1.0.0')) ?></dt>
|
||||
<dd>New theme installation.</dd>
|
||||
</dl>
|
||||
<?php endforeach ?>
|
||||
|
||||
<?php foreach ($pluginList as $code => $plugin): ?>
|
||||
<h5>
|
||||
<i class="icon-puzzle-piece"></i>
|
||||
<?= e($plugin['name']) ?>
|
||||
|
||||
<?php if ($plugin['old_version']): ?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue