Skip to content

Commit

Permalink
Merge pull request #1 from absalomedia/analysis-8jL9Wy
Browse files Browse the repository at this point in the history
Applied fixes from StyleCI
  • Loading branch information
absalomedia committed Mar 7, 2016
2 parents 6c8b008 + 0bb7b67 commit 6f6727f
Showing 1 changed file with 24 additions and 27 deletions.
51 changes: 24 additions & 27 deletions grava11y.php
Original file line number Diff line number Diff line change
@@ -1,77 +1,75 @@
<?php

namespace Grav\Plugin;

use Grav\Common\Grav;
use Grav\Common\Plugin;
use Grav\Common\Page;
use Grav\Common\Twig\Twig;
use Grav\Common\Plugin;
use Grav\Common\User\User;

/**
* Grav Plugin Grava11y
* provides accessibility testing on your theme
*
* @author Lawrence Meckan
* @link https://github.com/absalomedia/grav-plugin-grava11y
* @license http://opensource.org/licenses/MIT
*
*/
class Grava11yPlugin extends Plugin
* Grav Plugin Grava11y
* provides accessibility testing on your theme.
*
* @author Lawrence Meckan
*
* @link https://github.com/absalomedia/grav-plugin-grava11y
*
* @license http://opensource.org/licenses/MIT
*/
class grava11y extends Plugin
{
protected $enabled = false;

protected $enabled=false;

/**
* @return array
*/
public static function getSubscribedEvents()
{
// initialize when plugins are ready
return [
'onPluginsInitialized' => ['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([
'onTwigSiteVariables' => ['onTwigSiteVariables', 0],
]);
// 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');
Expand All @@ -81,5 +79,4 @@ public function onTwigSiteVariables()
$assets->add('grava11y', 100);
}
}

}

0 comments on commit 6f6727f

Please sign in to comment.