diff --git a/CHANGELOG.md b/CHANGELOG.md index e0c33ae..73405c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# v1.0.2 +## 09/08/2015 + +2. [](#improved) + * Added blueprints for Grav Admin plugin +3. [](#bugfix) + * Fixed `DebugBarException` ("twig" is not a registered collector) + # v1.0.1 ## 08/21/2015 diff --git a/blueprints.yaml b/blueprints.yaml index ac96f7c..1d1b63f 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,5 +1,5 @@ name: Themer -version: 1.0.1 +version: 1.0.2 description: "This plugin enables you to use different themes on one site individual set per page or collection." icon: magic author: @@ -16,17 +16,17 @@ form: fields: global: type: section - title: "Global plugin configurations" + title: PLUGINS.THEMER.GLOBAL_CONFIG underline: 1 fields: enabled: type: toggle - label: "Plugin Status" + label: PLUGINS.THEMER.PLUGIN_STATUS highlight: 1 - default: 0 + default: 1 options: - 1: Enabled - 0: Disabled + 1: PLUGIN_ADMIN.ENABLED + 0: PLUGIN_ADMIN.DISABLED validate: type: bool diff --git a/languages.yaml b/languages.yaml new file mode 100644 index 0000000..54147ed --- /dev/null +++ b/languages.yaml @@ -0,0 +1,13 @@ +# German +de: + PLUGINS: + THEMER: + GLOBAL_CONFIG: "Globale Einstellungen" + PLUGIN_STATUS: "Plugin Status" + +# English +en: + PLUGINS: + THEMER: + GLOBAL_CONFIG: "Global plugin configurations" + PLUGIN_STATUS: "Plugin status" diff --git a/themer.php b/themer.php index 4a6384c..2851755 100644 --- a/themer.php +++ b/themer.php @@ -1,6 +1,6 @@ * @author Benjamin Regler * @copyright 2015, Benjamin Regler @@ -80,7 +80,8 @@ public function onPageInitialized() $this->grav['themes']->init(); // Silent DebugBar error :: 'twig' is already a registered collector - if ($debug = $this->config->get('system.debugger.twig', false)) { + $enabled = $this->config->get('system.debugger.enabled'); + if ($enabled && ($debug = $this->config->get('system.debugger.twig', false))) { $this->config->set('system.debugger.twig', false); } @@ -91,7 +92,7 @@ public function onPageInitialized() $twig->init(); // Update TwigCollector for DebugBar - if ($debug) { + if ($enabled && $debug) { $twig->twig = new TraceableTwigEnvironment($twig->twig); $collector = $this->grav['debugger']->getCollector('twig'); $collector->twig = $twig->twig;