mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-04 20:36:03 +01:00
Added new Admin cache_enabled option independent of main site.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
enabled: true
|
||||
route: '/admin'
|
||||
cache_enabled: false
|
||||
theme: grav
|
||||
logo_text: ''
|
||||
body_classes: ''
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user