From 0bb7b679e5e518b60a6250c7d48b2df6d537fd92 Mon Sep 17 00:00:00 2001 From: Lawrence Meckan Date: Sun, 6 Mar 2016 22:36:52 -0500 Subject: [PATCH] Applied fixes from StyleCI --- grava11y.php | 51 ++++++++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/grava11y.php b/grava11y.php index 2b047dd..d8320d3 100644 --- a/grava11y.php +++ b/grava11y.php @@ -1,26 +1,26 @@ ['onPluginsInitialized', 0] + 'onPluginsInitialized' => ['onPluginsInitialized', 0], ]; } - /** - * Initialize configuration + * Initialize configuration. */ public function onPluginsInitialized() { // Don't load in Admin-Backend if ($this->isAdmin()) { $this->active = false; + return; } $this->initializeGrava11y(); } /** - * Initialize Grava11y - * Check for user-auth and access before - * loading JS file for a11y - */ + * Initialize Grava11y + * Check for user-auth and access before + * loading JS file for a11y. + */ public function initializeGrava11y() { $this->enable([ @@ -58,20 +58,18 @@ public function initializeGrava11y() ]); // Save plugin status $this->enabled = true; - - } - + /** - * if enabled on this page, load the JS + * if enabled on this page, load the JS. */ public function onTwigSiteVariables() { // check if enabled if ($this->enabled) { - $a11ystack = array( + $a11ystack = [ 'plugin://grava11y/css/grava11y.css', - ); + ]; $siter = $this->config->get('plugins.grava11y.offsite'); $siter = (0) ? array_push($a11ystack, 'https://rawgit.com/Khan/tota11y/master/build/tota11y.min.js') : array_push($a11ystack, 'plugin://grava11y/js/tota11y.min.js'); @@ -81,5 +79,4 @@ public function onTwigSiteVariables() $assets->add('grava11y', 100); } } - }