Skip to content

Commit

Permalink
classnames
Browse files Browse the repository at this point in the history
  • Loading branch information
benfolds committed May 19, 2022
1 parent 66a2d7e commit b21fc3b
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Resources/contao/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@


if (TL_MODE == "BE") {
$GLOBALS['TL_CSS'][] = 'bundles/contaoclasses/backend.css';
$GLOBALS['TL_CSS'][] = 'bundles/contaowrapper/backend.css';
}
// Own Wrapper
$GLOBALS['TL_CTE']['wrapper'] = [
'wrapperStart' => 'DieSchittigs\DieSchittigsHelpers\ContentWrapperStart',
'wrapperStop' => 'DieSchittigs\DieSchittigsHelpers\ContentWrapperStop'
'wrapperStart' => 'DieSchittigs\ContaoWrapperBundle\ContentWrapperStart',
'wrapperStop' => 'DieSchittigs\ContaoWrapperBundle\ContentWrapperStop'
];

$GLOBALS['TL_WRAPPERS']['start'][] = 'wrapperStart';
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/contao/dca/tl_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@


// Automatically add a wrapper stop element
$GLOBALS['TL_DCA']['tl_content']['config']['onsubmit_callback'][] = ['tl_content_helper', 'generateWrapperStop'];
$GLOBALS['TL_DCA']['tl_content']['config']['onsubmit_callback'][] = ['tl_content_wrapper', 'generateWrapperStop'];

class tl_content_helper extends tl_content
class tl_content_wrapper extends tl_content
{

public function generateWrapperStop(DataContainer $dc)
Expand Down
29 changes: 29 additions & 0 deletions src/Resources/contao/elements/ContentWrapperStart.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace DieSchittigs\ContaoWrapperBundle;

use Contao;

class ContentWrapperStart extends Contao\ContentElement
{

/**
* Template
* @var string
*/
protected $strTemplate = 'ce_wrapperStart';

/**
* Generate the content element
*/
protected function compile()
{
if (TL_MODE == 'BE') {
$this->strTemplate = 'be_wildcard';
$this->Template = new Contao\BackendTemplate($this->strTemplate);
$this->Template->title = $this->headline;
}
}
}

class_alias(ContentWrapperStart::class, 'ContentWrapperStart');
28 changes: 28 additions & 0 deletions src/Resources/contao/elements/ContentWrapperStop.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace DieSchittigs\ContaoWrapperBundle;

use Contao;

class ContentWrapperStop extends Contao\ContentElement
{

/**
* Template
* @var string
*/
protected $strTemplate = 'ce_wrapperStop';

/**
* Generate the content element
*/
protected function compile()
{
if (TL_MODE == 'BE') {
$this->strTemplate = 'be_wildcard';

$this->Template = new Contao\BackendTemplate($this->strTemplate);
}
}
}
class_alias(ContentWrapperStop::class, 'ContentWrapperStop');

0 comments on commit b21fc3b

Please sign in to comment.