Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions Build/php-cs-fixer/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
'include' => [],
'scope' => 'all',
'strict' => true,
]
]
],
],
);
$config->getFinder()->in('Classes')->in('Configuration')->in('Tests');
return $config;
2 changes: 1 addition & 1 deletion Classes/Controller/BackendModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function indexAction(): ResponseInterface
$this->addFlashMessage(
LocalizationUtility::translate(self::TRANSLATE_KEY_PREFIX . 'flash_message.missing_teas.message') ?? '',
LocalizationUtility::translate(self::TRANSLATE_KEY_PREFIX . 'flash_message.missing_teas.title') ?? '',
ContextualFeedbackSeverity::WARNING
ContextualFeedbackSeverity::WARNING,
);
}

Expand Down
27 changes: 22 additions & 5 deletions Classes/Upgrades/AbstractListTypeToCTypeUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ protected function hasNoLegacyBackendGroupsExplicitAllowDenyConfiguration(): boo
/** @phpstan-ignore cast.int */
return (int)$queryBuilder->executeQuery()->fetchOne() === 0;
}

/** @phpstan-ignore missingType.iterableValue */
protected function getContentElementsToUpdate(string $listType): array
{
Expand All @@ -201,6 +202,7 @@ protected function getContentElementsToUpdate(string $listType): array

return $queryBuilder->executeQuery()->fetchAllAssociative();
}

