Skip to content

Commit

Permalink
- Adaptation of the DCAs to the current Contao standard
Browse files Browse the repository at this point in the history
- Fix the issue that the global configuration is disabled for current Contao versions (#109)
- Set the new template `cookiebar_default_deny` as default when creating a new cookiebar (#106)
  • Loading branch information
doishub committed Apr 11, 2022
1 parent fe2b0a6 commit 62f0174
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 13 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"require":{
"php":">=7.2",
"ext-json":"*",
"contao/core-bundle":"^4.9",
"contao/core-bundle":"^4.9.28",
"symfony/http-foundation":"^4.4 || ^5.2",
"symfony/serializer":"^4.4 || ^5.2"
},
Expand Down
7 changes: 5 additions & 2 deletions src/Resources/contao/dca/tl_cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
* @copyright Oveleon <https://www.oveleon.de/>
*/

use Contao\DC_Table;
use Contao\DataContainer;

$GLOBALS['TL_DCA']['tl_cookie'] = array
(
// Config
'config' => array
(
'dataContainer' => 'Table',
'dataContainer' => DC_Table::class,
'ptable' => 'tl_cookie_group',
'switchToEdit' => true,
'enableVersioning' => true,
Expand All @@ -38,7 +41,7 @@
(
'sorting' => array
(
'mode' => 4,
'mode' => DataContainer::MODE_PARENT,
'fields' => array('sorting'),
'headerFields' => array('title'),
'panelLayout' => 'limit',
Expand Down
7 changes: 5 additions & 2 deletions src/Resources/contao/dca/tl_cookie_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
* @copyright Oveleon <https://www.oveleon.de/>
*/

use Contao\DC_Table;
use Contao\DataContainer;

$GLOBALS['TL_DCA']['tl_cookie_config'] = array
(
// Config
'config' => array
(
'dataContainer' => 'Table',
'dataContainer' => DC_Table::class,
'switchToEdit' => true,
'enableVersioning' => true,
'markAsCopy' => 'title',
Expand All @@ -36,7 +39,7 @@
(
'sorting' => array
(
'mode' => 2,
'mode' => DataContainer::MODE_SORTABLE,
'fields' => array('title'),
'flag' => 1,
'panelLayout' => 'sort,search,limit'
Expand Down
7 changes: 5 additions & 2 deletions src/Resources/contao/dca/tl_cookie_group.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
* @copyright Oveleon <https://www.oveleon.de/>
*/

use Contao\DC_Table;
use Contao\DataContainer;

$GLOBALS['TL_DCA']['tl_cookie_group'] = array
(
// Config
'config' => array
(
'dataContainer' => 'Table',
'dataContainer' => DC_Table::class,
'ptable' => 'tl_cookiebar',
'ctable' => array('tl_cookie'),
'switchToEdit' => true,
Expand All @@ -38,7 +41,7 @@
(
'sorting' => array
(
'mode' => 4,
'mode' => DataContainer::MODE_PARENT,
'fields' => array('sorting'),
'headerFields' => array('title'),
'panelLayout' => 'limit',
Expand Down
7 changes: 5 additions & 2 deletions src/Resources/contao/dca/tl_cookie_log.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
* @copyright Oveleon <https://www.oveleon.de/>
*/

use Contao\DC_Table;
use Contao\DataContainer;

$GLOBALS['TL_DCA']['tl_cookie_log'] = array
(
// Config
'config' => array
(
'dataContainer' => 'Table',
'dataContainer' => DC_Table::class,
'notCopyable' => true,
'notEditable' => true,
'notCreatable' => true,
Expand All @@ -32,7 +35,7 @@
(
'sorting' => array
(
'mode' => 2,
'mode' => DataContainer::MODE_SORTABLE,
'fields' => array('tstamp'),
'flag' => 2,
'panelLayout' => 'filter;sort,search,limit'
Expand Down
12 changes: 8 additions & 4 deletions src/Resources/contao/dca/tl_cookiebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
* @copyright Oveleon <https://www.oveleon.de/>
*/

\Contao\System::loadLanguageFile('tl_cookiebar');
use Contao\DC_Table;
use Contao\DataContainer;
use Contao\System;

System::loadLanguageFile('tl_cookiebar');

$GLOBALS['TL_DCA']['tl_cookiebar'] = array
(
// Config
'config' => array
(
'dataContainer' => 'Table',
'dataContainer' => DC_Table::class,
'ctable' => array('tl_cookie_group'),
'switchToEdit' => true,
'sql' => array
Expand All @@ -38,7 +42,7 @@
(
'sorting' => array
(
'mode' => 1,
'mode' => DataContainer::MODE_SORTED,
'fields' => array('title'),
'flag' => 1,
'panelLayout' => 'search,limit'
Expand Down Expand Up @@ -194,7 +198,7 @@
return Contao\Controller::getTemplateGroup('cookiebar_');
},
'eval' => array('tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
'sql' => "varchar(64) NOT NULL default 'cookiebar_default_deny'"
),
'alignment' => array
(
Expand Down

0 comments on commit 62f0174

Please sign in to comment.