From f702e8e07ac1966cf3d89a219b3e2c052de128ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Mummert?= Date: Mon, 22 Dec 2025 15:12:20 +0100 Subject: [PATCH] Add related DB fields --- .../contao/dca/tl_calendar_events.php | 32 +++++++++++++ src/Resources/contao/dca/tl_news.php | 32 +++++++++++++ src/Resources/contao/dca/tl_page.php | 46 +++++++++++++++++++ src/Resources/contao/languages/de/default.php | 7 +++ .../languages/de/tl_calendar_events.php | 11 +++++ src/Resources/contao/languages/de/tl_news.php | 11 +++++ src/Resources/contao/languages/de/tl_page.php | 14 ++++++ 7 files changed, 153 insertions(+) create mode 100644 src/Resources/contao/dca/tl_calendar_events.php create mode 100644 src/Resources/contao/dca/tl_news.php create mode 100644 src/Resources/contao/dca/tl_page.php create mode 100644 src/Resources/contao/languages/de/default.php create mode 100644 src/Resources/contao/languages/de/tl_calendar_events.php create mode 100644 src/Resources/contao/languages/de/tl_news.php create mode 100644 src/Resources/contao/languages/de/tl_page.php diff --git a/src/Resources/contao/dca/tl_calendar_events.php b/src/Resources/contao/dca/tl_calendar_events.php new file mode 100644 index 0000000..5c2cee3 --- /dev/null +++ b/src/Resources/contao/dca/tl_calendar_events.php @@ -0,0 +1,32 @@ +addLegend('meilisearch_legend', 'pal_expert_legend', PaletteManipulator::POSITION_AFTER) + ->addField('priority', 'meilisearch_legend') + ->addField('keywords', 'meilisearch_legend') + ->applyToPalette('default', 'tl_calendar_events'); + +/** + * Priority + */ +$dca['fields']['priority'] = [ + 'inputType' => 'select', + 'options' => [1, 2, 3], + 'reference' => &$GLOBALS['TL_LANG']['MSC']['meilisearch_priority'], + 'default' => 2, + 'eval' => ['tl_class' => 'w50'], + 'sql' => "int(1) NOT NULL default '2'" +]; + +/** + * Keywords + */ +$dca['fields']['keywords'] = [ + 'inputType' => 'text', + 'eval' => ['tl_class' => 'w50', 'maxlength' => 255], + 'sql' => "varchar(255) NOT NULL default ''" +]; \ No newline at end of file diff --git a/src/Resources/contao/dca/tl_news.php b/src/Resources/contao/dca/tl_news.php new file mode 100644 index 0000000..fd5f7f5 --- /dev/null +++ b/src/Resources/contao/dca/tl_news.php @@ -0,0 +1,32 @@ +addLegend('meilisearch_legend', 'pal_expert_legend', PaletteManipulator::POSITION_AFTER) + ->addField('priority', 'meilisearch_legend') + ->addField('keywords', 'meilisearch_legend') + ->applyToPalette('default', 'tl_news'); + +/** + * Priority + */ +$dca['fields']['priority'] = [ + 'inputType' => 'select', + 'options' => [1, 2, 3], + 'reference' => &$GLOBALS['TL_LANG']['MSC']['meilisearch_priority'], + 'default' => 2, + 'eval' => ['tl_class' => 'w50'], + 'sql' => "int(1) NOT NULL default '2'" +]; + +/** + * Keywords + */ +$dca['fields']['keywords'] = [ + 'inputType' => 'text', + 'eval' => ['tl_class' => 'w50', 'maxlength' => 255], + 'sql' => "varchar(255) NOT NULL default ''" +]; \ No newline at end of file diff --git a/src/Resources/contao/dca/tl_page.php b/src/Resources/contao/dca/tl_page.php new file mode 100644 index 0000000..e76b79c --- /dev/null +++ b/src/Resources/contao/dca/tl_page.php @@ -0,0 +1,46 @@ +addLegend('meilisearch_legend', 'pal_expert_legend', PaletteManipulator::POSITION_AFTER) + ->addField('priority', 'meilisearch_legend') + ->addField('keywords', 'meilisearch_legend') + ->addField('searchimage', 'meilisearch_legend') + ->applyToPalette('regular', 'tl_page'); + +/** + * Priority + */ +$dca['fields']['priority'] = [ + 'inputType' => 'select', + 'options' => [1, 2, 3], + 'reference' => &$GLOBALS['TL_LANG']['MSC']['meilisearch_priority'], + 'default' => 2, + 'eval' => ['tl_class' => 'w50'], + 'sql' => "int(1) NOT NULL default '2'" +]; + +/** + * Keywords + */ +$dca['fields']['keywords'] = [ + 'inputType' => 'text', + 'eval' => ['tl_class' => 'w50', 'maxlength' => 255], + 'sql' => "varchar(255) NOT NULL default ''" +]; + +/** + * Search image + */ +$dca['fields']['searchimage'] = [ + 'inputType' => 'fileTree', + 'eval' => [ + 'tl_class' => 'w50', + 'filesOnly' => true, + 'fieldType' => 'radio' + ], + 'sql' => "varbinary(16) NULL" +]; \ No newline at end of file diff --git a/src/Resources/contao/languages/de/default.php b/src/Resources/contao/languages/de/default.php new file mode 100644 index 0000000..11f1945 --- /dev/null +++ b/src/Resources/contao/languages/de/default.php @@ -0,0 +1,7 @@ + 'Niedrig', + 2 => 'Standard', + 3 => 'Hoch', +]; \ No newline at end of file diff --git a/src/Resources/contao/languages/de/tl_calendar_events.php b/src/Resources/contao/languages/de/tl_calendar_events.php new file mode 100644 index 0000000..938ef9a --- /dev/null +++ b/src/Resources/contao/languages/de/tl_calendar_events.php @@ -0,0 +1,11 @@ +