From e09c74b11eab29166bb31b569c7ca51410e2da50 Mon Sep 17 00:00:00 2001 From: Sam Georges Date: Thu, 17 Jul 2014 18:02:59 +1000 Subject: [PATCH 01/32] Align UserPreferencesModel with SettingsModel --- CHANGELOG.md | 4 ++++ modules/backend/behaviors/UserPreferencesModel.php | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae33f12bf..58ba933c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +* **Build 124** (2014-07-17) + - Improvements to Twig functions and filters. + - URL, HTML and Form helpers are now available in Twig. + * **Build 122** (2014-07-15) - Restyled the CMS tabs diff --git a/modules/backend/behaviors/UserPreferencesModel.php b/modules/backend/behaviors/UserPreferencesModel.php index a05a8ada1..bc186a983 100644 --- a/modules/backend/behaviors/UserPreferencesModel.php +++ b/modules/backend/behaviors/UserPreferencesModel.php @@ -70,9 +70,6 @@ class UserPreferencesModel extends SettingsModel */ public function beforeModelSave() { - // Purge the field values from the attributes - $this->model->attributes = array_diff_key($this->model->attributes, $this->fieldValues); - $preferences = UserPreferences::forUser(); list($namespace, $group, $item) = $preferences->parseKey($this->recordCode); $this->model->item = $item; From 242a3a5cde6f7dbe2c92d8fca9945d6ae21f6bd6 Mon Sep 17 00:00:00 2001 From: Sam Georges Date: Thu, 17 Jul 2014 18:42:12 +1000 Subject: [PATCH 02/32] Buttons inside a popup support new `data-popup-load-indicator` attribute. Other minor improvements --- CHANGELOG.md | 5 +++ modules/backend/assets/css/october.css | 3 +- .../assets/js/october.loadindicator.js | 2 +- modules/backend/assets/js/october.popup.js | 33 ++++++++++++++++--- .../assets/less/controls/breadcrumb.less | 8 ++--- .../backend/assets/less/controls/popup.less | 2 +- modules/backend/classes/Controller.php | 5 ++- .../widgets/grid/assets/js/datagrid.js | 9 ++++- .../handsontable/jquery.handsontable.js | 7 +++- .../backend/widgets/grid/partials/_grid.htm | 4 +-- 10 files changed, 62 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58ba933c8..c16731346 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ +* **Build 125** (2014-07-xx) + - New shorthand method for `$this->getClassExtension('Backend.Behaviors.FormController')` becomes `$this->asExtension('FormController')`. + - Buttons inside a popup support new `data-popup-load-indicator` attribute. + * **Build 124** (2014-07-17) - Improvements to Twig functions and filters. - URL, HTML and Form helpers are now available in Twig. + - The DataGrid form widget has been moved to a standard widget called Grid. * **Build 122** (2014-07-15) - Restyled the CMS tabs diff --git a/modules/backend/assets/css/october.css b/modules/backend/assets/css/october.css index 674351cf2..157923823 100644 --- a/modules/backend/assets/css/october.css +++ b/modules/backend/assets/css/october.css @@ -11518,7 +11518,8 @@ ul.status-list li span.status.info { .control-breadcrumb li:last-child:after { content: ''; } -.control-breadcrumb + .content-tabs { +.control-breadcrumb + .content-tabs, +.control-breadcrumb + .padded-container { margin-top: -20px; } body.slim-container .control-breadcrumb { diff --git a/modules/backend/assets/js/october.loadindicator.js b/modules/backend/assets/js/october.loadindicator.js index a5bcc2667..880c4a9ee 100644 --- a/modules/backend/assets/js/october.loadindicator.js +++ b/modules/backend/assets/js/october.loadindicator.js @@ -101,7 +101,7 @@ // LOADINDICATOR DATA-API // ============== - + $(document) .on('ajaxPromise', '[data-load-indicator]', function() { var diff --git a/modules/backend/assets/js/october.popup.js b/modules/backend/assets/js/october.popup.js index 6e7675dcf..a6749fd0d 100644 --- a/modules/backend/assets/js/october.popup.js +++ b/modules/backend/assets/js/october.popup.js @@ -38,6 +38,11 @@ this.$modal = this.$target.modal({ show: false, backdrop: false, keyboard: this.options.keyboard }) this.isAjax = this.options.handler || this.options.ajax + /* + * Duplicate the popup reference on the .control-popup container + */ + this.$target.data('oc.popup', this) + /* * Hook in to BS Modal events */ @@ -50,7 +55,7 @@ setTimeout(function() { self.$content.empty() }, 500) } }) - + this.$modal.on('show.bs.modal', function(){ self.isOpen = true self.setBackdrop(true) @@ -156,7 +161,7 @@ this.$backdrop.addClass('in') - this.$backdrop.append($(' diff --git a/modules/cms/lang/en/lang.php b/modules/cms/lang/en/lang.php index 0915f730a..661443dc6 100644 --- a/modules/cms/lang/en/lang.php +++ b/modules/cms/lang/en/lang.php @@ -24,8 +24,8 @@ return [ 'settings_menu' => 'Front-end theme', 'settings_menu_description' => 'Preview the list of installed themes and select an active theme.', 'find_more_themes' => 'Find more themes on OctoberCMS Theme Marketplace.', - 'activate_btn' => 'Activate', - 'active_btn' => 'Activate', + 'activate_button' => 'Activate', + 'active_button' => 'Activate', ], 'page' => [ 'not_found' => [ From a43f4f6b518148d8cce797863dae5eea7ad412c8 Mon Sep 17 00:00:00 2001 From: Sam Georges Date: Sat, 19 Jul 2014 16:07:32 +1000 Subject: [PATCH 15/32] Use Parameters model instead of raw DB --- modules/cms/classes/Theme.php | 30 +++++++++---------- modules/cms/controllers/theme/_theme_list.htm | 2 +- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/modules/cms/classes/Theme.php b/modules/cms/classes/Theme.php index 9e5dc8e77..83bcd0dc2 100644 --- a/modules/cms/classes/Theme.php +++ b/modules/cms/classes/Theme.php @@ -1,15 +1,15 @@ remember(1440, $paramKey) + ->pluck('value') + ; - $dbResult = DB::table('system_settings') - ->where('item', '=', $configKey) - ->remember(1440, $configKey) - ->pluck('value'); if ($dbResult !== null) $activeTheme = $dbResult; @@ -127,11 +127,9 @@ class Theme */ public static function setActiveTheme($code) { - $configKey = 'cms.activeTheme'; - - DB::table('system_settings')->where('item', '=', $configKey)->delete(); - DB::table('system_settings')->insert(['item'=>$configKey, 'value'=>$code]); - Cache::forget($configKey); + $paramKey = 'cms::theme.active'; + Parameters::set($paramKey, $code); + Cache::forget($paramKey); } /** diff --git a/modules/cms/controllers/theme/_theme_list.htm b/modules/cms/controllers/theme/_theme_list.htm index c4f01374f..e7f9670c6 100644 --- a/modules/cms/controllers/theme/_theme_list.htm +++ b/modules/cms/controllers/theme/_theme_list.htm @@ -25,7 +25,7 @@ disabled class="btn btn-disabled"> - +