first commit
This commit is contained in:
commit
e81864e683
2984 files changed
+267797
No files matched your search
+82
@@ -0,0 +1,82 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the package bk2k/bootstrap-package.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace BK2K\BootstrapPackage\ViewHelpers\Data;
|
||||
|
||||
use TYPO3\CMS\Core\Page\AssetCollector;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* ImageInfoViewHelper
|
||||
*/
|
||||
class ImageInfoViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @var array<string, int|string>
|
||||
*/
|
||||
protected static $supportedProperties = [
|
||||
'width' => 0,
|
||||
'height' => 1,
|
||||
'type' => 3,
|
||||
'origFile' => 'origFile',
|
||||
'origFile_mtime' => 'origFile_mtime',
|
||||
];
|
||||
|
||||
/**
|
||||
* Initialize arguments.
|
||||
*
|
||||
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
|
||||
* @return void
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
$this->registerArgument('src', 'string', 'Path to a file');
|
||||
$this->registerArgument('property', 'string', 'Possible values: width, height, type, origFile, origFile_mtime');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return string
|
||||
*/
|
||||
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
|
||||
{
|
||||
$src = $arguments['src'];
|
||||
$property = $arguments['property'];
|
||||
|
||||
if (!array_key_exists($property, self::$supportedProperties)) {
|
||||
throw new \InvalidArgumentException('The value of property is invalid. Valid properties are: width, height, type, origFile or origFile_mtime');
|
||||
}
|
||||
|
||||
$assetCollector = self::getAssetCollector();
|
||||
$mediaOnPage = $assetCollector->getMedia();
|
||||
|
||||
foreach ($mediaOnPage as $mediaName => $mediaData) {
|
||||
if (strpos($src, $mediaName) !== false) {
|
||||
return (string) $mediaData[self::$supportedProperties[$property]];
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return AssetCollector
|
||||
*/
|
||||
protected static function getAssetCollector(): AssetCollector
|
||||
{
|
||||
return GeneralUtility::makeInstance(AssetCollector::class);
|
||||
}
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the package bk2k/bootstrap-package.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace BK2K\BootstrapPackage\ViewHelpers\Data;
|
||||
|
||||
use BK2K\BootstrapPackage\Utility\ImageVariantsUtility;
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* ImageVariantsViewHelper
|
||||
*/
|
||||
class ImageVariantsViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
$this->registerArgument('as', 'string', 'Name of variable to create.', true);
|
||||
$this->registerArgument('variants', 'array', 'Variants for responsive images.', false);
|
||||
$this->registerArgument('multiplier', 'array', 'Multiplier to calculate responsive image widths.', false);
|
||||
$this->registerArgument('gutters', 'array', 'Gutter that needs to be respected when calculating responsive image widths.', false);
|
||||
$this->registerArgument('corrections', 'array', 'Corrections to be applied after calculation of image widths.', false);
|
||||
$this->registerArgument('aspectRatio', 'float', 'Set aspect ratio for all variants.', false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return string
|
||||
*/
|
||||
public static function renderStatic(
|
||||
array $arguments,
|
||||
\Closure $renderChildrenClosure,
|
||||
RenderingContextInterface $renderingContext
|
||||
) {
|
||||
$variants = ImageVariantsUtility::getImageVariants($arguments['variants'], $arguments['multiplier'], $arguments['gutters'], $arguments['corrections'], $arguments['aspectRatio']);
|
||||
$renderingContext->getVariableProvider()->add($arguments['as'], $variants);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the package bk2k/bootstrap-package.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace BK2K\BootstrapPackage\ViewHelpers\Data;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use TYPO3\CMS\Core\Pagination\ArrayPaginator;
|
||||
use TYPO3\CMS\Core\Pagination\SimplePagination;
|
||||
use TYPO3\CMS\Core\Utility\ArrayUtility;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Pagination\QueryResultPaginator;
|
||||
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
|
||||
use TYPO3\CMS\Fluid\View\StandaloneView;
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* PaginateViewHelper
|
||||
*/
|
||||
class PaginateViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $escapeOutput = false;
|
||||
|
||||
/**
|
||||
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
|
||||
* @return void
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
$this->registerArgument('id', 'string', 'Identifier of the pagination', true);
|
||||
$this->registerArgument('objects', 'mixed', 'Object', true);
|
||||
$this->registerArgument('configuration', 'array', 'configuration', false, ['itemsPerPage' => 10, 'insertAbove' => false, 'insertBelow' => true]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return string
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function renderStatic(
|
||||
array $arguments,
|
||||
\Closure $renderChildrenClosure,
|
||||
RenderingContextInterface $renderingContext
|
||||
) {
|
||||
$objects = $arguments['objects'];
|
||||
if (!($objects instanceof QueryResultInterface || is_array($objects))) {
|
||||
throw new \UnexpectedValueException('Supplied file object type ' . get_class($objects) . ' must be QueryResultInterface or be an array.', 1623322979);
|
||||
}
|
||||
|
||||
$configuration = [
|
||||
'itemsPerPage' => 10,
|
||||
'insertAbove' => false,
|
||||
'insertBelow' => true,
|
||||
'section' => ''
|
||||
];
|
||||
ArrayUtility::mergeRecursiveWithOverrule($configuration, $arguments['configuration'], false);
|
||||
$id = $arguments['id'];
|
||||
$itemsPerPage = (int) $configuration['itemsPerPage'];
|
||||
$currentPage = (int) (self::getRequest()->getQueryParams()['paginate'][$id]['page'] ?? 1);
|
||||
|
||||
if ($objects instanceof QueryResultInterface) {
|
||||
$paginator = new QueryResultPaginator($objects, $currentPage, $itemsPerPage);
|
||||
} else {
|
||||
$paginator = new ArrayPaginator($objects, $currentPage, $itemsPerPage);
|
||||
}
|
||||
$pagination = new SimplePagination($paginator);
|
||||
|
||||
$paginationView = self::getPaginationTemplateObject();
|
||||
$paginationView->assignMultiple(
|
||||
[
|
||||
'id' => $id,
|
||||
'paginator' => $paginator,
|
||||
'pagination' => $pagination,
|
||||
'configuration' => $configuration
|
||||
]
|
||||
);
|
||||
$paginationRendered = $paginationView->render();
|
||||
|
||||
$variableProvider = $renderingContext->getVariableProvider();
|
||||
$variableProvider->add('paginator', $paginator);
|
||||
|
||||
$contents = [];
|
||||
$contents[] = $configuration['insertAbove'] === true ? $paginationRendered : '';
|
||||
$contents[] = $renderChildrenClosure();
|
||||
$contents[] = $configuration['insertBelow'] === true ? $paginationRendered : '';
|
||||
|
||||
$variableProvider->remove('paginator');
|
||||
|
||||
return implode('', $contents);
|
||||
}
|
||||
|
||||
protected static function getPaginationTemplateObject(): StandaloneView
|
||||
{
|
||||
/** @var StandaloneView $view */
|
||||
$view = GeneralUtility::makeInstance(StandaloneView::class);
|
||||
$view->setLayoutRootPaths([GeneralUtility::getFileAbsFileName('EXT:bootstrap_package/Resources/Private/Layouts')]);
|
||||
$view->setPartialRootPaths([GeneralUtility::getFileAbsFileName('EXT:bootstrap_package/Resources/Private/Partials')]);
|
||||
$view->setTemplateRootPaths([GeneralUtility::getFileAbsFileName('EXT:bootstrap_package/Resources/Private/Templates')]);
|
||||
$view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:bootstrap_package/Resources/Private/Templates/ViewHelpers/Paginate/Index.html'));
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
protected static function getRequest(): ServerRequestInterface
|
||||
{
|
||||
return $GLOBALS['TYPO3_REQUEST'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the package bk2k/bootstrap-package.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace BK2K\BootstrapPackage\ViewHelpers;
|
||||
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* ExplodeViewHelper
|
||||
*/
|
||||
class ExplodeViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $escapeOutput = false;
|
||||
|
||||
/**
|
||||
* Initialize arguments.
|
||||
*
|
||||
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
|
||||
* @return void
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
$this->registerArgument('data', 'string', 'The input string', true);
|
||||
$this->registerArgument('as', 'string', 'Name of variable to create', false, 'items');
|
||||
$this->registerArgument('delimiter', 'string', 'The boundary string', false, "\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return string
|
||||
*/
|
||||
public static function renderStatic(
|
||||
array $arguments,
|
||||
\Closure $renderChildrenClosure,
|
||||
RenderingContextInterface $renderingContext
|
||||
) {
|
||||
$content = '';
|
||||
if (isset($arguments['data'])) {
|
||||
$variableProvider = $renderingContext->getVariableProvider();
|
||||
$items = GeneralUtility::trimExplode($arguments['delimiter'], $arguments['data']);
|
||||
$variableProvider->add($arguments['as'], $items);
|
||||
$content = $renderChildrenClosure();
|
||||
$variableProvider->remove($arguments['as']);
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the package bk2k/bootstrap-package.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace BK2K\BootstrapPackage\ViewHelpers;
|
||||
|
||||
use BK2K\BootstrapPackage\Utility\ExternalMediaUtility;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* ExternalMediaViewHelper
|
||||
*/
|
||||
class ExternalMediaViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $escapeOutput = false;
|
||||
|
||||
/**
|
||||
* Initialize arguments.
|
||||
*
|
||||
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
|
||||
* @return void
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
$this->registerArgument('url', 'string', 'External media url');
|
||||
$this->registerArgument('class', 'string', 'CSS class rendered on the generated iframe code');
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the URL is a valid YouTube/Vimeo Link is. If the video id can
|
||||
* be extracted the embed code will be returned, else the content of the
|
||||
* ViewHelper will be displayed.
|
||||
*
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return string
|
||||
*/
|
||||
public static function renderStatic(
|
||||
array $arguments,
|
||||
\Closure $renderChildrenClosure,
|
||||
RenderingContextInterface $renderingContext
|
||||
) {
|
||||
$variableProvider = $renderingContext->getVariableProvider();
|
||||
$externalMediaUtility = GeneralUtility::makeInstance(ExternalMediaUtility::class);
|
||||
$externalMedia = $externalMediaUtility->getEmbedCode($arguments['url'], $arguments['class']);
|
||||
$variableProvider->add('externalMedia', $externalMedia);
|
||||
$content = $renderChildrenClosure();
|
||||
$variableProvider->remove('externalMedia');
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the package bk2k/bootstrap-package.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace BK2K\BootstrapPackage\ViewHelpers;
|
||||
|
||||
use TYPO3\CMS\Core\Resource\FileRepository;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* FalViewHelper
|
||||
*/
|
||||
class FalViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $escapeOutput = false;
|
||||
|
||||
/**
|
||||
* Initialize arguments.
|
||||
*
|
||||
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
|
||||
* @return void
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
$this->registerArgument('data', 'array', 'Data of current record', true);
|
||||
$this->registerArgument('table', 'string', 'table', false, 'tt_content');
|
||||
$this->registerArgument('field', 'string', 'field', false, 'image');
|
||||
$this->registerArgument('as', 'string', 'Name of variable to create', false, 'items');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return string
|
||||
*/
|
||||
public static function renderStatic(
|
||||
array $arguments,
|
||||
\Closure $renderChildrenClosure,
|
||||
RenderingContextInterface $renderingContext
|
||||
) {
|
||||
$variableProvider = $renderingContext->getVariableProvider();
|
||||
if (is_array($arguments['data']) && $arguments['data']['uid'] && $arguments['data'][$arguments['field']]) {
|
||||
$fileRepository = GeneralUtility::makeInstance(FileRepository::class);
|
||||
$items = $fileRepository->findByRelation(
|
||||
$arguments['table'],
|
||||
$arguments['field'],
|
||||
$arguments['data']['uid']
|
||||
);
|
||||
$localizedId = null;
|
||||
if (isset($arguments['data']['_LOCALIZED_UID'])) {
|
||||
$localizedId = $arguments['data']['_LOCALIZED_UID'];
|
||||
} elseif (isset($arguments['data']['_PAGES_OVERLAY_UID'])) {
|
||||
$localizedId = $arguments['data']['_PAGES_OVERLAY_UID'];
|
||||
}
|
||||
$isTableLocalizable = (
|
||||
isset($GLOBALS['TCA'][$arguments['table']]['ctrl']['languageField'])
|
||||
&& $GLOBALS['TCA'][$arguments['table']]['ctrl']['languageField'] !== ''
|
||||
&& isset($GLOBALS['TCA'][$arguments['table']]['ctrl']['transOrigPointerField'])
|
||||
&& $GLOBALS['TCA'][$arguments['table']]['ctrl']['transOrigPointerField'] !== ''
|
||||
);
|
||||
if ($isTableLocalizable && $localizedId !== null) {
|
||||
$items = $fileRepository->findByRelation($arguments['table'], $arguments['field'], $localizedId);
|
||||
}
|
||||
} else {
|
||||
$items = null;
|
||||
}
|
||||
$variableProvider->add($arguments['as'], $items);
|
||||
$content = $renderChildrenClosure();
|
||||
$variableProvider->remove($arguments['as']);
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the package bk2k/bootstrap-package.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace BK2K\BootstrapPackage\ViewHelpers\File;
|
||||
|
||||
use TYPO3\CMS\Core\Resource\File;
|
||||
use TYPO3\CMS\Core\Resource\FileReference;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
class IsAudioViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return mixed
|
||||
*/
|
||||
public static function renderStatic(
|
||||
array $arguments,
|
||||
\Closure $renderChildrenClosure,
|
||||
RenderingContextInterface $renderingContext
|
||||
) {
|
||||
$file = $renderChildrenClosure();
|
||||
$allowedFileExtensions = $GLOBALS['TYPO3_CONF_VARS']['SYS']['audiofile_ext'] ?? '';
|
||||
$allowedFileExtensions = GeneralUtility::trimExplode(',', $allowedFileExtensions);
|
||||
|
||||
if (is_object($file)
|
||||
&& ($file instanceof FileReference || $file instanceof File)
|
||||
&& (
|
||||
in_array($file->getExtension(), $allowedFileExtensions, true)
|
||||
|| $file->getType() === File::FILETYPE_AUDIO
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the package bk2k/bootstrap-package.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace BK2K\BootstrapPackage\ViewHelpers\File;
|
||||
|
||||
use TYPO3\CMS\Core\Resource\File;
|
||||
use TYPO3\CMS\Core\Resource\FileReference;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
class IsImageViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return mixed
|
||||
*/
|
||||
public static function renderStatic(
|
||||
array $arguments,
|
||||
\Closure $renderChildrenClosure,
|
||||
RenderingContextInterface $renderingContext
|
||||
) {
|
||||
$file = $renderChildrenClosure();
|
||||
$allowedFileExtensions = $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] ?? '';
|
||||
$allowedFileExtensions = GeneralUtility::trimExplode(',', $allowedFileExtensions);
|
||||
|
||||
if (is_object($file)
|
||||
&& ($file instanceof FileReference || $file instanceof File)
|
||||
&& (
|
||||
in_array($file->getExtension(), $allowedFileExtensions, true)
|
||||
|| $file->getType() === File::FILETYPE_IMAGE
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the package bk2k/bootstrap-package.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace BK2K\BootstrapPackage\ViewHelpers\File;
|
||||
|
||||
use TYPO3\CMS\Core\Resource\File;
|
||||
use TYPO3\CMS\Core\Resource\FileReference;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
class IsMediaViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return mixed
|
||||
*/
|
||||
public static function renderStatic(
|
||||
array $arguments,
|
||||
\Closure $renderChildrenClosure,
|
||||
RenderingContextInterface $renderingContext
|
||||
) {
|
||||
$file = $renderChildrenClosure();
|
||||
$allowedFileExtensions = $GLOBALS['TYPO3_CONF_VARS']['SYS']['mediafile_ext'] ?? '';
|
||||
$allowedFileExtensions = GeneralUtility::trimExplode(',', $allowedFileExtensions);
|
||||
|
||||
if (is_object($file)
|
||||
&& ($file instanceof FileReference || $file instanceof File)
|
||||
&& (
|
||||
in_array($file->getExtension(), $allowedFileExtensions, true)
|
||||
|| $file->getType() === File::FILETYPE_VIDEO
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the package bk2k/bootstrap-package.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace BK2K\BootstrapPackage\ViewHelpers\Format;
|
||||
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* LowercaseDashedViewHelper
|
||||
*/
|
||||
class LowercaseDashedViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
*
|
||||
* @return string the formatted amount
|
||||
*/
|
||||
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
|
||||
{
|
||||
preg_match_all(
|
||||
'!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!',
|
||||
$renderChildrenClosure(),
|
||||
$matches
|
||||
);
|
||||
$ret = $matches[0];
|
||||
foreach ($ret as &$match) {
|
||||
$match = $match === strtoupper($match) ? strtolower($match) : lcfirst($match);
|
||||
}
|
||||
return implode('-', $ret);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the package bk2k/bootstrap-package.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace BK2K\BootstrapPackage\ViewHelpers\Format;
|
||||
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* TrimViewHelper
|
||||
*/
|
||||
class TrimViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
*
|
||||
* @return string the formatted amount
|
||||
*/
|
||||
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
|
||||
{
|
||||
return trim($renderChildrenClosure());
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the package bk2k/bootstrap-package.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace BK2K\BootstrapPackage\ViewHelpers\Format;
|
||||
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* UpperCamelCaseViewHelper
|
||||
*/
|
||||
class UpperCamelCaseViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
*
|
||||
* @return string the formatted amount
|
||||
*/
|
||||
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
|
||||
{
|
||||
return str_replace(' ', '', ucwords(str_replace('_', ' ', strtolower($renderChildrenClosure()))));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the package bk2k/bootstrap-package.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace BK2K\BootstrapPackage\ViewHelpers;
|
||||
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* IconViewHelper
|
||||
*/
|
||||
class IconViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $escapeOutput = false;
|
||||
|
||||
/**
|
||||
* Initialize arguments.
|
||||
*
|
||||
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
|
||||
* @return void
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
$this->registerArgument('icon', 'object', 'Icon to render', true);
|
||||
$this->registerArgument('height', 'int', 'Height');
|
||||
$this->registerArgument('width', 'int', 'Width');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return string
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function renderStatic(
|
||||
array $arguments,
|
||||
\Closure $renderChildrenClosure,
|
||||
RenderingContextInterface $renderingContext
|
||||
) {
|
||||
$icon = $arguments['icon'];
|
||||
|
||||
if (isset($arguments['width'])) {
|
||||
$icon->setWidth((int) $arguments['width']);
|
||||
}
|
||||
if (isset($arguments['height'])) {
|
||||
$icon->setHeight((int) $arguments['height']);
|
||||
}
|
||||
|
||||
return $icon->render();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the package bk2k/bootstrap-package.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace BK2K\BootstrapPackage\ViewHelpers;
|
||||
|
||||
use BK2K\BootstrapPackage\Utility\SvgUtility;
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* InlineSvgViewHelper
|
||||
*/
|
||||
class InlineSvgViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $escapeOutput = false;
|
||||
|
||||
/**
|
||||
* Initialize arguments.
|
||||
*
|
||||
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
|
||||
* @return void
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
$this->registerArgument('image', 'object', 'a FAL object');
|
||||
$this->registerArgument('src', 'string', 'a path to a file');
|
||||
$this->registerArgument('class', 'string', 'Css class for the svg');
|
||||
$this->registerArgument('width', 'string', 'Width of the svg.', false);
|
||||
$this->registerArgument('height', 'string', 'Height of the svg.', false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return string
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function renderStatic(
|
||||
array $arguments,
|
||||
\Closure $renderChildrenClosure,
|
||||
RenderingContextInterface $renderingContext
|
||||
) {
|
||||
$src = (string)$arguments['src'];
|
||||
$image = $arguments['image'];
|
||||
$width = $arguments['width'] ? (int) $arguments['width'] : null;
|
||||
$height = $arguments['height'] ? (int) $arguments['height'] : null;
|
||||
$class = $arguments['class'] ? (string) $arguments['class'] : null;
|
||||
|
||||
return SvgUtility::getInlineSvg($src, $image, $width, $height, $class);
|
||||
}
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the package bk2k/bootstrap-package.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace BK2K\BootstrapPackage\ViewHelpers\Link;
|
||||
|
||||
use TYPO3\CMS\Core\Imaging\ImageManipulation\CropVariantCollection;
|
||||
use TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Service\ImageService;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Exception;
|
||||
|
||||
class LightboxViewHelper extends AbstractTagBasedViewHelper
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $tagName = 'a';
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
$this->registerUniversalTagAttributes();
|
||||
$this->registerTagAttribute('rel', 'string', 'Specifies the relationship between the current document and the linked document', false);
|
||||
|
||||
$this->registerArgument('caption', 'string', 'Specifies an caption text', false);
|
||||
|
||||
$this->registerArgument('image', 'object', 'image', true);
|
||||
$this->registerArgument('crop', 'string|bool', 'overrule cropping of image (setting to FALSE disables the cropping set in FileReference)');
|
||||
$this->registerArgument('cropVariant', 'string', 'select a cropping variant, in case multiple croppings have been specified or stored in FileReference', false, 'default');
|
||||
$this->registerArgument('width', 'string', 'width of the image. This can be a numeric value representing the fixed width of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.');
|
||||
$this->registerArgument('height', 'string', 'height of the image. This can be a numeric value representing the fixed height of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.');
|
||||
$this->registerArgument('minWidth', 'int', 'minimum width of the image');
|
||||
$this->registerArgument('minHeight', 'int', 'minimum height of the image');
|
||||
$this->registerArgument('maxWidth', 'int', 'maximum width of the image');
|
||||
$this->registerArgument('maxHeight', 'int', 'maximum height of the image');
|
||||
$this->registerArgument('absolute', 'bool', 'Force absolute URL', false, false);
|
||||
}
|
||||
|
||||
public function render(): string
|
||||
{
|
||||
try {
|
||||
$imageService = $this->getImageService();
|
||||
$image = $imageService->getImage('', $this->arguments['image'], false);
|
||||
|
||||
$cropString = $this->arguments['crop'];
|
||||
if ($cropString === null && $image->hasProperty('crop') && $image->getProperty('crop') !== '') {
|
||||
$cropString = $image->getProperty('crop');
|
||||
}
|
||||
|
||||
$cropVariantCollection = CropVariantCollection::create((string)$cropString);
|
||||
$cropVariant = $this->arguments['cropVariant'] ?? 'default';
|
||||
$cropArea = $cropVariantCollection->getCropArea($cropVariant);
|
||||
$processingInstructions = [
|
||||
'width' => $this->arguments['width'],
|
||||
'height' => $this->arguments['height'],
|
||||
'minWidth' => $this->arguments['minWidth'],
|
||||
'minHeight' => $this->arguments['minHeight'],
|
||||
'maxWidth' => $this->arguments['maxWidth'],
|
||||
'maxHeight' => $this->arguments['maxHeight'],
|
||||
'crop' => $cropArea->isEmpty() ? null : $cropArea->makeAbsoluteBasedOnFile($image),
|
||||
];
|
||||
|
||||
$processedImage = $imageService->applyProcessingInstructions($image, $processingInstructions);
|
||||
$imageUri = $imageService->getImageUri($processedImage, isset($this->arguments['absolute']) ? $this->arguments['absolute'] : false);
|
||||
|
||||
$this->tag->addAttribute('href', $imageUri);
|
||||
$this->tag->addAttribute('data-lightbox-width', $processedImage->getProperty('width'));
|
||||
$this->tag->addAttribute('data-lightbox-height', $processedImage->getProperty('height'));
|
||||
$this->tag->addAttribute('data-lightbox-caption', isset($this->arguments['caption']) ? $this->arguments['caption'] : null);
|
||||
$this->tag->setContent($this->renderChildren());
|
||||
$this->tag->forceClosingTag(true);
|
||||
} catch (ResourceDoesNotExistException $e) {
|
||||
// thrown if file does not exist
|
||||
throw new Exception($e->getMessage(), 1622197950, $e);
|
||||
} catch (\UnexpectedValueException $e) {
|
||||
// thrown if a file has been replaced with a folder
|
||||
throw new Exception($e->getMessage(), 1622197951, $e);
|
||||
} catch (\RuntimeException $e) {
|
||||
// RuntimeException thrown if a file is outside of a storage
|
||||
throw new Exception($e->getMessage(), 1622197952, $e);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
// thrown if file storage does not exist
|
||||
throw new Exception($e->getMessage(), 1622197953, $e);
|
||||
}
|
||||
|
||||
return $this->tag->render();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ImageService
|
||||
*/
|
||||
protected function getImageService(): ImageService
|
||||
{
|
||||
return GeneralUtility::makeInstance(ImageService::class);
|
||||
}
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the package bk2k/bootstrap-package.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace BK2K\BootstrapPackage\ViewHelpers\Link;
|
||||
|
||||
use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
|
||||
|
||||
class PaginateViewHelper extends AbstractTagBasedViewHelper
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $tagName = 'a';
|
||||
|
||||
/**
|
||||
* Initialize arguments
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
$this->registerUniversalTagAttributes();
|
||||
|
||||
$this->registerArgument('paginationId', 'string', 'id', true);
|
||||
$this->registerArgument('paginationPage', 'int', 'page', true);
|
||||
}
|
||||
|
||||
public function render(): string
|
||||
{
|
||||
$paginationId = (string) $this->arguments['paginationId'];
|
||||
$paginationPage = (int) $this->arguments['paginationPage'];
|
||||
$section = isset($this->arguments['section']) ? (string)$this->arguments['section'] : '';
|
||||
|
||||
$arguments = [];
|
||||
if ($paginationPage > 1) {
|
||||
$arguments['paginate'][$paginationId]['page'] = $paginationPage;
|
||||
}
|
||||
|
||||
if (method_exists($this->renderingContext, 'getUriBuilder')) {
|
||||
/** @var UriBuilder $uriBuilder */
|
||||
$uriBuilder = $this->renderingContext->getUriBuilder();
|
||||
} elseif (method_exists($this->renderingContext, 'getControllerContext')) {
|
||||
/** @var UriBuilder $uriBuilder */
|
||||
$uriBuilder = $this->renderingContext->getControllerContext()->getUriBuilder();
|
||||
} else {
|
||||
return $this->renderChildren();
|
||||
}
|
||||
|
||||
$uriBuilder->reset()->setArguments($arguments);
|
||||
|
||||
$uri = $uriBuilder->build();
|
||||
if ($uri !== '') {
|
||||
$this->tag->addAttribute('href', $uri);
|
||||
$this->tag->setContent($this->renderChildren());
|
||||
$this->tag->forceClosingTag(true);
|
||||
$result = $this->tag->render();
|
||||
} else {
|
||||
$result = $this->renderChildren();
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of the package bk2k/bootstrap-package.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace BK2K\BootstrapPackage\ViewHelpers\TypoScript;
|
||||
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* ConstantViewHelper
|
||||
*/
|
||||
class ConstantViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $escapeOutput = false;
|
||||
|
||||
/**
|
||||
* Initialize arguments.
|
||||
*
|
||||
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
|
||||
* @return void
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
$this->registerArgument('constant', 'string', 'TypoScript constant');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return string
|
||||
*/
|
||||
public static function renderStatic(
|
||||
array $arguments,
|
||||
\Closure $renderChildrenClosure,
|
||||
RenderingContextInterface $renderingContext
|
||||
) {
|
||||
$constant = trim($arguments['constant']);
|
||||
if ($GLOBALS['TSFE']->tmpl->flatSetup === null
|
||||
|| !is_array($GLOBALS['TSFE']->tmpl->flatSetup)
|
||||
|| count($GLOBALS['TSFE']->tmpl->flatSetup) === 0) {
|
||||
$GLOBALS['TSFE']->tmpl->generateConfig();
|
||||
}
|
||||
if (!array_key_exists($constant, $GLOBALS['TSFE']->tmpl->flatSetup)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $GLOBALS['TSFE']->tmpl->flatSetup[$constant];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user