Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #53

Merged
merged 31 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
77f26aa
feat!: rename imageProcessing middleware and skip processing for non-…
dvdmlln May 21, 2024
3e4c3b7
feat!: use simplified file output
dvdmlln May 29, 2024
f917c42
feat!: disable all content elements by default
dvdmlln Jun 4, 2024
dba0e38
docs: update installation section in readme
dvdmlln Jun 4, 2024
2720256
refactor: remove test typoscript config
dvdmlln Jun 11, 2024
cb8ff51
feat: re-enable media element
KonstantCode Jun 12, 2024
ecb7fe3
feat!: cleanup form output
dvdmlln Jun 12, 2024
af27e1f
feat: add links to form checkbox
dvdmlln Jul 23, 2024
6a2c200
feat: add breadcrumbTitleProvider
dvdmlln Aug 7, 2024
7d86a99
build: add phpstan and phpcs remind standard and adapt code style
dvdmlln Aug 8, 2024
f61b19f
feat: add assetProcessingConfiguration to uploads content element
dvdmlln Aug 15, 2024
ccd2882
feat: add FilesCategoryProcessor
dvdmlln Aug 15, 2024
163e9e9
fix: add check to FilesCategoryProcessor config
dvdmlln Aug 21, 2024
32f5916
feat: allow non-standard file attributes
dvdmlln Aug 27, 2024
b2690b3
fix: resolve type/null pointer exception in FilesCategoryProcessor
dvdmlln Aug 28, 2024
edca853
fix: avoid undefined array key in FilesCategoryProcessor
dvdmlln Aug 28, 2024
d5db97a
feat: allow localUid in asset middleware
dvdmlln Aug 28, 2024
ff443b4
fix: output correct attribute types in flexform
dvdmlln Sep 4, 2024
9233f2d
feat!: move processImage to FilesService and make output configurable
dvdmlln Sep 4, 2024
6a9bf6c
feat: add crop parameter to asset middleware
dvdmlln Sep 5, 2024
64375d8
feat: use TYPO3 SEO APIs
dvdmlln Sep 25, 2024
f56a7bc
feat: add dataProcessing to FlexFormProcessor
dvdmlln Oct 2, 2024
65c0086
fix: allow image processing for SVGs with crop variants
dvdmlln Oct 10, 2024
3eed1a4
fix: make sure all content elements have cookies tab
dvdmlln Oct 16, 2024
2e2c092
feat!: move footer content to page properties
dvdmlln Oct 16, 2024
dc3b7cd
feat: output form checkbox links in description and allow positional …
dvdmlln Nov 5, 2024
357a88c
feat: add size property to FileUpload form element
dvdmlln Nov 13, 2024
e8b1a5d
fix: output FileSizeValidator size in bytes
dvdmlln Nov 13, 2024
d767264
refactor: remove unnecessary levels in yaml config
dvdmlln Nov 13, 2024
8993c31
feat: add customErrorMessage to FileSize validator in FileUpload
dvdmlln Nov 13, 2024
f5db9b3
feat: add MimeType validator to FileUpload form element
dvdmlln Nov 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 0 additions & 46 deletions .build/phpcs.xml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: remindgmbh/[email protected]
phpcs:
static-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -18,4 +18,4 @@ jobs:
extensions: intl
tools: composer:v2
- run: composer install
- run: composer run-script phpcs
- run: composer run-script static-analysis
20 changes: 2 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,2 @@
### IDE ###
nbproject/
.idea/

### Composer ###
composer.phar

### General ###
*.log
cache.properties

### CI ###
.build/bin/
.build/logs/
.build/var/
.build/vendor/
.build/web/
coverage.xml
/vendor
/public
8 changes: 3 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"phpCodeSniffer.exec.linux": "./.build/bin/phpcs",
"phpCodeSniffer.exec.linux": "./vendor/bin/phpcs",
"phpCodeSniffer.standard": "Custom",
"phpCodeSniffer.standardCustom": "./.build/phpcs.xml",
"phpCodeSniffer.exclude": [
"**/.build/vendor/**"
]
"phpCodeSniffer.standardCustom": "./phpcs.xml",
"phpCodeSniffer.exclude": []
}
17 changes: 17 additions & 0 deletions Classes/BreadcrumbTitle/AbstractBreadcrumbTitleProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

