Skip to content

Commit

Permalink
Fixed #116 bug with php files in template editor
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed Feb 10, 2020
1 parent f848650 commit e436217
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/Resources/contao/dca/tl_templates.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/*
* Copyright MADE/YOUR/DAY OG <mail@madeyourday.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

/**
* RockSolid Custom Elements DCA
*
* @author Martin Auswöger <martin@madeyourday.net>
*/

use Contao\Config;
use Contao\CoreBundle\Util\PackageUtil;

if (
is_callable([PackageUtil::class, 'getContaoVersion'])
&& version_compare(PackageUtil::getContaoVersion(), '4.7', '>=')
) {
$GLOBALS['TL_DCA']['tl_templates']['config']['validFileTypes'] .= ',php';
$GLOBALS['TL_DCA']['tl_templates']['config']['onload_callback'][] = function() {
Config::set('editableFiles', Config::get('editableFiles') . ',php');
};
}

0 comments on commit e436217

Please sign in to comment.