Skip to content

Commit

Permalink
scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
brianteeman committed Oct 13, 2020
1 parent 58145d3 commit b5e4e63
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 0 deletions.
7 changes: 7 additions & 0 deletions administrator/language/en-GB/plg_system_achecker.ni
@@ -0,0 +1,7 @@
; Joomla! Project
; Copyright (C) 2005 - 2020 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8

PLG_SYSTEM_ACHECKER="System - Accessibility Checker"
PLG_SYSTEM_ACHECKER_XML_DESCRIPTION="This plugin adds the ability to perform an accessibility check on your site."
7 changes: 7 additions & 0 deletions administrator/language/en-GB/plg_system_achecker.sys.ini
@@ -0,0 +1,7 @@
; Joomla! Project
; Copyright (C) 2005 - 2020 Open Source Matters. All rights reserved.
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
; Note : All ini files need to be saved as UTF-8

PLG_SYSTEM_ACCESSIBILITY="System - Additional Accessibility Features"
PLG_SYSTEM_ACCESSIBILITY_XML_DESCRIPTION="This plugin adds an accessibility toolbar to your site with additional accessibility options."
71 changes: 71 additions & 0 deletions plugins/system/achecker/achecker.php
@@ -0,0 +1,71 @@
<?php
/**
* @package Joomla.Plugin
* @subpackage System.achecker
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Plugin\CMSPlugin;

/**
* This plugin adds the ability to perform an accessibility check on your site.
*
* @since __deploy_version__
*/
class PlgSystemAchecker extends CMSPlugin
{
/**
* Application object.
*
* @var JApplicationCms
* @since __deploy_version__
*/
protected $app;

/**
* Add the javascript and css for the accessibility checker
*
* @return void
*
* @since __deploy_version__
*/
public function onBeforeCompileHead()
{

if ($this->app->isClient('site'))
{
return;
}

// Get the document object.
$document = $this->app->getDocument();

if ($document->getType() !== 'html')
{
return;
}

// Load language file.
$this->loadLanguage();

// Determine if it is an LTR or RTL language
$direction = Factory::getLanguage()->isRTL() ? 'right' : 'left';

$document->getWebAssetManager()
->useScript('accessibility')
->addInlineScript(
'window.addEventListener("load", function() {'
. 'new Accessibility(Joomla.getOptions("accessibility-options") || {});'
. '});',
['name' => 'inline.plg.system.accessibility'],
['type' => 'module'],
['accessibility']
);
}
}
36 changes: 36 additions & 0 deletions plugins/system/achecker/achecker.xml
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" group="system" method="upgrade">
<name>plg_system_achecker</name>
<author>Joomla! Project</author>
<creationDate>2020-19-13</creationDate>
<copyright>(C) 2005 - 2020 Open Source Matters. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>4.0.0</version>
<description>PLG_SYSTEM_ACHECKER_XML_DESCRIPTION</description>
<files>
<filename plugin="achecker">achecker.php</filename>
</files>
<languages folder="admin">
<language tag="en-GB">language/en-GB/plg_system_achecker.ini</language>
<language tag="en-GB">language/en-GB/plg_system_achecker.sys.ini</language>
</languages>
<config>
<!-- <fields name="params">
<fieldset name="basic">
<field
name="section"
type="list"
label="PLG_SYSTEM_ACCESSIBILITY_SECTION"
default="administrator"
validate="options"
>
<option value="site">PLG_SYSTEM_ACCESSIBILITY_SECTION_SITE</option>
<option value="administrator">PLG_SYSTEM_ACCESSIBILITY_SECTION_ADMIN</option>
<option value="both">PLG_SYSTEM_ACCESSIBILITY_SECTION_BOTH</option>
</field>
</fieldset>
</fields>
--> </config>
</extension>

0 comments on commit b5e4e63

Please sign in to comment.