namespace Remind\Headless\BreadcrumbTitle;

use TYPO3\CMS\Core\SingletonInterface;

class AbstractBreadcrumbTitleProvider implements BreadcrumbTitleProviderInterface, SingletonInterface
{
protected string $title = '';

public function getTitle(): string
{
return $this->title;
}
}
10 changes: 10 additions & 0 deletions Classes/BreadcrumbTitle/BreadcrumbTitleProviderInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace Remind\Headless\BreadcrumbTitle;

interface BreadcrumbTitleProviderInterface
{
public function getTitle(): string;
}
110 changes: 110 additions & 0 deletions Classes/BreadcrumbTitle/BreadcrumbTitleProviderManager.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?php

declare(strict_types=1);

namespace Remind\Headless\BreadcrumbTitle;

use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use TYPO3\CMS\Core\Service\DependencyOrderingService;
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\TypoScript\TypoScriptService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use UnexpectedValueException;

class BreadcrumbTitleProviderManager implements SingletonInterface, LoggerAwareInterface
{
use LoggerAwareTrait;

/**
* @var string[]
*/
private array $breadcrumbTitleCache = [];

public function getTitle(): string
{
$breadcrumbTitle = '';

$titleProviders = $this->getBreadcrumbTitleProviderConfiguration();
$titleProviders = $this->setProviderOrder($titleProviders);

$orderedTitleProviders = GeneralUtility::makeInstance(DependencyOrderingService::class)
->orderByDependencies($titleProviders);

$this->logger?->debug('Breadcrumb title providers ordered', [
'orderedTitleProviders' => $orderedTitleProviders,
]);

foreach ($orderedTitleProviders as $provider => $configuration) {
if (
class_exists($configuration['provider']) &&
is_subclass_of($configuration['provider'], BreadcrumbTitleProviderInterface::class)
) {
/** @var BreadcrumbTitleProviderInterface $titleProviderObject */
$titleProviderObject = GeneralUtility::makeInstance($configuration['provider']);
if (
($breadcrumbTitle = $titleProviderObject->getTitle())
|| ($breadcrumbTitle = $this->breadcrumbTitleCache[$configuration['provider']] ?? '') !== ''
) {
$this->logger?->debug('Breadcrumb title provider {provider} used on page {title}', [
'provider' => $configuration['provider'],
'title' => $breadcrumbTitle,
]);
$this->breadcrumbTitleCache[$configuration['provider']] = $breadcrumbTitle;
break;
}
$this->logger?->debug('Breadcrumb title provider {provider} skipped on page {title}', [
'provider' => $configuration['provider'],
'providerUsed' => $configuration['provider'],
'title' => $breadcrumbTitle,
]);
}
}

return $breadcrumbTitle;
}

/**
* @param mixed[] $orderInformation
* @return mixed[]
*/
protected function setProviderOrder(array $orderInformation): array
{
foreach ($orderInformation as $provider => &$configuration) {
if (isset($configuration['before'])) {
if (is_string($configuration['before'])) {
$configuration['before'] = GeneralUtility::trimExplode(',', $configuration['before'], true);
} elseif (!is_array($configuration['before'])) {
throw new UnexpectedValueException(
'The specified "before" order configuration for provider "' . $provider . '" is invalid.',
1535803185
);
}
}
if (isset($configuration['after'])) {
if (is_string($configuration['after'])) {
$configuration['after'] = GeneralUtility::trimExplode(',', $configuration['after'], true);
} elseif (!is_array($configuration['after'])) {
throw new UnexpectedValueException(
'The specified "after" order configuration for provider "' . $provider . '" is invalid.',
1535803186
);
}
}
}
return $orderInformation;
}

/**
* @return mixed[]
*/
private function getBreadcrumbTitleProviderConfiguration(): array
{
$typoscriptService = GeneralUtility::makeInstance(TypoScriptService::class);
$config = $typoscriptService->convertTypoScriptArrayToPlainArray(
$GLOBALS['TSFE']->config['config'] ?? []
);

return $config['breadcrumbTitleProviders'] ?? [];
}
}
Loading