diff --git a/src/Resources/contao/dca/tl_templates.php b/src/Resources/contao/dca/tl_templates.php new file mode 100644 index 0000000..0593160 --- /dev/null +++ b/src/Resources/contao/dca/tl_templates.php @@ -0,0 +1,26 @@ + + * + * 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 + */ + +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'); + }; +}