Skip to content

Commit fe7defa

Browse files
authored
Add files via upload
1 parent 418fbc2 commit fe7defa

27 files changed

+1945
-1
lines changed

Classes/ViewHelpers/AssetsViewHelper.php

Lines changed: 435 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of the TYPO3 extension t3s_swiper.
7+
*
8+
* For the full copyright and license information, please read the
9+
* LICENSE file that was distributed with this source code.
10+
*/
11+
12+
namespace T3S\T3sSwiper\ViewHelpers;
13+
14+
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
15+
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
16+
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
17+
18+
class DimensionsViewHelper extends AbstractViewHelper
19+
{
20+
use CompileWithRenderStatic;
21+
22+
public function initializeArguments(): void
23+
{
24+
$this->registerArgument('settings', 'array', 'Swiper settings.', true);
25+
}
26+
27+
/**
28+
* Render the URI to the resource. The filename is used from child content.
29+
*/
30+
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext): array
31+
{
32+
$settings = $arguments['settings'];
33+
$dimensions['sliderwidth'] = !empty($settings['width']) ? (int)$settings['width'] : 1300;
34+
35+
if ($settings['effectType'] === 'slide' && $settings['slidesPerView'] > 1) {
36+
$dimensions['width'] = (int)($dimensions['sliderwidth'] / $settings['slidesPerView']);
37+
} else {
38+
$dimensions['width'] = $dimensions['sliderwidth'];
39+
}
40+
41+
if ($settings['thumbnailsSlidesPerView'] > 1) {
42+
$dimensions['thumbnailwidth'] = (int)($dimensions['sliderwidth'] / $settings['thumbnailsSlidesPerView']);
43+
} else {
44+
$dimensions['thumbnailwidth'] = $dimensions['sliderwidth'];
45+
}
46+
47+
$ratio = !empty($settings['ratio']) ? $settings['ratio'] : '16:9';
48+
49+
if (str_contains($ratio, ':')) {
50+
$ratioArr = explode(':', $ratio);
51+
$ratio_multiplier = $ratioArr[1] / $ratioArr[0];
52+
} else {
53+
$ratio_multiplier = 9/16;
54+
}
55+
56+
$dimensions['sliderheight'] = (int)($dimensions['width'] * $ratio_multiplier);
57+
$dimensions['height'] = (int)($dimensions['width'] * $ratio_multiplier);
58+
$dimensions['thumbnailheight'] = (int)($dimensions['thumbnailwidth'] * $ratio_multiplier);
59+
60+
return $dimensions;
61+
}
62+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of the TYPO3 extension t3s_swiper.
7+
*
8+
* For the full copyright and license information, please read the
9+
* LICENSE file that was distributed with this source code.
10+
*/
11+
12+
namespace T3S\T3sSwiper\ViewHelpers;
13+
14+
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
15+
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
16+
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
17+
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
18+
19+
class IsLoadedViewHelper extends AbstractViewHelper
20+
{
21+
use CompileWithRenderStatic;
22+
23+
public function initializeArguments(): void
24+
{
25+
$this->registerArgument('extensionkey', 'string', 'Extension key', true);
26+
}
27+
28+
/**
29+
* Render the URI to the resource. The filename is used from child content.
30+
*/
31+
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext): bool
32+
{
33+
if (ExtensionManagementUtility::isLoaded($arguments['extensionkey'])) {
34+
return true;
35+
} else {
36+
return false;
37+
}
38+
}
39+
}

Configuration/page.tsconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
TCEFORM.sys_file_reference {
2+
description.disabled = 1
3+
link.disabled = 1
4+
title.disabled = 1
5+
tx_t3sbootstrap_description_align.disabled = 1
6+
tx_t3sbootstrap_extra_class.disabled = 1
7+
tx_t3sbootstrap_extra_imgclass.disabled = 1
8+
tx_t3sbootstrap_copyright_color.disabled = 1
9+
tx_t3sbootstrap_copyright_source.disabled = 1
10+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
identifier: T3S/SwiperHeader
2+
fields:
3+
- identifier: t3s_swiperheader_palette
4+
type: Palette
5+
label: Headlines
6+
fields:
7+
- identifier: header
8+
useExistingField: true
9+
- type: Linebreak
10+
- identifier: header_layout
11+
useExistingField: true
12+
- identifier: header_position
13+
useExistingField: true
14+
- type: Linebreak
15+
- identifier: header_link
16+
useExistingField: true
17+
- type: Linebreak
18+
- identifier: subheader
19+
useExistingField: true
20+
- type: Linebreak

0 commit comments

Comments
 (0)