Initial release

This commit is contained in:
Jürgen Mummert
2026-03-02 21:28:17 +01:00
commit 0ea1a9a8ac
57 changed files with 2497 additions and 0 deletions
+72
View File
@@ -0,0 +1,72 @@
<?php
declare(strict_types=1);
use Contao\Database;
use Contao\StringUtil;
$GLOBALS['TL_DCA']['tl_module']['palettes']['news_submission'] = '{title_legend},name,headline,type;{news_submission_legend},author,newsArchive,uploadFolder,thankYouPage,allowedTags;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID';
$GLOBALS['TL_DCA']['tl_module']['palettes']['event_submission_confirmation'] = '{title_legend},name,headline,type;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID';
$GLOBALS['TL_DCA']['tl_module']['fields']['author'] = [
'label' => &$GLOBALS['TL_LANG']['tl_module']['author'],
'exclude' => true,
'inputType' => 'select',
'foreignKey' => 'tl_user.name',
'eval' => ['mandatory' => true, 'chosen' => true, 'includeBlankOption' => true, 'tl_class' => 'w50'],
'sql' => ['type' => 'integer', 'unsigned' => true, 'default' => 0],
'relation' => ['type' => 'hasOne', 'load' => 'lazy'],
];
$GLOBALS['TL_DCA']['tl_module']['fields']['newsArchive'] = [
'label' => &$GLOBALS['TL_LANG']['tl_module']['newsArchive'],
'exclude' => true,
'inputType' => 'select',
'foreignKey' => 'tl_news_archive.title',
'eval' => ['mandatory' => true, 'chosen' => true, 'includeBlankOption' => true, 'tl_class' => 'w50'],
'sql' => ['type' => 'integer', 'unsigned' => true, 'default' => 0],
'relation' => ['type' => 'hasOne', 'load' => 'lazy'],
];
$GLOBALS['TL_DCA']['tl_module']['fields']['uploadFolder'] = [
'label' => &$GLOBALS['TL_LANG']['tl_module']['uploadFolder'],
'exclude' => true,
'inputType' => 'fileTree',
'eval' => ['fieldType' => 'radio', 'files' => false, 'mandatory' => true, 'tl_class' => 'w50'],
'sql' => ['type' => 'binary', 'length' => 16, 'notnull' => false],
];
$GLOBALS['TL_DCA']['tl_module']['fields']['thankYouPage'] = [
'label' => &$GLOBALS['TL_LANG']['tl_module']['thankYouPage'],
'exclude' => true,
'inputType' => 'pageTree',
'eval' => ['fieldType' => 'radio', 'mandatory' => true, 'tl_class' => 'w50'],
'sql' => ['type' => 'integer', 'unsigned' => true, 'default' => 0],
];
$GLOBALS['TL_DCA']['tl_module']['fields']['allowedTags'] = [
'label' => &$GLOBALS['TL_LANG']['tl_module']['allowedTags'],
'exclude' => true,
'inputType' => 'checkbox',
'options_callback' => static function (): array {
$rows = Database::getInstance()
->prepare("SELECT id, tag FROM tl_tags WHERE invisible='' ORDER BY tag ASC")
->execute()
->fetchAllAssoc();
$options = [];
foreach ($rows as $row) {
$options[(int) $row['id']] = (string) $row['tag'];
}
return $options;
},
'eval' => ['multiple' => true, 'tl_class' => 'clr'],
'sql' => ['type' => 'blob', 'notnull' => false],
'save_callback' => [
static function ($value): array {
return array_values(array_unique(array_map('intval', StringUtil::deserialize($value, true))));
},
],
];