Initial commit
This commit is contained in:
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
namespace Ifabrik\IfAccessButtons\Controller;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016 Marco Kuprat <mk@internetfabrik.de>, Internetfabrik GmbH
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3\CMS\Extbase\Utility\DebuggerUtility;
|
||||
|
||||
/**
|
||||
* AccessibilityButtonsController
|
||||
*/
|
||||
class AccessibilityButtonsController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
|
||||
|
||||
/**
|
||||
* accessibilityButtonsRepository
|
||||
*
|
||||
* @var \Ifabrik\IfAccessButtons\Domain\Repository\AccessibilityButtonsRepository
|
||||
* @inject
|
||||
*/
|
||||
protected $accessibilityButtonsRepository = NULL;
|
||||
|
||||
/**
|
||||
* action show
|
||||
*
|
||||
* @param \Ifabrik\IfAccessButtons\Domain\Model\AccessibilityButtons $accessibilityButtons
|
||||
* @return void
|
||||
*/
|
||||
public function showAction(\Ifabrik\IfAccessButtons\Domain\Model\AccessibilityButtons $accessibilityButtons = NULL) {
|
||||
|
||||
$sessiondata = $GLOBALS ["TSFE"]->fe_user->getKey ( 'ses', 'accessibility' );
|
||||
|
||||
if (is_array($sessiondata)) {
|
||||
if (!array_key_exists('kontrast', $sessiondata) || $sessiondata['kontrast'] == 0) {
|
||||
$accessibilityButtons['contrast_title'] = 'contrast_on';
|
||||
} else {
|
||||
$accessibilityButtons['contrast_title'] = 'contrast_off';
|
||||
}
|
||||
|
||||
if (!array_key_exists('schriftgroesse', $sessiondata) || $sessiondata['schriftgroesse'] == 0) {
|
||||
$accessibilityButtons['fontsize_title'] = 'fonts_larger';
|
||||
} else {
|
||||
$accessibilityButtons['fontsize_title'] = 'fonts_normal';
|
||||
}
|
||||
} else {
|
||||
$accessibilityButtons['contrast_title'] = 'contrast_on';
|
||||
$accessibilityButtons['fontsize_title'] = 'fonts_normal';
|
||||
}
|
||||
|
||||
$this->view->assign('accessibilityButtons', $accessibilityButtons);
|
||||
}
|
||||
|
||||
/**
|
||||
* action ajax
|
||||
*/
|
||||
public function ajaxAction() {
|
||||
$data = array();
|
||||
|
||||
$sessiondata = $GLOBALS ["TSFE"]->fe_user->getKey ( 'ses', 'accessibility' );
|
||||
|
||||
if (! is_array($sessiondata)) {
|
||||
$sessiondata = array();
|
||||
}
|
||||
|
||||
$args = $this->request->getArguments();
|
||||
|
||||
if (array_key_exists('btn', $args)) {
|
||||
if ($args['btn'] == 'kontrast') {
|
||||
if (!array_key_exists('kontrast', $sessiondata) || $sessiondata['kontrast'] == 0) {
|
||||
$sesKontrast = 1;
|
||||
} else {
|
||||
$sesKontrast = 0;
|
||||
}
|
||||
|
||||
$sessiondata['kontrast'] = $sesKontrast;
|
||||
|
||||
$GLOBALS['TSFE']->fe_user->setKey('ses', 'accessibility', $sessiondata);
|
||||
$GLOBALS['TSFE']->fe_user->storeSessionData();
|
||||
}
|
||||
|
||||
|
||||
if ($args['btn'] == 'schriftgroesse') {
|
||||
if (!array_key_exists('schriftgroesse', $sessiondata) || $sessiondata['schriftgroesse'] == 0) {
|
||||
$sesSchriftgroesse = 1;
|
||||
} else {
|
||||
$sesSchriftgroesse = 0;
|
||||
}
|
||||
|
||||
$sessiondata['schriftgroesse'] = $sesSchriftgroesse;
|
||||
|
||||
$GLOBALS['TSFE']->fe_user->setKey('ses', 'accessibility', $sessiondata);
|
||||
$GLOBALS['TSFE']->fe_user->storeSessionData();
|
||||
}
|
||||
}
|
||||
|
||||
return json_encode($data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
namespace Ifabrik\IfAccessButtons\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016 Marco Kuprat <mk@internetfabrik.de>, Internetfabrik GmbH
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* AccessibilityButtons
|
||||
*/
|
||||
class AccessibilityButtons extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
namespace Ifabrik\IfAccessButtons\Domain\Repository;
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016 Marco Kuprat <mk@internetfabrik.de>, Internetfabrik GmbH
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* The repository for AccessibilityButtons
|
||||
*/
|
||||
class AccessibilityButtonsRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user