Explain the notification conditions in the settings form

The explanation texts existed but used the "explanation" input type,
which Contao only knows in the front end form generator, so the backend
rendered nothing and editors saw twelve unlabelled selects. A small
backend explanation widget now shows how a notification is chosen and
the condition matrix, each select carries its condition as label, the
single-day and multi-day variants sit side by side, and a notice with a
link to the Notification Center appears while no notification of the
type "W&K booking" exists.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Jürgen MummertandClaude Fable 5.1 committed 2026-09-26 17:36:18 +02:00
1 parent 8835e15f85
commit fdaff1b1d1
7 files changed
+186 -44

No files matched your search

+5
View File
@@ -4,6 +4,7 @@ declare(strict_types=1);
use Contao\ArrayUtil;
use Mummert\ContaoWkSyncBundle\Backend\WkSyncModule;
use Mummert\ContaoWkSyncBundle\Widget\Backend\ExplanationWidget;
// Backend-Bereich „W&K-Tools“ direkt nach „Inhalte“
ArrayUtil::arrayInsert($GLOBALS['BE_MOD'], 1, [
@@ -31,9 +32,13 @@ ArrayUtil::arrayInsert($GLOBALS['BE_MOD'], 1, [
],
'wk_config' => [
'tables' => ['tl_wk_config'],
'stylesheet' => 'bundles/contaowksync/wk-sync-backend.css',
],
'wk_log' => [
'tables' => ['tl_wk_sync_log'],
],
],
]);
// Erklärungstexte in Backend-Formularen (z. B. Benachrichtigungslogik in den W&K-Einstellungen)
$GLOBALS['BE_FFL']['wk_explanation'] = ExplanationWidget::class;
+19 -18
View File
@@ -6,12 +6,8 @@ use Contao\DataContainer;
use Contao\DC_Table;
use Mummert\ContaoWkSyncBundle\Booking\NotificationRouter;
$notificationFields = ['notificationDefault'];
foreach (NotificationRouter::CONDITIONS as $condition) {
$notificationFields[] = 'notificationExplanation'.$condition;
$notificationFields[] = 'notification'.$condition;
}
// Reihenfolge im Formular: Übersicht, Hinweis, Standard, dann je Thema eintägig (links) und mehrtägig (rechts)
$notificationFields = ['notificationOverview', 'notificationNotice', 'notificationDefault', 'notification1', 'notification2', 'notification5', 'notification3', 'notification7', 'notification4', 'notification6', 'notification8', 'notification9', 'notification10', 'notification11', 'notification12'];
$GLOBALS['TL_DCA']['tl_wk_config'] = [
'config' => [
@@ -180,22 +176,27 @@ $GLOBALS['TL_DCA']['tl_wk_config'] = [
],
];
foreach (NotificationRouter::CONDITIONS as $condition) {
$GLOBALS['TL_DCA']['tl_wk_config']['fields']['notificationExplanation'.$condition] = [
'exclude' => true,
'inputType' => 'explanation',
'eval' => [
'class' => 'tl_info',
'text' => &$GLOBALS['TL_LANG']['tl_wk_config']['notificationExplanation'.$condition],
'tl_class' => 'long clr',
],
];
$GLOBALS['TL_DCA']['tl_wk_config']['fields']['notificationOverview'] = [
'label' => ['', ''],
'inputType' => 'wk_explanation',
'eval' => ['tl_class' => 'long clr'],
];
// Text und Sichtbarkeit setzt der NotificationNoticeListener (nur ohne Benachrichtigungen vom Typ „W&K-Anmeldung“)
$GLOBALS['TL_DCA']['tl_wk_config']['fields']['notificationNotice'] = [
'label' => ['', ''],
'inputType' => 'wk_explanation',
'eval' => ['tl_class' => 'long clr', 'boxClass' => 'tl_error'],
];
// Bedingung 1 (Online) und 12 (Ausbildung) stehen allein, alle anderen paarweise eintägig/mehrtägig
$leftColumn = [1, 2, 3, 4, 8, 10, 12];
foreach (NotificationRouter::CONDITIONS as $condition) {
$GLOBALS['TL_DCA']['tl_wk_config']['fields']['notification'.$condition] = [
'label' => &$GLOBALS['TL_LANG']['tl_wk_config']['notificationCondition'],
'exclude' => true,
'inputType' => 'select',
'eval' => ['includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50 clr'],
'eval' => ['includeBlankOption' => true, 'chosen' => true, 'tl_class' => \in_array($condition, $leftColumn, true) ? 'w50 clr' : 'w50'],
'sql' => ['type' => 'integer', 'unsigned' => true, 'default' => 0],
];
}
+36 -13
View File
@@ -27,23 +27,46 @@ $lang['newsletterChannels'] = ['Newsletter-Verteiler', 'Verteiler, die bei „Ne
$lang['newsletterPage'] = ['Seite zur Newsletter-Aktivierung', 'Seite mit dem Modul „Abonnieren“, die den Aktivierungslink (?token=) verarbeitet.'];
$lang['newsletterText'] = ['Text der Aktivierungsmail', 'Optional. Token: ##link##, ##channels##, ##domain##. Leer = Standardtext.'];
$lang['notificationDefault'] = ['Standard-Benachrichtigung', 'Wird verschickt, wenn keine der Bedingungen zutrifft und an der Veranstaltung nichts eingestellt ist. Nur Benachrichtigungen vom Typ „W&K-Anmeldung“.'];
$lang['notificationCondition'] = ['Benachrichtigung für diese Bedingung', 'Leer = Bedingung wird übersprungen, die nächste zutreffende Bedingung zählt.'];
$lang['notificationExplanation1'] = '<strong>Bedingung 1: Online-Kurse</strong> – alle Kategorien, Veranstaltungsort „Online“.';
$lang['notificationExplanation2'] = '<strong>Bedingung 2: Tagesveranstaltung Schulfortbildung</strong> – Beginn = Ende, Kategorie-Art „Schule“, Nummer beginnt mit EXTP.';
$lang['notificationExplanation3'] = '<strong>Bedingung 3: Tagesveranstaltung Gemeinde / Gottesdienst mit Kindern / Tagungen</strong> – Beginn = Ende, Kategorie-Art „Gemeinde“, „Gottesdienst mit Kindern“ oder „Tagungen“.';
$lang['notificationExplanation4'] = '<strong>Bedingung 4: Tagesveranstaltung Elementarbereich</strong> – Beginn = Ende, Kategorie-Art „Elementarbereich“.';
$lang['notificationExplanation5'] = '<strong>Bedingung 5: Mehrtägige Schulfortbildung</strong> – Beginn ≠ Ende, Kategorie-Art „Schule“, Nummer beginnt mit EXTP.';
$lang['notificationExplanation6'] = '<strong>Bedingung 6: Mehrtägige Fortbildung Elementarbereich</strong> – Beginn ≠ Ende, Kategorie-Art „Elementarbereich“.';
$lang['notificationExplanation7'] = '<strong>Bedingung 7: Mehrtägige Veranstaltung Gemeinde / Gottesdienst mit Kindern / Tagungen</strong> – Beginn ≠ Ende.';
$lang['notificationExplanation8'] = '<strong>Bedingung 8: Tagesveranstaltung Evangelische Schulen</strong> – Beginn = Ende, Kategorie-Art „Evangelische Schulen“.';
$lang['notificationExplanation9'] = '<strong>Bedingung 9: Mehrtägige Veranstaltung Evangelische Schulen</strong> – Beginn ≠ Ende, Kategorie-Art „Evangelische Schulen“.';
$lang['notificationExplanation10'] = '<strong>Bedingung 10: Tagesveranstaltung Mentoring</strong> – Beginn = Ende, Kategorie-Art „Mentoring“.';
$lang['notificationExplanation11'] = '<strong>Bedingung 11: Mehrtägige Veranstaltung Mentoring</strong> – Beginn ≠ Ende, Kategorie-Art „Mentoring“.';
$lang['notificationExplanation12'] = '<strong>Bedingung 12: Mehrtägige Ausbildung</strong> – Beginn ≠ Ende, Kategorie-Art „Ausbildung“.';
$lang['new'] = ['Neue Einstellungen', 'Einstellungen für einen Kalender anlegen'];
$lang['edit'] = ['Einstellungen bearbeiten', 'Einstellungen ID %s bearbeiten'];
$lang['copy'] = ['Einstellungen duplizieren', 'Einstellungen ID %s duplizieren'];
$lang['delete'] = ['Einstellungen löschen', 'Einstellungen ID %s löschen'];
$lang['show'] = ['Details', 'Details der Einstellungen ID %s anzeigen'];
$lang['notificationOverview'] = '<p><strong>So wird die Benachrichtigung für eine Anmeldung bestimmt</strong></p>
<ol>
<li>Ist an der Veranstaltung selbst (Legende „Anmeldung“) eine Benachrichtigung eingetragen, wird diese verschickt.</li>
<li>Sonst zählt die erste zutreffende Bedingung aus der Tabelle, der hier eine Benachrichtigung zugeordnet ist. Ein Online-Kurs fällt zuerst unter Bedingung 1; ist dort nichts zugeordnet, greift die Bedingung seiner Kategorie-Art. Bedingungen ohne Zuordnung werden übersprungen.</li>
<li>Trifft nichts zu, wird die Standard-Benachrichtigung verschickt. Fehlt auch sie, wird die Anmeldung gespeichert, aber keine E-Mail verschickt (Warnung im Systemprotokoll).</li>
</ol>
<p>Maßgeblich sind die <strong>Art der Hauptkategorie</strong> der Veranstaltung (W&K-Tools → Kategorien), die <strong>Dauer</strong> (Beginn = Ende: eintägig) und ob der <strong>Veranstaltungsort „Online“</strong> ist. „EXTP“ meint: die Veranstaltungsnummer (kbvsnr) beginnt mit EXTP.</p>
<table class="wk-sync-matrix">
<thead><tr><th>Art der Hauptkategorie</th><th>eintägig</th><th>mehrtägig</th></tr></thead>
<tbody>
<tr><td>Online-Kurs (alle Arten)</td><td>Bedingung 1</td><td>Bedingung 1</td></tr>
<tr><td>Schule, Nummer beginnt mit EXTP</td><td>Bedingung 2</td><td>Bedingung 5</td></tr>
<tr><td>Gemeinde, Gottesdienst mit Kindern, Tagungen</td><td>Bedingung 3</td><td>Bedingung 7</td></tr>
<tr><td>Elementarbereich</td><td>Bedingung 4</td><td>Bedingung 6</td></tr>
<tr><td>Evangelische Schulen</td><td>Bedingung 8</td><td>Bedingung 9</td></tr>
<tr><td>Mentoring</td><td>Bedingung 10</td><td>Bedingung 11</td></tr>
<tr><td>Ausbildung</td><td>Standard</td><td>Bedingung 12</td></tr>
<tr><td>Schule ohne EXTP-Nummer, Sonstiges (z. B. AusZEIT, Angebote anderer Träger)</td><td>Standard</td><td>Standard</td></tr>
</tbody>
</table>';
$lang['notificationNotice'] = 'Es ist noch keine Benachrichtigung vom Typ „W&K-Anmeldung“ angelegt, deshalb sind die Auswahlfelder leer. Bitte zuerst unter <a href="%s">Notification Center → Benachrichtigungen</a> eine Benachrichtigung mit diesem Typ anlegen; danach lässt sie sich hier zuordnen.';
$lang['notification1'] = ['Bedingung 1: Online-Kurs', 'Veranstaltungsort „Online“, alle Kategorie-Arten, ein- oder mehrtägig. Leer = die Bedingung der Kategorie-Art zählt.'];
$lang['notification2'] = ['Bedingung 2: Schule mit EXTP-Nummer, eintägig', 'Kategorie-Art „Schule“, Nummer beginnt mit EXTP, Beginn = Ende. Leer = Standard.'];
$lang['notification5'] = ['Bedingung 5: Schule mit EXTP-Nummer, mehrtägig', 'Kategorie-Art „Schule“, Nummer beginnt mit EXTP, Beginn ≠ Ende. Leer = Standard.'];
$lang['notification3'] = ['Bedingung 3: Gemeinde u. Tagungen, eintägig', 'Kategorie-Art „Gemeinde“, „Gottesdienst mit Kindern“ oder „Tagungen“, Beginn = Ende. Leer = Standard.'];
$lang['notification7'] = ['Bedingung 7: Gemeinde u. Tagungen, mehrtägig', 'Kategorie-Art „Gemeinde“, „Gottesdienst mit Kindern“ oder „Tagungen“, Beginn ≠ Ende. Leer = Standard.'];
$lang['notification4'] = ['Bedingung 4: Elementarbereich, eintägig', 'Kategorie-Art „Elementarbereich“, Beginn = Ende. Leer = Standard.'];
$lang['notification6'] = ['Bedingung 6: Elementarbereich, mehrtägig', 'Kategorie-Art „Elementarbereich“, Beginn ≠ Ende. Leer = Standard.'];
$lang['notification8'] = ['Bedingung 8: Evangelische Schulen, eintägig', 'Kategorie-Art „Evangelische Schulen“, Beginn = Ende. Leer = Standard.'];
$lang['notification9'] = ['Bedingung 9: Evangelische Schulen, mehrtägig', 'Kategorie-Art „Evangelische Schulen“, Beginn ≠ Ende. Leer = Standard.'];
$lang['notification10'] = ['Bedingung 10: Mentoring, eintägig', 'Kategorie-Art „Mentoring“, Beginn = Ende. Leer = Standard.'];
$lang['notification11'] = ['Bedingung 11: Mentoring, mehrtägig', 'Kategorie-Art „Mentoring“, Beginn ≠ Ende. Leer = Standard.'];
$lang['notification12'] = ['Bedingung 12: Ausbildung, mehrtägig', 'Kategorie-Art „Ausbildung“, Beginn ≠ Ende. Eintägige Ausbildungen erhalten die Standard-Benachrichtigung. Leer = Standard.'];
+36 -13
View File
@@ -27,23 +27,46 @@ $lang['newsletterChannels'] = ['Newsletter-Verteiler', 'Verteiler, die bei „Ne
$lang['newsletterPage'] = ['Seite zur Newsletter-Aktivierung', 'Seite mit dem Modul „Abonnieren“, die den Aktivierungslink (?token=) verarbeitet.'];
$lang['newsletterText'] = ['Text der Aktivierungsmail', 'Optional. Token: ##link##, ##channels##, ##domain##. Leer = Standardtext.'];
$lang['notificationDefault'] = ['Standard-Benachrichtigung', 'Wird verschickt, wenn keine der Bedingungen zutrifft und an der Veranstaltung nichts eingestellt ist. Nur Benachrichtigungen vom Typ „W&K-Anmeldung“.'];
$lang['notificationCondition'] = ['Benachrichtigung für diese Bedingung', 'Leer = Bedingung wird übersprungen, die nächste zutreffende Bedingung zählt.'];
$lang['notificationExplanation1'] = '<strong>Bedingung 1: Online-Kurse</strong> – alle Kategorien, Veranstaltungsort „Online“.';
$lang['notificationExplanation2'] = '<strong>Bedingung 2: Tagesveranstaltung Schulfortbildung</strong> – Beginn = Ende, Kategorie-Art „Schule“, Nummer beginnt mit EXTP.';
$lang['notificationExplanation3'] = '<strong>Bedingung 3: Tagesveranstaltung Gemeinde / Gottesdienst mit Kindern / Tagungen</strong> – Beginn = Ende, Kategorie-Art „Gemeinde“, „Gottesdienst mit Kindern“ oder „Tagungen“.';
$lang['notificationExplanation4'] = '<strong>Bedingung 4: Tagesveranstaltung Elementarbereich</strong> – Beginn = Ende, Kategorie-Art „Elementarbereich“.';
$lang['notificationExplanation5'] = '<strong>Bedingung 5: Mehrtägige Schulfortbildung</strong> – Beginn ≠ Ende, Kategorie-Art „Schule“, Nummer beginnt mit EXTP.';
$lang['notificationExplanation6'] = '<strong>Bedingung 6: Mehrtägige Fortbildung Elementarbereich</strong> – Beginn ≠ Ende, Kategorie-Art „Elementarbereich“.';
$lang['notificationExplanation7'] = '<strong>Bedingung 7: Mehrtägige Veranstaltung Gemeinde / Gottesdienst mit Kindern / Tagungen</strong> – Beginn ≠ Ende.';
$lang['notificationExplanation8'] = '<strong>Bedingung 8: Tagesveranstaltung Evangelische Schulen</strong> – Beginn = Ende, Kategorie-Art „Evangelische Schulen“.';
$lang['notificationExplanation9'] = '<strong>Bedingung 9: Mehrtägige Veranstaltung Evangelische Schulen</strong> – Beginn ≠ Ende, Kategorie-Art „Evangelische Schulen“.';
$lang['notificationExplanation10'] = '<strong>Bedingung 10: Tagesveranstaltung Mentoring</strong> – Beginn = Ende, Kategorie-Art „Mentoring“.';
$lang['notificationExplanation11'] = '<strong>Bedingung 11: Mehrtägige Veranstaltung Mentoring</strong> – Beginn ≠ Ende, Kategorie-Art „Mentoring“.';
$lang['notificationExplanation12'] = '<strong>Bedingung 12: Mehrtägige Ausbildung</strong> – Beginn ≠ Ende, Kategorie-Art „Ausbildung“.';
$lang['new'] = ['Neue Einstellungen', 'Einstellungen für einen Kalender anlegen'];
$lang['edit'] = ['Einstellungen bearbeiten', 'Einstellungen ID %s bearbeiten'];
$lang['copy'] = ['Einstellungen duplizieren', 'Einstellungen ID %s duplizieren'];
$lang['delete'] = ['Einstellungen löschen', 'Einstellungen ID %s löschen'];
$lang['show'] = ['Details', 'Details der Einstellungen ID %s anzeigen'];
$lang['notificationOverview'] = '<p><strong>How the notification for a booking is chosen</strong></p>
<ol>
<li>If the event itself (legend "Booking") has a notification, that one is sent.</li>
<li>Otherwise the first matching condition from the table that has a notification assigned here wins. An online course first falls under condition 1; if nothing is assigned there, the condition of its category kind applies. Conditions without an assignment are skipped.</li>
<li>If nothing matches, the default notification is sent. Without a default the booking is stored but no e-mail is sent (warning in the system log).</li>
</ol>
<p>Decisive are the <strong>kind of the main category</strong> (W&K tools → Categories), the <strong>duration</strong> (start = end: single day) and whether the <strong>location is "Online"</strong>. "EXTP" means the event number (kbvsnr) starts with EXTP.</p>
<table class="wk-sync-matrix">
<thead><tr><th>Kind of main category</th><th>single day</th><th>multi-day</th></tr></thead>
<tbody>
<tr><td>Online course (all kinds)</td><td>Condition 1</td><td>Condition 1</td></tr>
<tr><td>School, number starts with EXTP</td><td>Condition 2</td><td>Condition 5</td></tr>
<tr><td>Community, children\'s service, conferences</td><td>Condition 3</td><td>Condition 7</td></tr>
<tr><td>Elementary</td><td>Condition 4</td><td>Condition 6</td></tr>
<tr><td>Evangelical schools</td><td>Condition 8</td><td>Condition 9</td></tr>
<tr><td>Mentoring</td><td>Condition 10</td><td>Condition 11</td></tr>
<tr><td>Training</td><td>Default</td><td>Condition 12</td></tr>
<tr><td>School without EXTP number, other kinds</td><td>Default</td><td>Default</td></tr>
</tbody>
</table>';
$lang['notificationNotice'] = 'There is no notification of the type "W&K booking" yet, so the selects are empty. Please create one under <a href="%s">Notification Center → Notifications</a> first; it can then be assigned here.';
$lang['notification1'] = ['Condition 1: online course', 'Location "Online", all category kinds, single or multi-day. Empty = the condition of the category kind applies.'];
$lang['notification2'] = ['Condition 2: school with EXTP number, single day', 'Kind "school", number starts with EXTP, start = end. Empty = default.'];
$lang['notification5'] = ['Condition 5: school with EXTP number, multi-day', 'Kind "school", number starts with EXTP, start ≠ end. Empty = default.'];
$lang['notification3'] = ['Condition 3: community and conferences, single day', 'Kinds "community", "children\'s service" or "conferences", start = end. Empty = default.'];
$lang['notification7'] = ['Condition 7: community and conferences, multi-day', 'Kinds "community", "children\'s service" or "conferences", start ≠ end. Empty = default.'];
$lang['notification4'] = ['Condition 4: elementary, single day', 'Kind "elementary", start = end. Empty = default.'];
$lang['notification6'] = ['Condition 6: elementary, multi-day', 'Kind "elementary", start ≠ end. Empty = default.'];
$lang['notification8'] = ['Condition 8: evangelical schools, single day', 'Kind "evangelical schools", start = end. Empty = default.'];
$lang['notification9'] = ['Condition 9: evangelical schools, multi-day', 'Kind "evangelical schools", start ≠ end. Empty = default.'];
$lang['notification10'] = ['Condition 10: mentoring, single day', 'Kind "mentoring", start = end. Empty = default.'];
$lang['notification11'] = ['Condition 11: mentoring, multi-day', 'Kind "mentoring", start ≠ end. Empty = default.'];
$lang['notification12'] = ['Condition 12: training, multi-day', 'Kind "training", start ≠ end. Single-day trainings get the default notification. Empty = default.'];
+10
View File
@@ -51,3 +51,13 @@
.wk-sync-hidden-form { display: none; }
.wk-sync-highlight td { background: #fff8e1; }
.wk-sync-meta { margin: 0 0 .75rem; }
/* Erklärungen in Backend-Formularen (Widget wk_explanation) */
.wk-sync-explanation p, .wk-sync-explanation ol { margin: 0 0 .6em; }
.wk-sync-explanation ol { padding-left: 1.4em; }
.wk-sync-explanation li { margin: .2em 0; }
.wk-sync-matrix { border-collapse: collapse; margin: .5em 0 .25em; }
.wk-sync-matrix th, .wk-sync-matrix td { padding: .25em .75em .25em 0; text-align: left; vertical-align: top; border-bottom: 1px solid color-mix(in srgb, currentColor 20%, transparent); }
.wk-sync-matrix td:nth-child(n+2), .wk-sync-matrix th:nth-child(n+2) { white-space: nowrap; }
.wk-sync-matrix th { font-weight: bold; }
.wk-sync-matrix tr:last-child td { border-bottom: 0; }
@@ -0,0 +1,48 @@
<?php
declare(strict_types=1);
namespace Mummert\ContaoWkSyncBundle\EventListener\DataContainer;
use Contao\CoreBundle\DependencyInjection\Attribute\AsCallback;
use Contao\CoreBundle\Framework\ContaoFramework;
use Contao\PaletteManipulator;
use Mummert\ContaoWkSyncBundle\Booking\BookingNotifierInterface;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
* Zeigt in den W&K-Einstellungen einen Hinweis, solange es keine Benachrichtigung vom Typ „W&K-Anmeldung“
* gibt; sonst wären die Auswahlfelder leer, ohne dass man erfährt, warum.
*/
#[AsCallback(table: 'tl_wk_config', target: 'config.onload')]
class NotificationNoticeListener
{
public function __construct(
private readonly BookingNotifierInterface $notifier,
private readonly RouterInterface $router,
private readonly TranslatorInterface $translator,
private readonly ContaoFramework $framework,
) {
}
public function __invoke(): void
{
if ([] !== $this->notifier->availableNotifications()) {
$this->framework->getAdapter(PaletteManipulator::class)->create()
->removeField('notificationNotice')
->applyToPalette('default', 'tl_wk_config');
return;
}
$url = $this->router->generate('contao_backend', ['do' => 'nc_notifications']);
// Contao-Domänen werden per sprintf ersetzt, daher %s statt benannter Platzhalter
$GLOBALS['TL_DCA']['tl_wk_config']['fields']['notificationNotice']['eval']['text'] = $this->translator->trans(
'tl_wk_config.notificationNotice',
[htmlspecialchars($url, ENT_QUOTES)],
'contao_tl_wk_config',
);
}
}
+32
View File
@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace Mummert\ContaoWkSyncBundle\Widget\Backend;
use Contao\Widget;
/**
* Erklärungstext im Backend-Formular (Contao kennt „explanation“ nur im Frontend-Formulargenerator).
*
* Der Text kommt aus eval.text oder, wenn leer, aus $GLOBALS['TL_LANG'][Tabelle][Feld]; eval.boxClass
* bestimmt die Box (Standard tl_info, alternativ z. B. tl_error). Das Feld wird nicht gespeichert.
*/
class ExplanationWidget extends Widget
{
protected $blnSubmitInput = false;
protected $strTemplate = 'be_widget';
public function generate(): string
{
$text = (string) ($this->arrConfiguration['text'] ?? '');
if ('' === $text) {
$lang = $GLOBALS['TL_LANG'][$this->strTable][$this->strField] ?? '';
$text = (string) (\is_array($lang) ? ($lang[0] ?? '') : $lang);
}
return \sprintf('<div class="%s wk-sync-explanation">%s</div>', (string) ($this->arrConfiguration['boxClass'] ?? 'tl_info'), $text);
}
}