* Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * * @copyright Copyright (c) http://cakemanager.org * @link http://cakemanager.org CakeManager Project * @since 1.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ use Cake\Core\Configure; use Cake\Core\Plugin; use Settings\Core\Setting; # Plugins Plugin::load('Utils', []); Plugin::load('Settings', ['bootstrap' => true, 'routes' => true]); Plugin::load('Notifier', ['bootstrap' => true, 'routes' => true]); # Configurations Configure::write('Session.timeout', 4320); Configure::write('CA.theme', 'CakeAdmin'); Configure::write('CA.viewClass', null); Configure::write('CA.layout.default', 'CakeAdmin.default'); Configure::write('CA.layout.login', 'CakeAdmin.login'); Configure::write('CA.fields', ['username' => 'email', 'password' => 'password']); Configure::write('CA.Menu.main', []); Configure::write('Settings.Prefixes.CA', 'CakeAdmin'); Configure::write('CA.PostTypes', []); Configure::write('CA.Models.administrators', 'CakeAdmin.Administrators'); # Settings Setting::register('App.Name', 'CakeAdmin Application'); # Theming Plugin::load('LightStrap', ['bootstrap' => true, 'routes' => true]);
<?php /** * CakeManager (http://cakemanager.org) * Copyright (c) http://cakemanager.org * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * * @copyright Copyright (c) http://cakemanager.org * @link http://cakemanager.org CakeManager Project * @since 1.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ use Cake\Core\Configure; use Cake\Core\Plugin; use Settings\Core\Setting; Plugin::load('Bootstrap'); Configure::write('Settings.Prefixes.LS', 'LightStrap'); Configure::write('CA.viewClass', 'LightStrap.App'); Configure::write('CA.theme', 'LightStrap'); Setting::register('LS.subtheme', 'Cosmo', ['options' => [null => 'None', 'Cerulean' => 'Cerulean', 'Cosmo' => 'Cosmo', 'Cyborg' => 'Cyborg', 'Darkly' => 'Darkly', 'Flatly' => 'Flatly', 'Journal' => 'Journal', 'Lumen' => 'Lumen', 'Paper' => 'Paper', 'Readable' => 'Readable', 'Simplex' => 'Simplex', 'Slate' => 'Slate', 'Spacelab' => 'Spacelab', 'Superhero' => 'Superhero', 'United' => 'United', 'Yeti' => 'Yeti'], 'type' => 'select']); Configure::write('CA.LightStrap.subtheme', Setting::read('LS.subtheme')); Setting::register('LS.navbar', 'navbar-default', ['options' => ['navbar-default' => 'Default', 'navbar-inverse' => 'Inverse'], 'type' => 'select']); Configure::write('CA.LightStrap.navbar', Setting::read('LS.navbar')); Setting::register('LS.container', 'container', ['options' => ['container' => 'Fixed', 'container-fluid' => 'Fluid'], 'type' => 'select']); Configure::write('CA.LightStrap.container', Setting::read('LS.container'));
<?php /** * CakeManager (http://cakemanager.org) * Copyright (c) http://cakemanager.org * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * * @copyright Copyright (c) http://cakemanager.org * @link http://cakemanager.org CakeManager Project * @since 1.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ use Cake\Core\Configure; use Cake\Routing\DispatcherFactory; use Settings\Core\Setting; # Configures Configure::write('AB.Show', true); Configure::write('Settings.Prefixes.AB', 'AdminBar'); # Settings Setting::register('AB.Backend', true, ['type' => 'select', 'options' => [0 => 'Disabled', 1 => 'Enabled']]); Setting::register('AB.Frontend', true, ['type' => 'select', 'options' => [0 => 'Disabled', 1 => 'Enabled']]); # AdminBar Configure::write('AdminBar.goto_backend', ['on' => ['prefix' => ['!admin', '*'], 'controller' => '*', 'action' => '*'], 'label' => 'CakeAdmin Panel', 'url' => '/admin']); Configure::write('AdminBar.goto_website', ['on' => ['prefix' => 'admin', 'controller' => '*', 'action' => '*'], 'label' => 'Go To Website', 'url' => Configure::read('App.fullBaseUrl')]); Configure::write('AdminBar.goto_settings', ['on' => ['prefix' => 'admin', 'controller' => '*', 'action' => '*'], 'label' => 'Settings', 'url' => ['prefix' => 'admin', 'plugin' => 'CakeAdmin', 'controller' => 'Settings', 'action' => 'index']]); # Dispatcher Filter DispatcherFactory::add('AdminBar.AdminBar');
<?php /** * CakeManager (http://cakemanager.org) * Copyright (c) http://cakemanager.org * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * * @copyright Copyright (c) http://cakemanager.org * @link http://cakemanager.org CakeManager Project * @since 1.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ use Settings\Core\Setting; use Cake\Core\Configure; Configure::write('Settings.Prefixes.Api', 'API'); Setting::register('Api.JWT', 0, ['type' => 'select', 'options' => [1 => 'On', 0 => 'Off']]); return ['Api.JWT' => Setting::read('Api.JWT')];
* @link http://cakemanager.org CakeManager Project * @since 1.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ use Cake\Core\Configure; use Settings\Core\Setting; use Cake\ORM\TableRegistry; use Cake\Cache\Cache; use Cms\Utility\PathManager; Configure::write('Settings.Prefixes.CMS', 'Cake CMS'); Setting::register('CMS.Pages', true, ['type' => 'checkbox']); Setting::register('CMS.Blogs', true, ['type' => 'checkbox']); Setting::register('CMS.Index', false, ['type' => 'select', 'options' => function () { return [false => 'None'] + TableRegistry::get('Cms.Pages')->find('list')->toArray(); }]); Setting::register('CMS.BlogsUrl', '/:category_slug/:blog_slug'); if (Setting::read('CMS.Pages')) { Configure::write('CA.Models.pages', 'Cms.Pages'); PathManager::instance()->register('pages', 'Cms.Pages'); } if (Setting::read('CMS.Blogs')) { Configure::write('CA.Models.categories', 'Cms.Categories'); Configure::write('CA.Models.blogs', 'Cms.Blogs'); PathManager::instance()->register('blogs', 'Cms.Blogs'); PathManager::instance()->register('categories', 'Cms.Categories'); } # Notification Templates Configure::write('Notifier.templates.blog_post', ['title' => 'A new blog has been posted', 'body' => 'The blog :title has been posted by :creator']); # AdminBar Configure::write('AdminBar.edit_blog', ['on' => ['plugin' => 'Cms', 'controller' => 'Blogs', 'action' => 'view'], 'label' => 'Edit Blog', 'url' => ['prefix' => 'admin', 'plugin' => 'CakeAdmin', 'controller' => 'PostTypes', 'action' => 'edit', ':pass.0', 'type' => 'blogs']]); Configure::write('AdminBar.read_blog', ['on' => ['prefix' => 'admin', 'plugin' => 'CakeAdmin', 'controller' => 'PostTypes', 'action' => ['edit', 'view'], 'type' => 'blogs'], 'label' => 'Read Blog', 'url' => ['prefix' => false, 'plugin' => 'Cms', 'controller' => 'Blogs', 'action' => 'view', ':pass.1']]);
/** * Test options-method */ public function testOptions() { Setting::register('App.Key', 1, ['options' => [0 => 'One', 1 => 'Two']]); $expected = [0 => 'One', 1 => 'Two']; $this->assertEquals($expected, Setting::options('App.Key')); Setting::options('App.Second', [0 => 'One', 1 => 'Two']); }
<?php /** * CakeManager (http://cakemanager.org) * Copyright (c) http://cakemanager.org * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * * @copyright Copyright (c) http://cakemanager.org * @link http://cakemanager.org CakeManager Project * @since 1.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ use Cake\Core\Configure; use Cake\Core\Plugin; use Settings\Core\Setting; Plugin::load('Bootstrap'); Configure::write('Settings.Prefixes.LS', 'LightStrap'); Configure::write('CA.viewClass', 'LightStrap.LightStrap'); Configure::write('CA.theme', 'LightStrap'); Setting::register('LS.subtheme', 'Cosmo', ['options' => [null => __d('LightStrap', 'None'), 'Cerulean' => 'Cerulean', 'Cosmo' => 'Cosmo', 'Cyborg' => 'Cyborg', 'Darkly' => 'Darkly', 'Flatly' => 'Flatly', 'Journal' => 'Journal', 'Lumen' => 'Lumen', 'Paper' => 'Paper', 'Readable' => 'Readable', 'Simplex' => 'Simplex', 'Slate' => 'Slate', 'Spacelab' => 'Spacelab', 'Superhero' => 'Superhero', 'United' => 'United', 'Yeti' => 'Yeti'], 'type' => 'select']); Configure::write('CA.LightStrap.subtheme', Setting::read('LS.subtheme')); Setting::register('LS.navbar', 'navbar-default', ['options' => ['navbar-default' => __d('LightStrap', 'Default'), 'navbar-inverse' => __d('LightStrap', 'Inverse')], 'type' => 'select']); Configure::write('CA.LightStrap.navbar', Setting::read('LS.navbar')); Setting::register('LS.container', 'container', ['options' => ['container' => __d('LightStrap', 'Fixed'), 'container-fluid' => __d('LightStrap', 'Fluid')], 'type' => 'select']); Configure::write('CA.LightStrap.container', Setting::read('LS.container'));