diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e9600ac8..89584d143 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/modules/system/assets/css/updates.css b/modules/system/assets/css/updates.css index 61f9d8f20..03ea787f4 100644 --- a/modules/system/assets/css/updates.css +++ b/modules/system/assets/css/updates.css @@ -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; diff --git a/modules/system/assets/less/updates.less b/modules/system/assets/less/updates.less index acb05939c..064effe5b 100644 --- a/modules/system/assets/less/updates.less +++ b/modules/system/assets/less/updates.less @@ -18,6 +18,11 @@ border-top: none; } + i { + margin-right: 7px; + color: @color-text-title; + } + small { text-transform: none; float: right; diff --git a/modules/system/classes/UpdateManager.php b/modules/system/classes/UpdateManager.php index f6b0d54c7..a1d2f5c16 100644 --- a/modules/system/classes/UpdateManager.php +++ b/modules/system/classes/UpdateManager.php @@ -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 // diff --git a/modules/system/controllers/Updates.php b/modules/system/controllers/Updates.php index 6cefab320..1d830a70b 100644 --- a/modules/system/controllers/Updates.php +++ b/modules/system/controllers/Updates.php @@ -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); diff --git a/modules/system/controllers/updates/_update_list.htm b/modules/system/controllers/updates/_update_list.htm index 8b0cf7e52..28bef79e7 100644 --- a/modules/system/controllers/updates/_update_list.htm +++ b/modules/system/controllers/updates/_update_list.htm @@ -13,6 +13,7 @@