diff --git a/CHANGELOG.md b/CHANGELOG.md index e419ff0b0..ed00ab737 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ -* **Build 15x** (2014-10-x) +* **Build 155** (2014-10-16) + - Back-end area can now be customized with colors and logo, via System > Customize Back-end. - Added twig filters `|trans` for `Lang::get(...)` and `|transchoice` for `Lang::choice(...)`. + - `SettingsModel` behavior now uses a cached database query. * **Build 153** (2014-10-09) - Plugins are now updated in order of their dependency definitions. diff --git a/README.md b/README.md index 78ba95dd7..184b46a4d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[October](http://octobercms.com) is a Content Management System (CMS) and web platform whose sole purpose is to make your development workflow simple again.We feel building websites has become a convoluted and confusing process that leaves developers unsatisfied, we want to turn you around to the simpler side and get back to basics. +[October](http://octobercms.com) is a Content Management System (CMS) and web platform whose sole purpose is to make your development workflow simple again. We feel building websites has become a convoluted and confusing process that leaves developers unsatisfied, we want to turn you around to the simpler side and get back to basics. October's mission is to show the world that web development is not rocket science. @@ -42,7 +42,7 @@ You can communicate with us using the following mediums: * [Follow us on Facebook](http://facebook.com/octobercms) for announcements and updates. * [Join us on IRC](https://kiwiirc.com/client/irc.freenode.net/?nick=Octonaut|?#october) to chat with us. -### Licence +### License The OctoberCMS platform is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT). diff --git a/modules/backend/ServiceProvider.php b/modules/backend/ServiceProvider.php index 0ee23b327..565513ce7 100644 --- a/modules/backend/ServiceProvider.php +++ b/modules/backend/ServiceProvider.php @@ -37,15 +37,18 @@ class ServiceProvider extends ModuleServiceProvider 'label' => 'File uploader', 'alias' => 'fileupload' ]); - $manager->registerFormWidget('Backend\FormWidgets\Relation', [ 'label' => 'Relationship', 'alias' => 'relation' ]); - $manager->registerFormWidget('Backend\FormWidgets\Datepicker', [ + $manager->registerFormWidget('Backend\FormWidgets\DatePicker', [ 'label' => 'Date picker', 'alias' => 'datepicker' ]); + $manager->registerFormWidget('Backend\FormWidgets\ColorPicker', [ + 'label' => 'Color picker', + 'alias' => 'colorpicker' + ]); $manager->registerFormWidget('Backend\FormWidgets\DataGrid', [ 'label' => 'Data Grid', 'alias' => 'datagrid' @@ -76,6 +79,14 @@ class ServiceProvider extends ModuleServiceProvider */ SettingsManager::instance()->registerCallback(function($manager){ $manager->registerSettingItems('October.Backend', [ + 'branding' => [ + 'label' => 'backend::lang.branding.menu_label', + 'description' => 'backend::lang.branding.menu_description', + 'category' => SettingsManager::CATEGORY_SYSTEM, + 'icon' => 'icon-paint-brush', + 'class' => 'Backend\Models\BrandSettings', + 'order' => 500, + ], 'editor' => [ 'label' => 'backend::lang.editor.menu_label', 'description' => 'backend::lang.editor.menu_description', diff --git a/modules/backend/assets/css/october.css b/modules/backend/assets/css/october.css index 26d3ed5f7..d255d107f 100644 --- a/modules/backend/assets/css/october.css +++ b/modules/backend/assets/css/october.css @@ -8257,7 +8257,7 @@ body.mainmenu-open .mainmenu-collapsed ul { padding: 13px; display: block; font-size: 12px; - color: #808b93; + color: rgba(255, 255, 255, 0.35); font-weight: normal; } #layout-sidenav ul li a:hover { @@ -8268,7 +8268,7 @@ body.mainmenu-open .mainmenu-collapsed ul { background: transparent; } #layout-sidenav ul li a i { - color: #808b93; + color: rgba(255, 255, 255, 0.35); display: block; margin-bottom: 5px; font-size: 28px; @@ -8331,7 +8331,7 @@ body.mainmenu-open .mainmenu-collapsed ul { top: 0; height: 9px; font-size: 10px; - color: #808b93; + color: rgba(255, 255, 255, 0.35); } #layout-sidenav .scroll-marker.before { top: 0; @@ -8350,11 +8350,11 @@ body.mainmenu-open .mainmenu-collapsed ul { } #layout-sidenav.layout-sidenav ul.drag li:not(.active) a:hover, .touch #layout-sidenav.layout-sidenav li:not(.active) a:hover { - color: #808b93 !important; + color: rgba(255, 255, 255, 0.35) !important; } #layout-sidenav.layout-sidenav ul.drag li:not(.active) a:hover i, .touch #layout-sidenav.layout-sidenav li:not(.active) a:hover i { - color: #808b93 !important; + color: rgba(255, 255, 255, 0.35) !important; } #layout-sidenav.layout-sidenav ul.drag li:not(.active) a:hover:after, .touch #layout-sidenav.layout-sidenav li:not(.active) a:hover:after { @@ -8418,7 +8418,7 @@ body.side-panel-fix-shadow #layout-side-panel { border-top: 1px solid #dfdfdf; } #layout-footer .brand, -#layout-footer .motto { +#layout-footer .tagline { margin: 10px; height: 40px; line-height: 40px; @@ -8430,10 +8430,10 @@ body.side-panel-fix-shadow #layout-side-panel { #layout-footer .brand .logo { margin: 0 10px; } -#layout-footer .motto { +#layout-footer .tagline { float: right; } -#layout-footer .motto p { +#layout-footer .tagline p { color: #999999; } body.outer { @@ -8451,16 +8451,16 @@ body.outer .layout > .layout-row.layout-head > .layout-cell { box-sizing: border-box; vertical-align: middle; } -body.outer .layout > .layout-row.layout-head > .layout-cell h1 { +body.outer .layout > .layout-row.layout-head > .layout-cell h1.oc-logo-white { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0; display: inline-block; - background: transparent url(../images/october-logo-text.png) no-repeat left top; - width: 404px; - height: 65px; + width: 100%; + max-width: 410px; + height: 72px; } body.outer .layout > .layout-row > .layout-cell { vertical-align: middle; @@ -8513,10 +8513,10 @@ body.outer .layout > .layout-row > .layout-cell .outer-form-container .forgot-pa top: 8px; } body.outer .layout > .layout-row > .layout-cell .outer-form-container .forgot-password a { - color: #8d969d; + color: rgba(255, 255, 255, 0.44); } body.outer .layout > .layout-row > .layout-cell .outer-form-container .forgot-password:before { - color: #8d969d; + color: rgba(255, 255, 255, 0.44); font-size: 14px; position: relative; margin-right: 5px; @@ -11150,11 +11150,17 @@ html.cssanimations .cursor-loading-indicator.hide { opacity: 1; filter: alpha(opacity=100); } +.oc-logo-white { + background-image: url(../images/october-logo-white.svg); + background-position: 50% 50%; + background-repeat: no-repeat; + background-size: contain; +} .oc-bg-logo { background-image: url(../images/october-logo-transparent.svg); background-position: 50% 50%; background-repeat: no-repeat; - background-size: 50% auto; + background-size: 50% contain; } .dropdown-menu { padding: 0; @@ -12664,7 +12670,7 @@ div.popover-overlay { .fancy-layout.control-tabs.master:after { top: 7px; font-size: 14px; - color: #e39664; + color: rgba(255, 255, 255, 0.35); } .fancy-layout .control-tabs.master:before, .fancy-layout.control-tabs.master:before { @@ -12708,7 +12714,7 @@ div.popover-overlay { top: 4px; right: 1px; color: rgba(255, 255, 255, 0.3) !important; - font: 14px bold "Helvetica Neue", Helvetica, Arial, sans-seri8; + font: 14px bold "Helvetica Neue", Helvetica, Arial, sans-serif; } .fancy-layout .control-tabs.master > div > div.tabs-container > ul.nav-tabs > li span.tab-close i:hover, .fancy-layout.control-tabs.master > div > div.tabs-container > ul.nav-tabs > li span.tab-close i:hover { @@ -12719,7 +12725,7 @@ div.popover-overlay { border-bottom: none; background: transparent; font-size: 14px; - color: #e39664; + color: rgba(255, 255, 255, 0.35); padding: 6px 0 0 0; overflow: visible; } @@ -13114,7 +13120,7 @@ div.popover-overlay { } .fancy-layout .form-tabless-fields label { text-transform: uppercase; - color: #f4c69e; + color: rgba(255, 255, 255, 0.5); margin-bottom: 0; } .fancy-layout .form-tabless-fields input[type=text] { @@ -13200,7 +13206,7 @@ div.popover-overlay { .fancy-layout .form-tabless-fields .loading-indicator-container .loading-indicator { background-color: #e67e22; padding: 0 0 0 30px; - color: #f4c69e; + color: rgba(255, 255, 255, 0.5); margin-top: 1px; height: 90%; font-size: 12px; @@ -13237,7 +13243,7 @@ div.popover-overlay { filter: alpha(opacity=100); } .fancy-layout .field-codeeditor { - border: none!important; + border: none !important; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; @@ -14551,7 +14557,7 @@ div[data-control="balloon-selector"]:not(.control-disabled) ul li:hover { padding: 15px 15px 15px 40px; background: #3d5265; margin-bottom: 1px; - color: #808c8d; + color: rgba(255, 255, 255, 0.26); text-decoration: none!important; } .sidenav-tree ul.top-level > li > ul li a:hover { @@ -14568,24 +14574,24 @@ div[data-control="balloon-selector"]:not(.control-disabled) ul li:hover { line-height: 150%; } .sidenav-tree ul.top-level > li > ul li a span.header { - color: #cad5d8; + color: rgba(255, 255, 255, 0.74); font-size: 14px; margin-bottom: 5px; } .sidenav-tree ul.top-level > li > ul li a span.description { - color: #bdc3c7; + color: rgba(255, 255, 255, 0.64); font-size: 12px; font-weight: 100; } .sidenav-tree ul.top-level > li > ul li.active a { background: #34495e; - color: #ecf0f1; + color: rgba(255, 255, 255, 0.91); } .sidenav-tree ul.top-level > li > ul li.active a:before { content: ' '; position: absolute; width: 4px; - background: #e6802b; + background: #e67e22; left: 0; top: 0; height: 100%; @@ -14594,7 +14600,7 @@ div[data-control="balloon-selector"]:not(.control-disabled) ul li:hover { color: #ffffff; } .sidenav-tree ul.top-level > li > ul li.active a span.description { - color: #ecf0f1; + color: rgba(255, 255, 255, 0.91); } .sidenav-tree ul.top-level > li > ul li:last-child a { margin-bottom: 0; @@ -14608,34 +14614,34 @@ div[data-control="balloon-selector"]:not(.control-disabled) ul li:hover { @media (max-width: 768px) { .sidenav-tree { width: 100%; - height: auto!important; - display: block!important; + height: auto !important; + display: block !important; } .sidenav-tree > .layout { display: none; } .sidenav-tree-root .sidenav-tree { - width: 100%!important; - height: 100%!important; + width: 100% !important; + height: 100% !important; display: table-cell !important; } .sidenav-tree-root .sidenav-tree .back-link { - display: none!important; + display: none !important; } .sidenav-tree-root .sidenav-tree > .layout { - display: table!important; + display: table !important; } .sidenav-tree-root #layout-body { display: none; } body.has-sidenav-tree .sidenav-tree .back-link { display: block; - background: #2b3e50; padding: 13px 15px; + background: #2b3e50; color: #bdc3c7; font-size: 14px; - text-transform: uppercase; line-height: 14px; + text-transform: uppercase; } body.has-sidenav-tree .sidenav-tree .back-link i { display: inline-block; @@ -14645,6 +14651,6 @@ div[data-control="balloon-selector"]:not(.control-disabled) ul li:hover { text-decoration: none; } body.has-sidenav-tree #layout-body { - display: block!important; + display: block !important; } } diff --git a/modules/backend/assets/images/october-logo-white.svg b/modules/backend/assets/images/october-logo-white.svg new file mode 100644 index 000000000..122438598 --- /dev/null +++ b/modules/backend/assets/images/october-logo-white.svg @@ -0,0 +1,75 @@ + + + +]> + diff --git a/modules/backend/assets/images/october-logo.svg b/modules/backend/assets/images/october-logo.svg new file mode 100644 index 000000000..b4121e44f --- /dev/null +++ b/modules/backend/assets/images/october-logo.svg @@ -0,0 +1,75 @@ + + + +]> + diff --git a/modules/backend/assets/less/controls/common.less b/modules/backend/assets/less/controls/common.less index 6f901fb1b..faab59d23 100644 --- a/modules/backend/assets/less/controls/common.less +++ b/modules/backend/assets/less/controls/common.less @@ -26,9 +26,20 @@ } } +// +// Logos +// + +.oc-logo-white { + background-image: url(../images/october-logo-white.svg); + background-position: 50% 50%; + background-repeat: no-repeat; + background-size: contain; +} + .oc-bg-logo { background-image: url(../images/october-logo-transparent.svg); background-position: 50% 50%; background-repeat: no-repeat; - background-size: 50% auto; + background-size: 50% contain; } diff --git a/modules/backend/assets/less/controls/fancylayout.less b/modules/backend/assets/less/controls/fancylayout.less index 52b01a3a3..e8fc91eb0 100644 --- a/modules/backend/assets/less/controls/fancylayout.less +++ b/modules/backend/assets/less/controls/fancylayout.less @@ -41,10 +41,10 @@ font-size: 14px; color: @color-fancy-master-tabs-inactive-text; } - &:before {left: 8px;} - &:after {right: 8px;} - &.scroll-before:before {color: @color-fancy-master-tabs-active-text;} - &.scroll-after:after {color: @color-fancy-master-tabs-active-text;} + &:before { left: 8px; } + &:after { right: 8px; } + &.scroll-before:before { color: @color-fancy-master-tabs-active-text; } + &.scroll-after:after { color: @color-fancy-master-tabs-active-text; } > div > div.tabs-container { background: @color-fancy-master-tabs-bg; @@ -65,12 +65,12 @@ i { top: 4px; right: 1px; - color: rgba(255, 255, 255, 0.3)!important; - font: 14px bold "Helvetica Neue", Helvetica, Arial, sans-seri8; - - &:hover {color: @color-fancy-master-tabs-active-text!important;} + color: rgba(255, 255, 255, 0.3) !important; + font: 14px bold "Helvetica Neue", Helvetica, Arial, sans-serif; + + &:hover { color: @color-fancy-master-tabs-active-text !important; } } - + } a { @@ -126,7 +126,7 @@ z-index: 107; color: @color-fancy-master-tabs-active-text; } - span.tab-close i {color: @color-fancy-master-tabs-active-text;} + span.tab-close i { color: @color-fancy-master-tabs-active-text; } a > span.title { background-color: @color-fancy-form-tabless-fields-bg; @@ -142,17 +142,17 @@ } } - &[data-modified] { - span.tab-close i { - top: 4px; - .hide-text(); + &[data-modified] { + span.tab-close i { + top: 4px; + .hide-text(); - &:before { - .icon(@circle); - font-size: 9px; - } + &:before { + .icon(@circle); + font-size: 9px; } } + } &:first-child { margin-left: 0; @@ -529,8 +529,8 @@ // Code editor // - .field-codeeditor { - border: none!important; + .field-codeeditor { + border: none !important; .border-radius(0); .editor-code { diff --git a/modules/backend/assets/less/controls/filelist.less b/modules/backend/assets/less/controls/filelist.less index 31e82171b..697a1a442 100644 --- a/modules/backend/assets/less/controls/filelist.less +++ b/modules/backend/assets/less/controls/filelist.less @@ -40,6 +40,7 @@ a:hover { background: @color-list-hover; } + &.active a { background: @color-list-active; position: relative; @@ -98,7 +99,7 @@ position: relative; outline: none; - &:hover {background: transparent;} + &:hover { background: transparent; } &:before, &:after { width: 10px; @@ -132,14 +133,16 @@ padding-left: 52px; } - > li.group {padding-left: 20px;} + > li.group { + padding-left: 20px; + } .listPaddings(10, 27px); } &[data-status=collapsed] { > h4 a:before, > div.group > h4 a:before { - .transform( ~'rotate(0deg) translate(3px, 0)' ); + .transform(~'rotate(0deg) translate(3px, 0)'); } & > ul, & > div.subitems { diff --git a/modules/backend/assets/less/controls/sidenav-tree.less b/modules/backend/assets/less/controls/sidenav-tree.less index 3e5ba2973..7b63e0bfb 100644 --- a/modules/backend/assets/less/controls/sidenav-tree.less +++ b/modules/backend/assets/less/controls/sidenav-tree.less @@ -20,10 +20,10 @@ background: #2b3e50!important; } - ul.top-level > li { + ul.top-level > li { &[data-status=collapsed] { > div.group h3:before { - .transform( ~'rotate(0deg) translate(3px, 0)' ); + .transform(~'rotate(0deg) translate(3px, 0)'); } ul { @@ -55,7 +55,7 @@ top: 15px; color: @color-list-arrow; .icon(@caret-right); - .transform( ~'rotate(90deg) translate(5px, 0)' ); + .transform(~'rotate(90deg) translate(5px, 0)'); .transition(all 0.1s ease); } } @@ -137,16 +137,14 @@ .back-link { display: none; - - } } @media (max-width: @screen-sm) { .sidenav-tree { width: 100%; - height: auto!important; - display: block!important; + height: auto !important; + display: block !important; > .layout { display: none; @@ -155,16 +153,16 @@ .sidenav-tree-root { .sidenav-tree { - width: 100%!important; - height: 100%!important; - display: table-cell!important; + width: 100% !important; + height: 100% !important; + display: table-cell !important; .back-link { - display: none!important; + display: none !important; } > .layout { - display: table!important; + display: table !important; } } @@ -177,12 +175,12 @@ .sidenav-tree { .back-link { display: block; - background: @color-sidebarnav-back-link-bg; padding: 13px 15px; + background: @color-sidebarnav-back-link-bg; color: @color-sidebarnav-back-link-text; font-size: 14px; - text-transform: uppercase; line-height: 14px; + text-transform: uppercase; i { display: inline-block; margin-right: 10px; @@ -194,7 +192,7 @@ } #layout-body { - display: block!important; + display: block !important; } } } \ No newline at end of file diff --git a/modules/backend/assets/less/core/variables.less b/modules/backend/assets/less/core/variables.less index 355a56f7d..3575c99e9 100644 --- a/modules/backend/assets/less/core/variables.less +++ b/modules/backend/assets/less/core/variables.less @@ -15,7 +15,7 @@ @btn-default-bg: #e3e3e3; @btn-default-border: #e3e3e3; -@tooltip-bg: #34495E; +@tooltip-bg: #34495e; @link-color: darken(@brand-primary, 15%); @link-hover-color: darken(@link-color, 30%); @@ -68,24 +68,24 @@ @color-footer-border: #dfdfdf; @color-footer-text: #666666; -@color-sidebarnav-bg: #34495E; -@color-sidebarnav-inactive-text: #808b93; -@color-sidebarnav-inactive-icon: #808b93; +@color-sidebarnav-bg: #34495e; @color-sidebarnav-active-text: #ffffff; @color-sidebarnav-active-icon: #ffffff; +@color-sidebarnav-inactive-text: rgba(255,255,255,.35); +@color-sidebarnav-inactive-icon: rgba(255,255,255,.35); @color-sidebarnav-counter-bg: #d9350f; @color-sidebarnav-counter-text: #ffffff; @color-sidebarnav-tree-group: #ecf0f1; @color-sidebarnav-tree-group-bg: #2b3e50; -@color-sidebarnav-tree-inactive-header: #CAD5D8; -@color-sidebarnav-tree-inactive-desc: #bdc3c7; -@color-sidebarnav-tree-inactive-text: #808c8d; +@color-sidebarnav-tree-inactive-header: rgba(255,255,255,.74); +@color-sidebarnav-tree-inactive-desc: rgba(255,255,255,.64); +@color-sidebarnav-tree-inactive-text: rgba(255,255,255,.26); @color-sidebarnav-tree-active-header: #ffffff; @color-sidebarnav-tree-inactive-bg: #3d5265; @color-sidebarnav-tree-active-bg: #34495e; -@color-sidebarnav-tree-active-text: #ecf0f1; -@color-sidebarnav-tree-active-marker: #e6802b; +@color-sidebarnav-tree-active-text: rgba(255,255,255,.91); +@color-sidebarnav-tree-active-marker: #e67e22; @color-sidebarnav-back-link-bg: #2b3e50; @color-sidebarnav-back-link-text: #bdc3c7; @@ -95,7 +95,7 @@ @color-list-arrow: #cfcfcf; @color-list-icon: #a1aab1; @color-list-parent-bg: #ffffff; -@color-list-nav-arrow: #34495E; +@color-list-nav-arrow: #34495e; @color-list-header-bg: transparent; @color-list-head-bg: #ffffff; @color-list-progress-bg: #0181b9; @@ -156,7 +156,7 @@ @color-ui-border: #d7d7d7; -@color-outer-muted-text: #8d969d; +@color-outer-muted-text: rgba(255,255,255,.44); @color-outer-heading: #feffff; @color-outer-description: #999999; @color-outer-bg: #2b3e50; @@ -229,7 +229,7 @@ @color-fancy-master-tabs-bg: #d35400; @color-fancy-master-tabs-active-text: #ffffff; -@color-fancy-master-tabs-inactive-text: #e39664; +@color-fancy-master-tabs-inactive-text: rgba(255, 255, 255, .35); @color-fancy-master-panel-bg: #d35400; @color-fancy-secondary-tabs-bg: #475354; @@ -243,7 +243,7 @@ @color-fancy-primary-tabs-inactive-bg: #d5d9d8; @color-fancy-form-tabless-fields-bg: #e67e22; -@color-fancy-form-label: #f4c69e; +@color-fancy-form-label: rgba(255, 255, 255, .5); @color-fancy-form-text: #ffffff; @color-fancy-form-text-selection: #d35400; @color-fancy-form-placeholder: #f4c69e; diff --git a/modules/backend/assets/less/layout/footer.less b/modules/backend/assets/less/layout/footer.less index 5ff344059..f3ae25f73 100644 --- a/modules/backend/assets/less/layout/footer.less +++ b/modules/backend/assets/less/layout/footer.less @@ -11,7 +11,7 @@ background-color: @color-footer; border-top: 1px solid @color-footer-border; - .brand, .motto { + .brand, .tagline { margin: 10px; height: (@footer-height - 20) + 0px; line-height: (@footer-height - 20) + 0px; @@ -24,7 +24,7 @@ .name { } } - .motto { + .tagline { float: right; p { color: lighten(@color-footer-text, 20%); } } diff --git a/modules/backend/assets/less/layout/outerlayout.less b/modules/backend/assets/less/layout/outerlayout.less index 281da987c..99db0e702 100644 --- a/modules/backend/assets/less/layout/outerlayout.less +++ b/modules/backend/assets/less/layout/outerlayout.less @@ -17,17 +17,16 @@ body.outer { .box-sizing(border-box); vertical-align: middle; - h1 { + h1.oc-logo-white { .hide-text(); display: inline-block; - background: transparent url(../images/october-logo-text.png) no-repeat left top; - width: 404px; - height: 65px; + width: 100%; + max-width: 410px; + height: 72px; } } } - > .layout-cell { vertical-align: middle; diff --git a/modules/backend/assets/less/layout/sidenav.less b/modules/backend/assets/less/layout/sidenav.less index 240e7a60a..8e14fd412 100644 --- a/modules/backend/assets/less/layout/sidenav.less +++ b/modules/backend/assets/less/layout/sidenav.less @@ -56,7 +56,7 @@ &.active a, a:hover { color: @color-sidebarnav-active-text; - i {color: @color-sidebarnav-active-icon;} + i { color: @color-sidebarnav-active-icon; } } span.counter { diff --git a/modules/backend/behaviors/ListController.php b/modules/backend/behaviors/ListController.php index 608d166dc..20da01854 100644 --- a/modules/backend/behaviors/ListController.php +++ b/modules/backend/behaviors/ListController.php @@ -260,6 +260,18 @@ class ListController extends ControllerBehavior return $this->listWidgets[$definition]->onRefresh(); } + /** + * Returns the widget used by this behavior. + * @return Backend\Classes\WidgetBase + */ + public function listGetWidget($definition = null) + { + if (!$definition) + $definition = $this->primaryDefinition; + + return array_get($this->listWidgets, $definition); + } + // // Overrides // diff --git a/modules/backend/behaviors/RelationController.php b/modules/backend/behaviors/RelationController.php index a53fff7a5..6c3aa1de4 100644 --- a/modules/backend/behaviors/RelationController.php +++ b/modules/backend/behaviors/RelationController.php @@ -414,7 +414,7 @@ class RelationController extends ControllerBehavior */ protected function findExistingRelationIds($checkIds = null) { - $foreignKeyName = $this->relationModel->getKeyName(); + $foreignKeyName = $this->relationModel->getQualifiedKeyName(); $results = $this->relationObject ->getBaseQuery() @@ -818,4 +818,4 @@ class RelationController extends ControllerBehavior return $this->sessionKey = FormHelper::getSessionKey(); } -} \ No newline at end of file +} diff --git a/modules/backend/behaviors/UserPreferencesModel.php b/modules/backend/behaviors/UserPreferencesModel.php index c88e61afa..de4b6e69b 100644 --- a/modules/backend/behaviors/UserPreferencesModel.php +++ b/modules/backend/behaviors/UserPreferencesModel.php @@ -38,18 +38,8 @@ class UserPreferencesModel extends SettingsModel if (isset(self::$instances[$this->recordCode])) return self::$instances[$this->recordCode]; - $item = UserPreferences::forUser(); - $item = $item->scopeFindRecord($this->model, $this->recordCode, $item->userContext)->first(); - - if (!$item) { + if (!$item = $this->getSettingsRecord()) { $this->model->initSettingsData(); - - if (method_exists($this->model, 'forceSave')) - $this->model->forceSave(); - else - $this->model->save(); - - $this->model->reload(); $item = $this->model; } @@ -61,7 +51,21 @@ class UserPreferencesModel extends SettingsModel */ public function isConfigured() { - return UserPreferences::forUser()->findRecord($this->recordCode, $item->userContext)->count() > 0; + return $this->getSettingsRecord() !== null; + } + + /** + * Returns the raw Model record that stores the settings. + * @return Model + */ + public function getSettingsRecord() + { + $item = UserPreferences::forUser(); + $record = $item->scopeFindRecord($this->model, $this->recordCode, $item->userContext) + ->remember(1440, $this->getCacheKey()) + ->first(); + + return $record ?: null; } /** @@ -95,4 +99,12 @@ class UserPreferencesModel extends SettingsModel return parent::isKeyAllowed($key); } -} \ No newline at end of file + + /** + * Returns a cache key for this record. + */ + protected function getCacheKey() + { + return 'backend::userpreferences.'.$this->recordCode; + } +} \ No newline at end of file diff --git a/modules/backend/classes/Controller.php b/modules/backend/classes/Controller.php index 88d6557df..4c214048d 100644 --- a/modules/backend/classes/Controller.php +++ b/modules/backend/classes/Controller.php @@ -276,10 +276,9 @@ class Controller extends Extendable if ($result instanceof RedirectResponse) return $result; - // Translate the page title - $this->pageTitle = $this->pageTitle - ? Lang::get($this->pageTitle) - : Lang::get('backend::lang.page.untitled'); + // No page title + if (!$this->pageTitle) + $this->pageTitle = 'backend::lang.page.untitled'; // Load the view if (!$this->suppressView && is_null($result)) diff --git a/modules/backend/controllers/EditorPreferences.php b/modules/backend/controllers/EditorPreferences.php index e73c695de..6969673cb 100644 --- a/modules/backend/controllers/EditorPreferences.php +++ b/modules/backend/controllers/EditorPreferences.php @@ -1,6 +1,5 @@ vars['margin'] = 0; $this->asExtension('FormController')->update(); - $this->pageTitle = Lang::get('backend::lang.editor.menu_label'); + $this->pageTitle = 'backend::lang.editor.menu_label'; } public function index_onSave() diff --git a/modules/backend/controllers/Index.php b/modules/backend/controllers/Index.php index 8f422c1f3..499bd6013 100644 --- a/modules/backend/controllers/Index.php +++ b/modules/backend/controllers/Index.php @@ -37,7 +37,7 @@ class Index extends Controller public function index() { - $this->pageTitle = trans('backend::lang.dashboard.menu_label'); + $this->pageTitle = 'backend::lang.dashboard.menu_label'; BackendMenu::setContextMainMenu('dashboard'); } } \ No newline at end of file diff --git a/modules/backend/controllers/Users.php b/modules/backend/controllers/Users.php index 5db153b3d..2839cfbef 100644 --- a/modules/backend/controllers/Users.php +++ b/modules/backend/controllers/Users.php @@ -1,6 +1,5 @@ pageTitle = Lang::get('backend::lang.myaccount.menu_label'); + $this->pageTitle = 'backend::lang.myaccount.menu_label'; return $this->update($this->user->id, 'myaccount'); } diff --git a/modules/backend/controllers/auth/signin.htm b/modules/backend/controllers/auth/signin.htm index 82ce38808..f5ddccf52 100644 --- a/modules/backend/controllers/auth/signin.htm +++ b/modules/backend/controllers/auth/signin.htm @@ -1,4 +1,4 @@ -
= e(trans('system::lang.settings.return')) ?>
\ No newline at end of file diff --git a/modules/backend/controllers/groups/create.htm b/modules/backend/controllers/groups/create.htm index 62f852781..3000b0d79 100644 --- a/modules/backend/controllers/groups/create.htm +++ b/modules/backend/controllers/groups/create.htm @@ -2,7 +2,7 @@= e(trans('backend::lang.user.group.return')) ?>
\ No newline at end of file diff --git a/modules/backend/controllers/groups/index.htm b/modules/backend/controllers/groups/index.htm index c3dccaf27..ee75b8527 100644 --- a/modules/backend/controllers/groups/index.htm +++ b/modules/backend/controllers/groups/index.htm @@ -1,7 +1,7 @@= e(trans('backend::lang.user.group.return')) ?>
\ No newline at end of file diff --git a/modules/backend/controllers/users/create.htm b/modules/backend/controllers/users/create.htm index 828987baa..bbbb4c83b 100644 --- a/modules/backend/controllers/users/create.htm +++ b/modules/backend/controllers/users/create.htm @@ -1,7 +1,7 @@| full: | +![]() |
+
| rgbhex: | +![]() |
+
| hex: | +![]() |
+
= e(trans('system::lang.app.motto')) ?>
+= e(trans('system::lang.app.tagline')) ?>
= e(trans('system::lang.mail_templates.return')) ?>
diff --git a/modules/system/controllers/maillayouts/update.htm b/modules/system/controllers/maillayouts/update.htm index 52599fddb..d21fa821a 100644 --- a/modules/system/controllers/maillayouts/update.htm +++ b/modules/system/controllers/maillayouts/update.htm @@ -1,7 +1,7 @@= e(trans('system::lang.mail_templates.return')) ?>
diff --git a/modules/system/controllers/mailtemplates/create.htm b/modules/system/controllers/mailtemplates/create.htm index db42fd5c4..05b11f3fa 100644 --- a/modules/system/controllers/mailtemplates/create.htm +++ b/modules/system/controllers/mailtemplates/create.htm @@ -1,7 +1,7 @@= e(trans('system::lang.mail_templates.return')) ?>
diff --git a/modules/system/controllers/mailtemplates/update.htm b/modules/system/controllers/mailtemplates/update.htm index 61a06871c..e812f8639 100644 --- a/modules/system/controllers/mailtemplates/update.htm +++ b/modules/system/controllers/mailtemplates/update.htm @@ -1,7 +1,7 @@= e(trans('system::lang.mail_templates.return')) ?>
diff --git a/modules/system/controllers/requestlogs/preview.htm b/modules/system/controllers/requestlogs/preview.htm index b690986af..fe9b83583 100644 --- a/modules/system/controllers/requestlogs/preview.htm +++ b/modules/system/controllers/requestlogs/preview.htm @@ -1,7 +1,7 @@