/** @phpstan-ignore missingType.iterableValue */
protected function getBackendUserGroupsToUpdate(string $listType): array
{
Expand Down Expand Up @@ -266,21 +268,36 @@ protected function updateBackendUserGroups(): void
private function validateRequirements(): void
{
if ($this->getTitle() === '') {
throw new \RuntimeException('The update class "' . static::class . '" must provide a title by extending "getTitle()"', 1727605675);
throw new \RuntimeException(
'The update class "' . static::class . '" must provide a title by extending "getTitle()"',
1727605675,
);
}
if ($this->getDescription() === '') {
throw new \RuntimeException('The update class "' . static::class . '" must provide a description by extending "getDescription()"', 1727605676);
throw new \RuntimeException(
'The update class "' . static::class . '" must provide a description by extending "getDescription()"',
1727605676,
);
}
if ($this->getListTypeToCTypeMapping() === []) {
throw new \RuntimeException('The update class "' . static::class . '" does not provide a "list_type" to "CType" migration mapping', 1727605677);
throw new \RuntimeException(
'The update class "' . static::class . '" does not provide a "list_type" to "CType" migration mapping',
1727605677,
);
}

foreach ($this->getListTypeToCTypeMapping() as $listType => $contentElement) {
if ($listType === '') {
throw new \RuntimeException('Invalid mapping item "' . $listType . '" in class "' . static::class, 1727605678);
throw new \RuntimeException(
'Invalid mapping item "' . $listType . '" in class "' . static::class,
1727605678,
);
}
if ($contentElement === '') {
throw new \RuntimeException('Invalid mapping item "' . $contentElement . '" in class "' . static::class, 1727605679);
throw new \RuntimeException(
'Invalid mapping item "' . $contentElement . '" in class "' . static::class,
1727605679,
);
}
}
}
Expand Down
52 changes: 26 additions & 26 deletions Resources/Private/Language/locallang_index_mod.xlf
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" original="en" datatype="plaintext" date="2026-03-26T15:21:30Z">
<header/>
<body>
<trans-unit id="mlang_tabs_tab">
<source>Teas</source>
</trans-unit>
<trans-unit id="mlang_labels_tablabel">
<source>Maintain teas</source>
</trans-unit>
<trans-unit id="mlang_labels_tabdescr">
<source>This module allows you to work with teas.</source>
</trans-unit>
<trans-unit id="tx_tea_domain_model_tea.uid">
<source>UID</source>
</trans-unit>
<trans-unit id="flash_message.missing_teas.message">
<source>Currently, there are no teas.</source>
</trans-unit>
<trans-unit id="flash_message.missing_teas.title">
<source>No Teas available yet</source>
</trans-unit>
<trans-unit id="listing.caption">
<source>All available teas from the installation.</source>
</trans-unit>
</body>
</file>
<file source-language="en" original="en" datatype="plaintext" date="2026-03-26T15:21:30Z">
<header/>
<body>
<trans-unit id="mlang_tabs_tab">
<source>Teas</source>
</trans-unit>
<trans-unit id="mlang_labels_tablabel">
<source>Maintain teas</source>
</trans-unit>
<trans-unit id="mlang_labels_tabdescr">
<source>This module allows you to work with teas.</source>
</trans-unit>
<trans-unit id="tx_tea_domain_model_tea.uid">
<source>UID</source>
</trans-unit>
<trans-unit id="flash_message.missing_teas.message">
<source>Currently, there are no teas.</source>
</trans-unit>
<trans-unit id="flash_message.missing_teas.title">
<source>No Teas available yet</source>
</trans-unit>
<trans-unit id="listing.caption">
<source>All available teas from the installation.</source>
</trans-unit>
</body>
</file>
</xliff>
6 changes: 3 additions & 3 deletions Resources/Private/Layouts/Default.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<div class="tx-tea">
<f:render section="main"/>
</div>
<div class="tx-tea">
<f:render section="main"/>
</div>
</html>
20 changes: 10 additions & 10 deletions Resources/Private/Layouts/FrontEndEditor.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:security.ifAuthenticated>
<f:then>
<f:render section="main"/>
</f:then>
<f:else>
<div class="alert alert-danger" role="alert">
Please configure this plugin to be only visible if a website user is logged in.
</div>
</f:else>
</f:security.ifAuthenticated>
<f:security.ifAuthenticated>
<f:then>
<f:render section="main"/>
</f:then>
<f:else>
<div class="alert alert-danger" role="alert">
Please configure this plugin to be only visible if a website user is logged in.
</div>
</f:else>
</f:security.ifAuthenticated>
</html>
58 changes: 29 additions & 29 deletions Resources/Private/Partials/FrontEndEditor/Form.html
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:variable name="propertyLabelPrefix" value="plugin.frontEndEditor.property"/>
<f:variable name="idPrefix" value="tea-editor"/>
<f:variable name="propertyLabelPrefix" value="plugin.frontEndEditor.property"/>
<f:variable name="idPrefix" value="tea-editor"/>

<fieldset class="mb-3">
<div class="row mb-3">
<label for="{idPrefix}-title" class="col-sm-2 col-form-label">
<f:translate key="{propertyLabelPrefix}.title"/>
</label>
<div class="col-sm-10">
<f:form.textfield property="title" id="{idPrefix}-title" maxlength="255"
class="form-control" errorClass="is-invalid" required="required"/>
<f:render partial="FrontEndEditor/ValidationResult" arguments="{property: 'title'}"/>
</div>
<fieldset class="mb-3">
<div class="row mb-3">
<label for="{idPrefix}-title" class="col-sm-2 col-form-label">
<f:translate key="{propertyLabelPrefix}.title"/>
</label>
<div class="col-sm-10">
<f:form.textfield property="title" id="{idPrefix}-title" maxlength="255"
class="form-control" errorClass="is-invalid" required="required"/>
<f:render partial="FrontEndEditor/ValidationResult" arguments="{property: 'title'}"/>
</div>
</div>

<div class="row mb-3">
<label for="{idPrefix}-description" class="col-sm-2 col-form-label">
<f:translate key="{propertyLabelPrefix}.description"/>
</label>
<div class="col-sm-10">
<f:form.textarea property="description" id="{idPrefix}-description"
class="form-control" rows="5" errorClass="is-invalid"
additionalAttributes="{maxlength: 2000}"/>
<f:render partial="FrontEndEditor/ValidationResult" arguments="{property: 'description'}"/>
</div>
<div class="row mb-3">
<label for="{idPrefix}-description" class="col-sm-2 col-form-label">
<f:translate key="{propertyLabelPrefix}.description"/>
</label>
<div class="col-sm-10">
<f:form.textarea property="description" id="{idPrefix}-description"
class="form-control" rows="5" errorClass="is-invalid"
additionalAttributes="{maxlength: 2000}"/>
<f:render partial="FrontEndEditor/ValidationResult" arguments="{property: 'description'}"/>
</div>
</fieldset>

<div class="d-flex justify-content-end mt-3 mb-3">
<f:link.action action="index" class="btn btn-outline-secondary me-3" additionalAttributes="{role: 'button'}">
<f:translate key="plugin.frontEndEditor.action.cancel"/>
</f:link.action>
<f:form.submit value="{f:translate(key: 'plugin.frontEndEditor.action.save')}" class="btn btn-primary"/>
</div>
</fieldset>

<div class="d-flex justify-content-end mt-3 mb-3">
<f:link.action action="index" class="btn btn-outline-secondary me-3" additionalAttributes="{role: 'button'}">
<f:translate key="plugin.frontEndEditor.action.cancel"/>
</f:link.action>
<f:form.submit value="{f:translate(key: 'plugin.frontEndEditor.action.save')}" class="btn btn-primary"/>
</div>
</html>
18 changes: 9 additions & 9 deletions Resources/Private/Partials/FrontEndEditor/ValidationResult.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:form.validationResults for="tea.{property}">
<f:if condition="{validationResults.flattenedErrors}">
<f:for each="{validationResults.errors}" as="error">
<div class="invalid-feedback">
{error.message}
</div>
</f:for>
</f:if>
</f:form.validationResults>
<f:form.validationResults for="tea.{property}">
<f:if condition="{validationResults.flattenedErrors}">
<f:for each="{validationResults.errors}" as="error">
<div class="invalid-feedback">
{error.message}
</div>
</f:for>
</f:if>
</f:form.validationResults>
</html>
74 changes: 45 additions & 29 deletions Resources/Private/Templates/BackendModule/Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,53 @@
xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"
data-namespace-typo3-fluid="true"
>
<f:layout name="Module" />
<f:layout name="Module"/>

<f:section name="Content">
<h1><f:translate id="LLL:EXT:tea/Resources/Private/Language/locallang_index_mod.xlf:mlang_tabs_tab" /></h1>
<f:section name="Content">
<h1>
<f:translate id="LLL:EXT:tea/Resources/Private/Language/locallang_index_mod.xlf:mlang_tabs_tab"/>
</h1>

<f:flashMessages />
<f:flashMessages/>

<f:if condition="{teas}">
<f:render section="TeasListing" arguments="{teas: teas}" />
</f:if>
</f:section>
<f:if condition="{teas}">
<f:render section="TeasListing" arguments="{teas: teas}"/>
</f:if>
</f:section>

<f:section name="TeasListing">
<div class="panel panel-default">
<table class="table table-fit table-striped table-hover">
<caption align="top"><f:translate id="LLL:EXT:tea/Resources/Private/Language/locallang_index_mod.xlf:listing.caption" /></caption>
<thead>
<tr>
<th scope="col"><f:translate id="LLL:EXT:tea/Resources/Private/Language/locallang_index_mod.xlf:tx_tea_domain_model_tea.uid" /></th>
<th scope="col"><f:translate id="LLL:EXT:tea/Resources/Private/Language/locallang_db.xlf:tx_tea_domain_model_tea.title" /></th>
</tr>
</thead>
<tbody>
<f:for each="{teas}" as="tea">
<tr>
<td><be:link.editRecord uid="{tea.uid}" table="tx_tea_domain_model_tea">{tea.uid}</be:link.editRecord></td>
<td><be:link.editRecord uid="{tea.uid}" table="tx_tea_domain_model_tea">{tea.title}</be:link.editRecord></td>
</tr>
</f:for>
</tbody>
</table>
</div>
</f:section>
<f:section name="TeasListing">
<div class="panel panel-default">
<table class="table table-fit table-striped table-hover">
<caption align="top">
<f:translate id="LLL:EXT:tea/Resources/Private/Language/locallang_index_mod.xlf:listing.caption"/>
</caption>
<thead>
<tr>
<th scope="col">
<f:translate
id="LLL:EXT:tea/Resources/Private/Language/locallang_index_mod.xlf:tx_tea_domain_model_tea.uid"/>
</th>
<th scope="col">
<f:translate
id="LLL:EXT:tea/Resources/Private/Language/locallang_db.xlf:tx_tea_domain_model_tea.title"/>
</th>
</tr>
</thead>
<tbody>
<f:for each="{teas}" as="tea">
<tr>
<td>
<be:link.editRecord uid="{tea.uid}" table="tx_tea_domain_model_tea">{tea.uid}
</be:link.editRecord>
</td>
<td>
<be:link.editRecord uid="{tea.uid}" table="tx_tea_domain_model_tea">{tea.title}
</be:link.editRecord>
</td>
</tr>
</f:for>
</tbody>
</table>
</div>
</f:section>
</html>
18 changes: 9 additions & 9 deletions Resources/Private/Templates/FrontEndEditor/Edit.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<!DOCTYPE html>
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="FrontEndEditor"/>
<f:layout name="FrontEndEditor"/>

<f:section name="main">
<h2>
<f:translate key="plugin.frontEndEditor.edit.heading"/>
</h2>
<f:section name="main">
<h2>
<f:translate key="plugin.frontEndEditor.edit.heading"/>
</h2>

<f:form action="update" name="tea" object="{tea}">
<f:render partial="FrontEndEditor/Form" arguments="{_all}"/>
</f:form>
</f:section>
<f:form action="update" name="tea" object="{tea}">
<f:render partial="FrontEndEditor/Form" arguments="{_all}"/>
</f:form>
</f:section>
</html>
Loading