Initial standalone bundle release (sanitized history)

This commit is contained in:
Jürgen Mummert
2026-04-01 11:05:34 +02:00
commit 42a94a2dd9
21 changed files with 1924 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
<?php
$GLOBALS['TL_DCA']['exported_events'] = [
'config' => [
'sql' => [
'keys' => [
'externalid' => 'primary'
]
]
],
'fields' => [
'externalid' => [
'sql' => "VARCHAR(255) NOT NULL"
],
'last_export_date' => [
'sql' => "DATETIME NOT NULL"
],
'status' => [
'sql' => "VARCHAR(10) NOT NULL DEFAULT 'ok'"
]
]
];
+206
View File
@@ -0,0 +1,206 @@
<?php
$dca = &$GLOBALS['TL_DCA']['tl_calendar_events'];
use Contao\CoreBundle\DataContainer\PaletteManipulator;
use Mummert\KsNossenerlandBundle\DataContainer\CalendarEvents;
use Mummert\KsNossenerlandBundle\Model\ExternalLocationModel;
$dca['fields']['featured']['filter'] = false;
$dca['fields']['recurring']['filter'] = false;
$dca['fields']['published']['filter'] = false;
$dca['fields']['startTime']['filter'] = false;
$fields = [
'featured', 'addTime', 'addImage', 'overwriteMeta', 'fullsize', 'recurring', 'addEnclosure', 'target',
'published', 'socialImage', 'pid', 'tstamp', 'startTime', 'endTime', 'startDate',
'endDate', 'pageTitle', 'robots', 'description', 'canonicalLink', 'location', 'address', 'singleSRC',
'alt', 'imageTitle', 'size', 'imageUrl', 'caption', 'floating', 'repeatEach', 'repeatEnd', 'recurrences', 'enclosure',
'source', 'linkText', 'jumpTo', 'articleId', 'url', 'cssClass', 'start', 'stop', 'languageMain', 'catalog_ort',
'catalog_kontakt', 'godi_options', 'catalog_pfarrbereiche', 'styleManager', 'export',
'external_location', 'evlkscalendar'
];
foreach ($fields as $field) {
$dca['fields'][$field]['search'] = false;
}
$dca['list']['sorting']['child_record_callback'] = [
'Mummert\KsNossenerlandBundle\DataContainer\CalendarEvents',
'listEvents'
];
// Subpalettes
$dca['palettes']['__selector__'][] = 'export';
$dca['subpalettes']['export'] = 'external_location';
/**
* Felder
*/
$dca['fields']['catalog_ort'] = [
'label' => &$GLOBALS['TL_LANG']['tl_calendar_events']['catalog_ort'],
'exclude' => false,
'filter' => true,
'inputType' => 'select',
'options_callback' => [CalendarEvents::class, 'getCtlgOrteOptions'],
'eval' => [
'mandatory' => true,
'includeBlankOption' => true,
'blankOptionLabel' => '-', // Explizites leeres Label für HTML5-Validierung
'tl_class' => 'w50',
],
'sql' => "int(10) unsigned NOT NULL default '0'", // Falls nötig, hier default '0' entfernen
];
$dca['fields']['catalog_kontakt'] = [
'label' => &$GLOBALS['TL_LANG']['tl_calendar_events']['catalog_kontakt'],
'exclude' => false,
'filter' => true,
'inputType' => 'select',
'options_callback' => [CalendarEvents::class, 'getCtlgKontaktOptions'],
'eval' => [
'mandatory' => false,
'includeBlankOption' => true,
'multiple' => true,
'chosen' => true,
'csv' => ',',
'tl_class' => 'w50',
],
'sql' => "text NULL",
];
$dca['fields']['catalog_pfarrbereiche'] = [
'label' => &$GLOBALS['TL_LANG']['tl_calendar_events']['catalog_pfarrbereiche'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => [CalendarEvents::class, 'getCtlgPfarrbereicheOptions'],
'eval' => [
'mandatory' => false,
'includeBlankOption' => true,
'multiple' => true,
'chosen' => true,
'csv' => ',',
'tl_class' => 'w50',
],
'sql' => "text NULL", // Speichert die Werte als kommaseparierte Liste
];
$dca['fields']['godi_options'] = [
'label' => &$GLOBALS['TL_LANG']['tl_calendar_events']['godi_options'],
'exclude' => false,
'inputType' => 'checkboxWizard',
'options' => [
1 => 'Abendmahl',
2 => 'Kindergottesdienst',
3 => 'Kirchenkaffee',
4 => 'Taufe',
],
'eval' => [
'mandatory' => false,
'multiple' => true,
'csv' => ',',
'tl_class' => 'clr',
],
'sql' => "text NULL",
];
$dca['fields']['subtitle'] = [
'label' => &$GLOBALS['TL_LANG']['tl_calendar_events']['subtitle'],
'exclude' => false,
'search' => false,
'sorting' => false,
'filter' => false,
'inputType' => 'text',
'eval' => ['maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) DEFAULT NULL",
];
$dca['fields']['contributors'] = [
'label' => &$GLOBALS['TL_LANG']['tl_calendar_events']['contributors'],
'exclude' => false,
'search' => false,
'sorting' => false,
'filter' => false,
'inputType' => 'text',
'eval' => ['maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) DEFAULT NULL",
];
$dca['fields']['evlkscalendar'] = [
'label' => &$GLOBALS['TL_LANG']['tl_calendar_events']['evlkscalendar'],
'inputType' => 'checkbox',
'eval' => ['tl_class' => 'w50'],
'sql' => "char(1) NOT NULL default ''",
];
$dca['fields']['export'] = [
'label' => &$GLOBALS['TL_LANG']['tl_calendar_events']['export'],
'inputType' => 'checkbox',
'eval' => ['submitOnChange' => true],
'sql' => "char(1) NOT NULL default ''",
];
$dca['fields']['external_location'] = [
'label' => &$GLOBALS['TL_LANG']['tl_calendar_events']['external_location'],
'inputType' => 'select',
'options_callback' => function () {
try {
$locations = ExternalLocationModel::findAllLocations();
if (empty($locations)) {
return ['debug' => "Keine Einträge in der Tabelle 'tl_location' gefunden."];
}
$options = [];
foreach ($locations as $location) {
$options[$location['id']] = $location['title'];
}
return $options;
} catch (\Exception $e) {
return ['debug' => "Fehler: " . $e->getMessage()];
}
},
'eval' => [
'mandatory' => true,
'includeBlankOption' => true,
'tl_class' => 'w50',
],
'sql' => "int(10) unsigned NOT NULL default '0'",
];
PaletteManipulator::create()
->addLegend('godioptions_legend', 'details_legend', PaletteManipulator::POSITION_AFTER)
->addLegend('nossenerland_legend', 'details_legend', PaletteManipulator::POSITION_AFTER)
->addField('godi_options', 'godioptions_legend', PaletteManipulator::POSITION_APPEND)
->addField('subtitle', 'title_legend', PaletteManipulator::POSITION_APPEND)
->addField('evlkscalendar', 'nossenerland_legend', PaletteManipulator::POSITION_APPEND)
->addField('export', 'nossenerland_legend', PaletteManipulator::POSITION_APPEND)
->addField('contributors', 'address')
->addField('catalog_kontakt', 'address')
->addField('catalog_pfarrbereiche', 'address')
->addField('catalog_ort', 'address')
->applyToPalette('default', 'tl_calendar_events');
PaletteManipulator::create()
->removeField('location')
->removeField('address')
->removeField('location_name')
->removeField('location_str')
->removeField('location_ort')
->applyToPalette('default', 'tl_calendar_events');
$GLOBALS['TL_DCA']['tl_calendar_events']['config']['onsubmit_callback'][] = [
'Mummert\KsNossenerlandBundle\EventListener\CalendarAliasListener',
'onSubmitCallback'
];
@@ -0,0 +1,35 @@
<?php
$lang = &$GLOBALS['TL_LANG']['tl_calendar_events'];
$lang['catalog_ort'][0] = 'Veranstaltungsort';
$lang['catalog_ort'][1] = 'bitte aus der Datenbank wählen';
$lang['catalog_kontakt'][0] = 'verantwortliche Person(en)';
$lang['catalog_kontakt'][1] = 'bitte aus der Datenbank wählen';
$lang['contributors'][0] = 'Mitwirkende';
$lang['contributors'][1] = 'weitere Mitwirkende angeben, sofern nicht in der Datenbank';
$lang['subtitle'][0] = 'Untertitel';
$lang['subtitle'][1] = 'z.B. Thema des Gottesdienstes';
$lang['godi_options'][0] = 'Gottesdienst mit:';
$lang['godi_options'][1] = 'Eigenschaften angeben';
$lang['export'][0] = 'Veranstaltung auf nossener-land.de anzeigen';
$lang['export'][1] = 'auswählen wenn die Veranstaltung auch auf nossener-land.de angezeigt werden soll';
$lang['evlkscalendar'][0] = 'Veranstaltung nicht auf EVLKS Kaelnder zeigen';
$lang['evlkscalendar'][1] = 'wenn ausgewählt, wird die Veranstaltung nicht zum EVLKS Kalender exportiert';
$lang['external_location'][0] = 'Veranstaltungsort aus nossener-land.de Datenbank';
$lang['external_location'][1] = 'Export funktioniert nur mit Veranstaltungsort aus nossener-land.de Datenbank';
$lang['catalog_pfarrbereiche'][0] = 'Pfarrbereiche';
$lang['catalog_pfarrbereiche'][1] = 'nur bei überregionalen Veranstaltungen angeben oder wenn Event für mehr als einen Pfarrbereich relevant, ansonsten erfolgt Zuweisung bereits über Veranstaltungsort';
$lang['godioptions_legend'] = 'Gottesdienst-Eigenschaften';
$lang['nossenerland_legend'] = 'Veranstaltung exportieren';