diff --git a/CHANGELOG.md b/CHANGELOG.md index c12dc05a..34ae06c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # v1.2.x ## 09/xx/2016 +1. [](#new) + * Added a new independent `cache_enabled` option for admin plugin (default is `false`). Should fix various sync issues. 1. [](#improved) * Handle errors when a resource fails to install 1. [](#bugfix) diff --git a/admin.php b/admin.php index 6355955d..9b82f1e1 100644 --- a/admin.php +++ b/admin.php @@ -120,6 +120,11 @@ class AdminPlugin extends Plugin // Only activate admin if we're inside the admin path. if ($this->isAdminPath()) { $this->active = true; + + // Set cache based on admin_cache option + if (method_exists($this->grav['cache'], 'setEnabled')) { + $this->grav['cache']->setEnabled($this->config->get('plugins.admin.cache_enabled')); + } } } diff --git a/admin.yaml b/admin.yaml index 2b3ec957..bce2f927 100644 --- a/admin.yaml +++ b/admin.yaml @@ -1,5 +1,6 @@ enabled: true route: '/admin' +cache_enabled: false theme: grav logo_text: '' body_classes: '' diff --git a/blueprints.yaml b/blueprints.yaml index 2c516702..32ce2433 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -13,7 +13,7 @@ docs: https://github.com/getgrav/grav-plugin-admin/blob/develop/README.md license: MIT dependencies: - - { name: grav, version: '>=1.1.4' } + - { name: grav, version: '>=1.1.6' } - { name: form, version: '~2.0' } - { name: email, version: '~2.0' } - { name: login, version: '~2.0' } @@ -37,6 +37,17 @@ form: validate: type: bool + cache_enabled: + type: toggle + label: PLUGIN_ADMIN.ADMIN_CACHING + help: PLUGIN_ADMIN.ADMIN_CACHING_HELP + highlight: 0 + options: + 1: PLUGIN_ADMIN.YES + 0: PLUGIN_ADMIN.NO + validate: + type: bool + route: type: text label: Administrator path diff --git a/languages/en.yaml b/languages/en.yaml index ab2db288..5026afef 100644 --- a/languages/en.yaml +++ b/languages/en.yaml @@ -610,3 +610,5 @@ PLUGIN_ADMIN: DROPZONE_MAX_FILES_EXCEEDED: "You can not upload any more files." DROPZONE_REMOVE_FILE: "Remove file" DROPZONE_RESPONSE_ERROR: "Server responded with {{statusCode}} code." + ADMIN_CACHING: "Enable Admin Caching" + ADMIN_CACHING_HELP: "Caching in the admin can be controlled independently from the front-end site"