Initial commit

This commit is contained in:
Björn Fromme
2018-04-18 17:24:00 +02:00
commit da4db35be3
875 changed files with 80368 additions and 0 deletions
@@ -0,0 +1,71 @@
<?php
namespace EP\EpEvents\ViewHelpers;
/***************************************************************
*
* Copyright notice
*
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
* Cedric Ziel <[email protected]>, dreipunktnull
*
* 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\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
class ConfiguratorTypeLabelsViewHelper extends AbstractViewHelper
{
/**
* @var array
*/
protected $settings;
/**
* @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
*/
public function injectConfigurationManager(ConfigurationManagerInterface $configurationManager)
{
$this->settings = $configurationManager->getConfiguration(
ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS,
'epevents'
);
}
/**
* @param string $type
* @param string $values
*
* @return string
*/
public function render($type, $values)
{
if (empty($values)) {
return 'Keine Angabe';
}
$types = [];
$indexes = GeneralUtility::trimExplode(',', $values);
foreach ($indexes as $index)
{
$types[] = $this->settings['configurator']['options'][$type][$index];
}
return implode(', ', $types);
}
}
@@ -0,0 +1,57 @@
<?php
namespace EP\EpEvents\ViewHelpers;
/***************************************************************
*
* Copyright notice
*
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
* Cedric Ziel <[email protected]>, dreipunktnull
*
* 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\Fluid\Core\ViewHelper\AbstractViewHelper;
class SectionCssClassViewHelper extends AbstractViewHelper
{
/**
* @var array
*/
protected $cssClasses = [
1 => 'incentives',
2 => 'teambuilding',
3 => 'meetings',
4 => 'events',
];
/**
* @param string $sectionValue
*
* @return string
*/
public function render($sectionValue)
{
if (array_key_exists($sectionValue, $this->cssClasses)) {
return 'section-' . $this->cssClasses[$sectionValue];
}
return 'section-default';
}
}
@@ -0,0 +1,63 @@
<?php
namespace EP\EpEvents\ViewHelpers;
/***************************************************************
*
* Copyright notice
*
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
* Cedric Ziel <[email protected]>, dreipunktnull
*
* 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\Fluid\Core\ViewHelper\AbstractViewHelper;
class SectionIconViewHelper extends AbstractViewHelper
{
/**
* @var array
*/
protected $icons = [
1 => 'icon_incentives',
2 => 'icon_teambuilding',
3 => 'icon_meetings',
4 => 'icon_events',
];
/**
* @param string $sectionValue
* @param bool $opaque
*
* @return string
*/
public function render($sectionValue, $opaque = false)
{
$icon = '';
if (array_key_exists($sectionValue, $this->icons)) {
$icon = $this->icons[$sectionValue];
if ($opaque) {
$icon .= '_opaque';
}
$icon .= '.svg';
}
return $icon;
}
}
@@ -0,0 +1,47 @@
<?php
namespace EP\EpEvents\ViewHelpers;
/***************************************************************
*
* Copyright notice
*
* (c) 2017 Björn Fromme <[email protected]>, dreipunktnull
* Cedric Ziel <[email protected]>, dreipunktnull
*
* 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\Fluid\Core\ViewHelper\AbstractViewHelper;
class SoftHyphenViewHelper extends AbstractViewHelper
{
/**
* @param string $string
*
* @return string
*/
public function render($string = null)
{
if ($string === null) {
$string = $this->renderChildren();
}
return str_replace('--', '&shy;', $string);
}
}