Skip to content

Commit

Permalink
#6 #7
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbarkowsky committed Dec 2, 2019
1 parent 51ced12 commit e9b5cdf
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions dca/tl_form_field.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@
* @license LGPL
*/

use Contao\Input;
use Contao\Backend;
use Contao\Controller;
use Contao\DataContainer;

/**
* Load tl_content
*/
\Contao\Controller::loadDataContainer('tl_content');
Controller::loadDataContainer('tl_content');

/**
* Palettes
Expand Down Expand Up @@ -94,23 +99,32 @@
'sql' => "varchar(64) NOT NULL default ''"
);


class tl_extended_checkbox extends \Contao\Backend
/**
* Class tl_extended_checkbox
*/
class tl_extended_checkbox extends Backend
{
/**
* tl_extended_checkbox constructor.
*/
public function __construct()
{
parent::__construct();
$this->import('BackendUser', 'User');
}

public function getExtendedCheckboxTemplates(\Contao\DataContainer $dc)
/**
* @param DataContainer $dc
* @return mixed
*/
public function getExtendedCheckboxTemplates(DataContainer $dc)
{
$intPid = $dc->activeRecord->pid;

if (\Contao\Input::get('act') == 'overrideAll') {
$intPid = \Contao\Input::get('id');
if (Input::get('act') == 'overrideAll') {
$intPid = Input::get('id');
}

return $this->getTemplateGroup('form_widget' , $intPid);
return Controller::getTemplateGroup('form_widget' , $intPid);
}
}

0 comments on commit e9b5cdf

Please sign in to comment.