feat: add Contao 5.7 pinboard bundle

This commit is contained in:
Jürgen Mummert
2026-03-04 15:44:07 +01:00
commit 47b5199c54
15 changed files with 619 additions and 0 deletions

11
contao/config/config.php Normal file
View File

@@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
use Eiswurm\ContaoPinboardBundle\Model\PinboardModel;
$GLOBALS['BE_MOD']['content']['pinnwand'] = [
'tables' => ['tl_pinnwand'],
];
$GLOBALS['TL_MODELS']['tl_pinnwand'] = PinboardModel::class;

View File

@@ -0,0 +1,22 @@
services:
_defaults:
autowire: true
autoconfigure: true
Eiswurm\ContaoPinboardBundle\:
resource: '../../src/*'
exclude:
- '../../src/ContaoManager/'
- '../../src/ContaoPinboardBundle.php'
Eiswurm\ContaoPinboardBundle\Controller\FrontendModule\PinboardController:
tags:
-
name: contao.frontend_module
category: application
type: pinnwand
template: frontend_module/pinnwand
Eiswurm\ContaoPinboardBundle\EventListener\DataContainer\PinboardTimestampListener:
tags:
- { name: contao.callback, table: tl_pinnwand, target: config.onsubmit }

124
contao/dca/tl_pinnwand.php Normal file
View File

@@ -0,0 +1,124 @@
<?php
declare(strict_types=1);
$GLOBALS['TL_DCA']['tl_pinnwand'] = [
'config' => [
'dataContainer' => Contao\DC_Table::class,
'enableVersioning' => true,
'sql' => [
'keys' => [
'id' => 'primary',
'published' => 'index',
'hervorgehoben' => 'index',
],
],
],
'list' => [
'sorting' => [
'mode' => 1,
'fields' => ['hervorgehoben DESC', 'dateAdded DESC'],
'flag' => 6,
'panelLayout' => 'filter;sort,search,limit',
],
'label' => [
'fields' => ['ueberschrift', 'dateAdded'],
'format' => '%s <span style="color:#999;padding-left:3px">[%s]</span>',
],
'global_operations' => [
'all' => [
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"',
],
],
'operations' => [
'edit' => [
'href' => 'act=edit',
'icon' => 'edit.svg',
],
'copy' => [
'href' => 'act=copy',
'icon' => 'copy.svg',
],
'delete' => [
'href' => 'act=delete',
'icon' => 'delete.svg',
'attributes' => 'onclick="if(!confirm(\'' . ($GLOBALS['TL_LANG']['MSC']['deleteConfirm'] ?? 'Möchten Sie den Eintrag wirklich löschen?') . '\'))return false;Backend.getScrollOffset()"',
],
'show' => [
'href' => 'act=show',
'icon' => 'show.svg',
],
],
],
'palettes' => [
'default' => '{title_legend},ueberschrift,text,link,bild;{meta_legend},dateAdded,dateModified;{publish_legend},published,hervorgehoben',
],
'fields' => [
'id' => [
'sql' => 'int(10) unsigned NOT NULL auto_increment',
],
'tstamp' => [
'sql' => 'int(10) unsigned NOT NULL default 0',
],
'ueberschrift' => [
'exclude' => true,
'search' => true,
'sorting' => true,
'inputType' => 'text',
'eval' => ['mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
],
'text' => [
'exclude' => true,
'search' => true,
'inputType' => 'textarea',
'eval' => ['mandatory' => true, 'maxlength' => 3000, 'rte' => 'tinyMCE', 'allowHtml' => true, 'tl_class' => 'clr'],
'sql' => 'text NULL',
],
'link' => [
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => ['rgxp' => 'url', 'decodeEntities' => true, 'maxlength' => 2048, 'dcaPicker' => true, 'tl_class' => 'w50'],
'sql' => "varchar(2048) NOT NULL default ''",
],
'bild' => [
'exclude' => true,
'inputType' => 'fileTree',
'eval' => ['filesOnly' => true, 'fieldType' => 'radio', 'extensions' => Contao\Config::get('validImageTypes'), 'mandatory' => false, 'tl_class' => 'w50 clr'],
'sql' => 'binary(16) NULL',
],
'dateAdded' => [
'sorting' => true,
'flag' => 6,
'inputType' => 'text',
'eval' => ['rgxp' => 'datim', 'datepicker' => true, 'mandatory' => true, 'tl_class' => 'w50 wizard'],
'sql' => 'int(10) unsigned NOT NULL default 0',
],
'dateModified' => [
'sorting' => true,
'flag' => 6,
'inputType' => 'text',
'eval' => ['rgxp' => 'datim', 'readonly' => true, 'disabled' => true, 'tl_class' => 'w50'],
'sql' => 'int(10) unsigned NOT NULL default 0',
],
'published' => [
'exclude' => true,
'filter' => true,
'toggle' => true,
'inputType' => 'checkbox',
'eval' => ['doNotCopy' => true, 'tl_class' => 'w50 m12'],
'sql' => "char(1) NOT NULL default ''",
],
'hervorgehoben' => [
'exclude' => true,
'filter' => true,
'toggle' => true,
'inputType' => 'checkbox',
'eval' => ['tl_class' => 'w50 m12'],
'sql' => "char(1) NOT NULL default ''",
],
],
];

View File

@@ -0,0 +1,6 @@
<?php
declare(strict_types=1);
$GLOBALS['TL_LANG']['MOD']['pinnwand'] = ['Pinwand', 'Pinnwandeinträge verwalten'];
$GLOBALS['TL_LANG']['FMD']['pinnwand'] = ['Pinwand', 'Zeigt veröffentlichte Pinnwandeinträge als frei angeordnete Notizzettel an'];

View File

@@ -0,0 +1,16 @@
<?php
declare(strict_types=1);
$GLOBALS['TL_LANG']['tl_pinnwand']['ueberschrift'] = ['Überschrift', 'Die Überschrift des Pinnwandeintrags.'];
$GLOBALS['TL_LANG']['tl_pinnwand']['text'] = ['Text', 'Inhalt des Pinnwandeintrags (maximal 3000 Zeichen).'];
$GLOBALS['TL_LANG']['tl_pinnwand']['link'] = ['Link', 'Optionaler Link zum Eintrag.'];
$GLOBALS['TL_LANG']['tl_pinnwand']['bild'] = ['Bild', 'Optionales Bild für den Pinnwandeintrag.'];
$GLOBALS['TL_LANG']['tl_pinnwand']['dateAdded'] = ['Erstellt am', 'Datum/Uhrzeit der Erstellung.'];
$GLOBALS['TL_LANG']['tl_pinnwand']['dateModified'] = ['Geändert am', 'Datum/Uhrzeit der letzten Änderung.'];
$GLOBALS['TL_LANG']['tl_pinnwand']['published'] = ['Veröffentlicht', 'Nur veröffentlichte Einträge erscheinen im Frontend.'];
$GLOBALS['TL_LANG']['tl_pinnwand']['hervorgehoben'] = ['Hervorgehoben', 'Hervorgehobene Einträge liegen im Frontend immer oben.'];
$GLOBALS['TL_LANG']['tl_pinnwand']['title_legend'] = 'Inhalt';
$GLOBALS['TL_LANG']['tl_pinnwand']['meta_legend'] = 'Metadaten';
$GLOBALS['TL_LANG']['tl_pinnwand']['publish_legend'] = 'Veröffentlichung';