<?php

namespace {
/*
 * This file is part of Contao.
 *
 * (c) Leo Feyer
 *
 * @license LGPL-3.0-or-later
 */
$GLOBALS['TL_DCA']['tl_module'] = array(
    // Config
    'config' => array('dataContainer' => \Contao\DC_Table::class, 'ptable' => 'tl_theme', 'enableVersioning' => \true, 'markAsCopy' => 'name', 'onload_callback' => array(array('tl_module', 'checkPermission'), array('tl_module', 'addCustomLayoutSectionReferences')), 'sql' => array('keys' => array('id' => 'primary'))),
    // List
    'list' => array('sorting' => array('mode' => 4, 'fields' => array('name'), 'panelLayout' => 'filter;sort,search,limit', 'headerFields' => array('name', 'author', 'tstamp'), 'child_record_callback' => array('tl_module', 'listModule')), 'label' => array('group_callback' => array('tl_module', 'getGroupHeader')), 'global_operations' => array('all' => array('href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"')), 'operations' => array('edit' => array('href' => 'act=edit', 'icon' => 'edit.svg'), 'copy' => array('href' => 'act=paste&amp;mode=copy', 'icon' => 'copy.svg', 'attributes' => 'onclick="Backend.getScrollOffset()"'), 'cut' => array('href' => 'act=paste&amp;mode=cut', 'icon' => 'cut.svg', 'attributes' => 'onclick="Backend.getScrollOffset()"'), 'delete' => array('href' => 'act=delete', 'icon' => 'delete.svg', 'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'), 'show' => array('href' => 'act=show', 'icon' => 'show.svg'))),
    // Palettes
    'palettes' => array('__selector__' => array('type', 'defineRoot', 'protected', 'reg_assignDir', 'reg_activate'), 'default' => '{title_legend},name,type', 'navigation' => '{title_legend},name,headline,type;{nav_legend},levelOffset,showLevel,hardLimit,showProtected,showHidden;{reference_legend:hide},defineRoot;{template_legend:hide},navigationTpl,customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID', 'customnav' => '{title_legend},name,headline,type;{nav_legend},pages,showProtected;{template_legend:hide},navigationTpl,customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID', 'breadcrumb' => '{title_legend},name,headline,type;{nav_legend},showHidden;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID', 'quicknav' => '{title_legend},name,headline,type;{nav_legend},customLabel,showLevel,hardLimit,showProtected,showHidden;{reference_legend:hide},rootPage;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID', 'quicklink' => '{title_legend},name,headline,type;{nav_legend},pages,customLabel;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID', 'booknav' => '{title_legend},name,headline,type;{nav_legend},rootPage,showProtected,showHidden;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID', 'articlenav' => '{title_legend},name,headline,type;{config_legend},loadFirst;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID', 'sitemap' => '{title_legend},name,headline,type;{nav_legend},showProtected,showHidden;{reference_legend:hide},rootPage;{template_legend:hide},navigationTpl,customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID', 'login' => '{title_legend},name,headline,type;{config_legend},autologin;{redirect_legend},jumpTo,redirectBack;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID', 'logout' => '{title_legend},name,type;{redirect_legend},jumpTo,redirectBack;{protected_legend:hide},protected;{expert_legend:hide},cssID', 'personalData' => '{title_legend},name,headline,type;{config_legend},editable;{redirect_legend},jumpTo;{template_legend:hide},memberTpl;{protected_legend:hide},protected;{expert_legend:hide},cssID', 'registration' => '{title_legend},name,headline,type;{config_legend},editable,newsletters,disableCaptcha;{account_legend},reg_groups,reg_allowLogin,reg_assignDir;{redirect_legend},jumpTo;{email_legend},reg_activate;{template_legend:hide},memberTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID', 'changePassword' => '{title_legend},name,headline,type;{redirect_legend},jumpTo;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},cssID', 'lostPassword' => '{title_legend},name,headline,type;{config_legend},reg_skipName,disableCaptcha;{redirect_legend},jumpTo;{email_legend:hide},reg_jumpTo,reg_password;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID', 'closeAccount' => '{title_legend},name,headline,type;{config_legend},reg_close;{redirect_legend},jumpTo;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},cssID', 'form' => '{title_legend},name,headline,type;{include_legend},form;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID', 'search' => '{title_legend},name,headline,type;{config_legend},queryType,fuzzy,contextLength,minKeywordLength,perPage,searchType;{redirect_legend:hide},jumpTo;{reference_legend:hide},pages;{template_legend:hide},searchTpl,customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID', 'articlelist' => '{title_legend},name,headline,type;{config_legend},skipFirst,inColumn;{reference_legend:hide},defineRoot;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID', 'randomImage' => '{title_legend},name,headline,type;{source_legend},multiSRC,imgSize,fullsize,useCaption;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID', 'html' => '{title_legend},name,type;{html_legend},html;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests', 'rssReader' => '{title_legend},name,headline,type;{config_legend},rss_feed,numberOfItems,perPage,skipFirst,rss_cache;{template_legend:hide},rss_template;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID', 'two_factor' => '{title_legend},name,headline,type;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},cssID'),
    // Subpalettes
    'subpalettes' => array('defineRoot' => 'rootPage', 'protected' => 'groups', 'reg_assignDir' => 'reg_homeDir', 'reg_activate' => 'reg_jumpTo,reg_text'),
    // Fields
    'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'pid' => array('foreignKey' => 'tl_theme.name', 'sql' => "int(10) unsigned NOT NULL default 0", 'relation' => array('type' => 'belongsTo', 'load' => 'lazy')), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default 0"), 'name' => array('exclude' => \true, 'sorting' => \true, 'flag' => 1, 'search' => \true, 'inputType' => 'text', 'eval' => array('mandatory' => \true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'headline' => array('exclude' => \true, 'search' => \true, 'inputType' => 'inputUnit', 'options' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'), 'eval' => array('maxlength' => 200, 'tl_class' => 'w50 clr'), 'sql' => "varchar(255) NOT NULL default 'a:2:{s:5:\"value\";s:0:\"\";s:4:\"unit\";s:2:\"h2\";}'"), 'type' => array('exclude' => \true, 'sorting' => \true, 'flag' => 11, 'filter' => \true, 'inputType' => 'select', 'options_callback' => array('tl_module', 'getModules'), 'reference' => &$GLOBALS['TL_LANG']['FMD'], 'eval' => array('helpwizard' => \true, 'chosen' => \true, 'submitOnChange' => \true, 'tl_class' => 'w50'), 'sql' => "varchar(64) COLLATE ascii_bin NOT NULL default 'navigation'"), 'levelOffset' => array('exclude' => \true, 'inputType' => 'text', 'eval' => array('maxlength' => 5, 'rgxp' => 'natural', 'tl_class' => 'w50'), 'sql' => "smallint(5) unsigned NOT NULL default 0"), 'showLevel' => array('exclude' => \true, 'inputType' => 'text', 'eval' => array('maxlength' => 5, 'rgxp' => 'natural', 'tl_class' => 'w50'), 'sql' => "smallint(5) unsigned NOT NULL default 0"), 'hardLimit' => array('exclude' => \true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''"), 'showProtected' => array('exclude' => \true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''"), 'defineRoot' => array('exclude' => \true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => \true), 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''"), 'rootPage' => array('exclude' => \true, 'inputType' => 'pageTree', 'foreignKey' => 'tl_page.title', 'eval' => array('fieldType' => 'radio', 'tl_class' => 'clr'), 'sql' => "int(10) unsigned NOT NULL default 0", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'navigationTpl' => array('exclude' => \true, 'inputType' => 'select', 'options_callback' => static function () {
        return \Contao\Controller::getTemplateGroup('nav_');
    }, 'eval' => array('includeBlankOption' => \true, 'chosen' => \true, 'tl_class' => 'w50'), 'sql' => "varchar(64) COLLATE ascii_bin NOT NULL default ''"), 'customTpl' => array('exclude' => \true, 'inputType' => 'select', 'eval' => array('chosen' => \true, 'tl_class' => 'w50'), 'sql' => "varchar(64) COLLATE ascii_bin NOT NULL default ''"), 'pages' => array('exclude' => \true, 'inputType' => 'pageTree', 'foreignKey' => 'tl_page.title', 'eval' => array('multiple' => \true, 'fieldType' => 'checkbox', 'orderField' => 'orderPages', 'mandatory' => \true), 'load_callback' => array(array('tl_module', 'setPagesFlags')), 'sql' => "blob NULL", 'relation' => array('type' => 'hasMany', 'load' => 'lazy')), 'orderPages' => array('label' => &$GLOBALS['TL_LANG']['MSC']['sortOrder'], 'sql' => "blob NULL"), 'showHidden' => array('exclude' => \true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''"), 'customLabel' => array('exclude' => \true, 'inputType' => 'text', 'eval' => array('maxlength' => 64, 'rgxp' => 'extnd', 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'autologin' => array('exclude' => \true, 'inputType' => 'checkbox', 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''"), 'jumpTo' => array('exclude' => \true, 'inputType' => 'pageTree', 'foreignKey' => 'tl_page.title', 'eval' => array('fieldType' => 'radio'), 'sql' => "int(10) unsigned NOT NULL default 0", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'redirectBack' => array('exclude' => \true, 'inputType' => 'checkbox', 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''"), 'editable' => array('exclude' => \true, 'inputType' => 'checkboxWizard', 'options_callback' => array('tl_module', 'getEditableMemberProperties'), 'eval' => array('multiple' => \true), 'sql' => "blob NULL"), 'memberTpl' => array('exclude' => \true, 'inputType' => 'select', 'options_callback' => static function () {
        return \Contao\Controller::getTemplateGroup('member_');
    }, 'eval' => array('includeBlankOption' => \true, 'chosen' => \true, 'tl_class' => 'w50'), 'sql' => "varchar(64) COLLATE ascii_bin NOT NULL default ''"), 'form' => array('exclude' => \true, 'inputType' => 'select', 'foreignKey' => 'tl_form.title', 'options_callback' => array('tl_module', 'getForms'), 'eval' => array('chosen' => \true, 'tl_class' => 'w50 wizard'), 'sql' => "int(10) unsigned NOT NULL default 0", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'queryType' => array('exclude' => \true, 'inputType' => 'select', 'options' => array('and', 'or'), 'reference' => &$GLOBALS['TL_LANG']['tl_module'], 'eval' => array('helpwizard' => \true, 'tl_class' => 'w50'), 'sql' => "varchar(8) COLLATE ascii_bin NOT NULL default 'and'"), 'fuzzy' => array('exclude' => \true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 m12'), 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''"), 'contextLength' => array('exclude' => \true, 'inputType' => 'text', 'eval' => array('multiple' => \true, 'size' => 2, 'rgxp' => 'natural', 'tl_class' => 'w50', 'placeholder' => array(48, 360)), 'sql' => "varchar(64) COLLATE ascii_bin NOT NULL default ''"), 'minKeywordLength' => array('exclude' => \true, 'inputType' => 'text', 'eval' => array('rgxp' => 'natural', 'tl_class' => 'w50'), 'sql' => "smallint(5) unsigned NOT NULL default 4"), 'perPage' => array('exclude' => \true, 'inputType' => 'text', 'eval' => array('rgxp' => 'natural', 'tl_class' => 'w50'), 'sql' => "smallint(5) unsigned NOT NULL default 0"), 'searchType' => array('exclude' => \true, 'inputType' => 'select', 'options' => array('simple', 'advanced'), 'reference' => &$GLOBALS['TL_LANG']['tl_module'], 'eval' => array('helpwizard' => \true, 'tl_class' => 'w50'), 'sql' => "varchar(16) COLLATE ascii_bin NOT NULL default 'simple'"), 'searchTpl' => array('exclude' => \true, 'inputType' => 'select', 'options_callback' => static function () {
        return \Contao\Controller::getTemplateGroup('search_');
    }, 'eval' => array('includeBlankOption' => \true, 'chosen' => \true, 'tl_class' => 'w50'), 'sql' => "varchar(64) COLLATE ascii_bin NOT NULL default ''"), 'inColumn' => array('exclude' => \true, 'inputType' => 'select', 'options_callback' => array('tl_module', 'getLayoutSections'), 'reference' => &$GLOBALS['TL_LANG']['COLS'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(32) COLLATE ascii_bin NOT NULL default 'main'"), 'skipFirst' => array('exclude' => \true, 'inputType' => 'text', 'eval' => array('rgxp' => 'natural', 'tl_class' => 'w50'), 'sql' => "smallint(5) unsigned NOT NULL default 0"), 'loadFirst' => array('exclude' => \true, 'inputType' => 'checkbox', 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''"), 'singleSRC' => array('exclude' => \true, 'inputType' => 'fileTree', 'eval' => array('fieldType' => 'radio', 'filesOnly' => \true, 'mandatory' => \true, 'tl_class' => 'clr'), 'sql' => "binary(16) NULL"), 'url' => array('exclude' => \true, 'inputType' => 'text', 'eval' => array('mandatory' => \true, 'rgxp' => 'url', 'decodeEntities' => \true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "text NULL"), 'imgSize' => array('exclude' => \true, 'inputType' => 'imageSize', 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('rgxp' => 'natural', 'includeBlankOption' => \true, 'nospace' => \true, 'helpwizard' => \true, 'tl_class' => 'w50'), 'options_callback' => static function () {
        return \Contao\System::getContainer()->get('contao.image.image_sizes')->getOptionsForUser(\Contao\BackendUser::getInstance());
    }, 'sql' => "varchar(128) COLLATE ascii_bin NOT NULL default ''"), 'useCaption' => array('exclude' => \true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''"), 'fullsize' => array('exclude' => \true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 m12'), 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''"), 'multiSRC' => array('exclude' => \true, 'inputType' => 'fileTree', 'eval' => array('multiple' => \true, 'fieldType' => 'checkbox', 'orderField' => 'orderSRC', 'files' => \true, 'mandatory' => \true), 'load_callback' => array(array('tl_module', 'setMultiSrcFlags')), 'sql' => "blob NULL"), 'orderSRC' => array('label' => &$GLOBALS['TL_LANG']['MSC']['sortOrder'], 'sql' => "blob NULL"), 'html' => array('exclude' => \true, 'search' => \true, 'inputType' => 'textarea', 'eval' => array('allowHtml' => \true, 'class' => 'monospace', 'rte' => 'ace|html', 'helpwizard' => \true), 'explanation' => 'insertTags', 'sql' => "text NULL"), 'rss_cache' => array('exclude' => \true, 'inputType' => 'select', 'options' => array(0, 5, 15, 30, 60, 300, 900, 1800, 3600, 10800, 21600, 43200, 86400), 'eval' => array('tl_class' => 'w50'), 'reference' => &$GLOBALS['TL_LANG']['CACHE'], 'sql' => "int(10) unsigned NOT NULL default 3600"), 'rss_feed' => array('exclude' => \true, 'inputType' => 'textarea', 'eval' => array('mandatory' => \true, 'decodeEntities' => \true, 'style' => 'height:60px'), 'sql' => "text NULL"), 'rss_template' => array('exclude' => \true, 'inputType' => 'select', 'options_callback' => static function () {
        return \Contao\Controller::getTemplateGroup('rss_');
    }, 'eval' => array('includeBlankOption' => \true, 'chosen' => \true, 'tl_class' => 'w50'), 'sql' => "varchar(64) COLLATE ascii_bin NOT NULL default ''"), 'numberOfItems' => array('exclude' => \true, 'inputType' => 'text', 'eval' => array('mandatory' => \true, 'rgxp' => 'natural', 'tl_class' => 'w50'), 'sql' => "smallint(5) unsigned NOT NULL default 3"), 'disableCaptcha' => array('exclude' => \true, 'inputType' => 'checkbox', 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''"), 'reg_groups' => array('exclude' => \true, 'inputType' => 'checkbox', 'foreignKey' => 'tl_member_group.name', 'eval' => array('multiple' => \true), 'sql' => "blob NULL", 'relation' => array('type' => 'hasMany', 'load' => 'lazy')), 'reg_allowLogin' => array('exclude' => \true, 'inputType' => 'checkbox', 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''"), 'reg_skipName' => array('exclude' => \true, 'inputType' => 'checkbox', 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''"), 'reg_close' => array('exclude' => \true, 'inputType' => 'select', 'options' => array('close_deactivate', 'close_delete'), 'eval' => array('tl_class' => 'w50'), 'reference' => &$GLOBALS['TL_LANG']['tl_module'], 'sql' => "varchar(32) COLLATE ascii_bin NOT NULL default ''"), 'reg_assignDir' => array('exclude' => \true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => \true), 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''"), 'reg_homeDir' => array('exclude' => \true, 'inputType' => 'fileTree', 'eval' => array('fieldType' => 'radio', 'tl_class' => 'clr'), 'sql' => "binary(16) NULL"), 'reg_activate' => array('exclude' => \true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => \true), 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''"), 'reg_jumpTo' => array('exclude' => \true, 'inputType' => 'pageTree', 'foreignKey' => 'tl_page.title', 'eval' => array('fieldType' => 'radio'), 'sql' => "int(10) unsigned NOT NULL default 0", 'relation' => array('type' => 'hasOne', 'load' => 'lazy')), 'reg_text' => array('exclude' => \true, 'inputType' => 'textarea', 'eval' => array('style' => 'height:120px', 'decodeEntities' => \true, 'alwaysSave' => \true), 'load_callback' => array(array('tl_module', 'getActivationDefault')), 'sql' => "text NULL"), 'reg_password' => array('exclude' => \true, 'inputType' => 'textarea', 'eval' => array('style' => 'height:120px', 'decodeEntities' => \true, 'alwaysSave' => \true), 'load_callback' => array(array('tl_module', 'getPasswordDefault')), 'sql' => "text NULL"), 'protected' => array('exclude' => \true, 'filter' => \true, 'inputType' => 'checkbox', 'eval' => array('submitOnChange' => \true), 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''"), 'groups' => array('exclude' => \true, 'inputType' => 'checkbox', 'foreignKey' => 'tl_member_group.name', 'eval' => array('mandatory' => \true, 'multiple' => \true), 'sql' => "blob NULL", 'relation' => array('type' => 'hasMany', 'load' => 'lazy')), 'guests' => array('exclude' => \true, 'filter' => \true, 'inputType' => 'checkbox', 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''"), 'cssID' => array('exclude' => \true, 'inputType' => 'text', 'eval' => array('multiple' => \true, 'size' => 2, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''")),
);
/**
 * Provide miscellaneous methods that are used by the data configuration array.
 *
 * @author Leo Feyer <https://github.com/leofeyer>
 */
class tl_module extends \Contao\Backend
{
    /**
     * Import the back end user object
     */
    public function __construct()
    {
        parent::__construct();
        $this->import('Contao\\BackendUser', 'User');
    }
    /**
     * Check permissions to edit the table
     *
     * @throws Contao\CoreBundle\Exception\AccessDeniedException
     */
    public function checkPermission()
    {
        if ($this->User->isAdmin) {
            return;
        }
        if (!$this->User->hasAccess('modules', 'themes')) {
            throw new \Contao\CoreBundle\Exception\AccessDeniedException('Not enough permissions to access the front end modules module.');
        }
    }
    /**
     * Return all front end modules as array
     *
     * @return array
     */
    public function getModules()
    {
        $groups = array();
        foreach ($GLOBALS['FE_MOD'] as $k => $v) {
            foreach (\array_keys($v) as $kk) {
                $groups[$k][] = $kk;
            }
        }
        return $groups;
    }
    /**
     * Return all editable fields of table tl_member
     *
     * @return array
     */
    public function getEditableMemberProperties()
    {
        $return = array();
        \Contao\System::loadLanguageFile('tl_member');
        $this->loadDataContainer('tl_member');
        foreach ($GLOBALS['TL_DCA']['tl_member']['fields'] as $k => $v) {
            if ($v['eval']['feEditable']) {
                $return[$k] = $GLOBALS['TL_DCA']['tl_member']['fields'][$k]['label'][0];
            }
        }
        return $return;
    }
    /**
     * Get all forms and return them as array
     *
     * @return array
     */
    public function getForms()
    {
        if (!$this->User->isAdmin && !\is_array($this->User->forms)) {
            return array();
        }
        $arrForms = array();
        $objForms = $this->Database->execute("SELECT id, title FROM tl_form ORDER BY title");
        while ($objForms->next()) {
            if ($this->User->hasAccess($objForms->id, 'forms')) {
                $arrForms[$objForms->id] = $objForms->title;
            }
        }
        return $arrForms;
    }
    /**
     * Return all layout sections as array
     *
     * @return array
     */
    public function getLayoutSections()
    {
        $arrSections = array('header', 'left', 'right', 'main', 'footer');
        // Check for custom layout sections
        $objLayout = $this->Database->query("SELECT sections FROM tl_layout WHERE sections!=''");
        while ($objLayout->next()) {
            $arrCustom = \Contao\StringUtil::deserialize($objLayout->sections);
            // Add the custom layout sections
            if (!empty($arrCustom) && \is_array($arrCustom)) {
                foreach ($arrCustom as $v) {
                    if (!empty($v['id'])) {
                        $arrSections[] = $v['id'];
                    }
                }
            }
        }
        return \Contao\Backend::convertLayoutSectionIdsToAssociativeArray($arrSections);
    }
    /**
     * Use the module type as group header if sorted by type (see #8402)
     *
     * @param string $group
     * @param string $mode
     * @param string $field
     * @param array  $row
     *
     * @return string
     */
    public function getGroupHeader($group, $mode, $field, $row)
    {
        if ($field == 'type') {
            return $row['type'];
        }
        return $group;
    }
    /**
     * Load the default activation text
     *
     * @param mixed $varValue
     *
     * @return mixed
     */
    public function getActivationDefault($varValue)
    {
        if (\trim($varValue) === '') {
            $varValue = \is_array($GLOBALS['TL_LANG']['tl_module']['emailText']) ? $GLOBALS['TL_LANG']['tl_module']['emailText'][1] : $GLOBALS['TL_LANG']['tl_module']['emailText'];
        }
        return $varValue;
    }
    /**
     * Load the default password text
     *
     * @param mixed $varValue
     *
     * @return mixed
     */
    public function getPasswordDefault($varValue)
    {
        if (\trim($varValue) === '') {
            $varValue = \is_array($GLOBALS['TL_LANG']['tl_module']['passwordText']) ? $GLOBALS['TL_LANG']['tl_module']['passwordText'][1] : $GLOBALS['TL_LANG']['tl_module']['passwordText'];
        }
        return $varValue;
    }
    /**
     * List a front end module
     *
     * @param array $row
     *
     * @return string
     */
    public function listModule($row)
    {
        return '<div class="tl_content_left">' . $row['name'] . ' <span style="color:#999;padding-left:3px">[' . ($GLOBALS['TL_LANG']['FMD'][$row['type']][0] ?? $row['type']) . ']</span></div>';
    }
    /**
     * Dynamically add flags to the "multiSRC" field
     *
     * @param mixed                $varValue
     * @param Contao\DataContainer $dc
     *
     * @return mixed
     */
    public function setMultiSrcFlags($varValue, \Contao\DataContainer $dc)
    {
        if ($dc->activeRecord && $dc->activeRecord->type == 'randomImage') {
            $GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['isGallery'] = \true;
            $GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['extensions'] = \Contao\Config::get('validImageTypes');
        }
        return $varValue;
    }
    /**
     * Dynamically change attributes of the "pages" field
     *
     * @param mixed                $varValue
     * @param Contao\DataContainer $dc
     *
     * @return mixed
     */
    public function setPagesFlags($varValue, \Contao\DataContainer $dc)
    {
        if ($dc->activeRecord && $dc->activeRecord->type == 'search') {
            $GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['mandatory'] = \false;
            unset($GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['orderField']);
        }
        return $varValue;
    }
}
}

namespace {
$GLOBALS['TL_DCA']['tl_module']['config']['onload_callback'][] = ['netzmacht.contao_form_designer.listener.dca.module', 'initialize'];
$GLOBALS['TL_DCA']['tl_module']['fields']['formLayout'] = ['label' => &$GLOBALS['TL_LANG']['tl_module']['formLayout'], 'inputType' => 'select', 'eval' => ['tl_class' => 'w50', 'includeBlankOption' => \true, 'chosen' => \true], 'options_callback' => ['netzmacht.contao_form_designer.listener.dca.module', 'getFormLayoutOptions'], 'foreignKey' => 'tl_form_layout.title', 'relation' => ['type' => 'belongsTo', 'load' => 'lazy'], 'sql' => "int(10) unsigned NOT NULL default '0'"];
}

namespace {
/*
 * This file is part of Contao.
 *
 * (c) Leo Feyer
 *
 * @license LGPL-3.0-or-later
 */
// Add a palette selector
$GLOBALS['TL_DCA']['tl_module']['palettes']['__selector__'][] = 'cal_format';
// Add palettes to tl_module
$GLOBALS['TL_DCA']['tl_module']['palettes']['calendar'] = '{title_legend},name,headline,type;{config_legend},cal_calendar,cal_startDay,cal_noSpan;{redirect_legend},jumpTo;{template_legend:hide},cal_ctemplate,customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID';
$GLOBALS['TL_DCA']['tl_module']['palettes']['eventlist'] = '{title_legend},name,headline,type;{config_legend},cal_calendar,cal_format,cal_noSpan,cal_order,cal_readerModule,cal_limit,perPage,cal_ignoreDynamic,cal_hideRunning;{template_legend:hide},cal_template,customTpl;{image_legend:hide},imgSize;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID';
$GLOBALS['TL_DCA']['tl_module']['palettes']['eventreader'] = '{title_legend},name,headline,type;{config_legend},cal_calendar,cal_hideRunning;{template_legend:hide},cal_template,customTpl;{image_legend},imgSize;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID';
$GLOBALS['TL_DCA']['tl_module']['palettes']['eventmenu'] = '{title_legend},name,headline,type;{config_legend},cal_calendar,cal_format,cal_noSpan,cal_order,cal_showQuantity;{redirect_legend},jumpTo;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID';
$GLOBALS['TL_DCA']['tl_module']['palettes']['eventmenucal_day'] = '{title_legend},name,headline,type;{config_legend},cal_calendar,cal_format,cal_noSpan,cal_startDay,cal_showQuantity;{redirect_legend},jumpTo;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID';
// Add fields to tl_module
$GLOBALS['TL_DCA']['tl_module']['fields']['cal_calendar'] = array('exclude' => \true, 'inputType' => 'checkbox', 'options_callback' => array('tl_module_calendar', 'getCalendars'), 'eval' => array('mandatory' => \true, 'multiple' => \true), 'sql' => "blob NULL");
$GLOBALS['TL_DCA']['tl_module']['fields']['cal_noSpan'] = array('exclude' => \true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 m12'), 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['cal_hideRunning'] = array('exclude' => \true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['cal_startDay'] = array('exclude' => \true, 'inputType' => 'select', 'options' => array(0, 1, 2, 3, 4, 5, 6), 'reference' => &$GLOBALS['TL_LANG']['DAYS'], 'eval' => array('tl_class' => 'w50'), 'sql' => "smallint(5) unsigned NOT NULL default 1");
$GLOBALS['TL_DCA']['tl_module']['fields']['cal_format'] = array('exclude' => \true, 'inputType' => 'select', 'options_callback' => array('tl_module_calendar', 'getFormats'), 'reference' => &$GLOBALS['TL_LANG']['tl_module'], 'eval' => array('tl_class' => 'w50', 'submitOnChange' => \true), 'sql' => "varchar(32) COLLATE ascii_bin NOT NULL default 'cal_month'");
$GLOBALS['TL_DCA']['tl_module']['fields']['cal_ignoreDynamic'] = array('exclude' => \true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['cal_order'] = array('exclude' => \true, 'inputType' => 'select', 'options' => array('ascending', 'descending'), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(16) COLLATE ascii_bin NOT NULL default 'ascending'");
$GLOBALS['TL_DCA']['tl_module']['fields']['cal_readerModule'] = array('exclude' => \true, 'inputType' => 'select', 'options_callback' => array('tl_module_calendar', 'getReaderModules'), 'reference' => &$GLOBALS['TL_LANG']['tl_module'], 'eval' => array('includeBlankOption' => \true, 'tl_class' => 'w50'), 'sql' => "int(10) unsigned NOT NULL default 0");
$GLOBALS['TL_DCA']['tl_module']['fields']['cal_limit'] = array('exclude' => \true, 'inputType' => 'text', 'eval' => array('rgxp' => 'natural', 'tl_class' => 'w50'), 'sql' => "smallint(5) unsigned NOT NULL default 0");
$GLOBALS['TL_DCA']['tl_module']['fields']['cal_template'] = array('exclude' => \true, 'inputType' => 'select', 'options_callback' => static function () {
    return \Contao\Controller::getTemplateGroup('event_');
}, 'eval' => array('includeBlankOption' => \true, 'chosen' => \true, 'tl_class' => 'w50'), 'sql' => "varchar(64) COLLATE ascii_bin NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['cal_ctemplate'] = array('exclude' => \true, 'inputType' => 'select', 'options_callback' => static function () {
    return \Contao\Controller::getTemplateGroup('cal_');
}, 'eval' => array('includeBlankOption' => \true, 'chosen' => \true, 'tl_class' => 'w50'), 'sql' => "varchar(64) COLLATE ascii_bin NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_module']['fields']['cal_showQuantity'] = array('exclude' => \true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 m12'), 'sql' => "char(1) COLLATE ascii_bin NOT NULL default ''");
$bundles = \Contao\System::getContainer()->getParameter('kernel.bundles');
// Add the comments template drop-down menu
if (isset($bundles['ContaoCommentsBundle'])) {
    $GLOBALS['TL_DCA']['tl_module']['palettes']['eventreader'] = \str_replace('{protected_legend:hide}', '{comment_legend:hide},com_template;{protected_legend:hide}', $GLOBALS['TL_DCA']['tl_module']['palettes']['eventreader']);
}
/**
 * Provide miscellaneous methods that are used by the data configuration array.
 *
 * @author Leo Feyer <https://github.com/leofeyer>
 */
class tl_module_calendar extends \Contao\Backend
{
    /**
     * Import the back end user object
     */
    public function __construct()
    {
        parent::__construct();
        $this->import('Contao\\BackendUser', 'User');
    }
    /**
     * Get all calendars and return them as array
     *
     * @return array
     */
    public function getCalendars()
    {
        if (!$this->User->isAdmin && !\is_array($this->User->calendars)) {
            return array();
        }
        $arrCalendars = array();
        $objCalendars = $this->Database->execute("SELECT id, title FROM tl_calendar ORDER BY title");
        while ($objCalendars->next()) {
            if ($this->User->hasAccess($objCalendars->id, 'calendars')) {
                $arrCalendars[$objCalendars->id] = $objCalendars->title;
            }
        }
        return $arrCalendars;
    }
    /**
     * Get all event reader modules and return them as array
     *
     * @return array
     */
    public function getReaderModules()
    {
        $arrModules = array();
        $objModules = $this->Database->execute("SELECT m.id, m.name, t.name AS theme FROM tl_module m LEFT JOIN tl_theme t ON m.pid=t.id WHERE m.type='eventreader' ORDER BY t.name, m.name");
        while ($objModules->next()) {
            $arrModules[$objModules->theme][$objModules->id] = $objModules->name . ' (ID ' . $objModules->id . ')';
        }
        return $arrModules;
    }
    /**
     * Return the calendar formats depending on the module type
     *
     * @param Contao\DataContainer $dc
     *
     * @return array
     */
    public function getFormats(\Contao\DataContainer $dc)
    {
        if ($dc->activeRecord->type == 'eventmenu') {
            return array('cal_day', 'cal_month', 'cal_year');
        }
        return array('cal_list' => array('cal_day', 'cal_month', 'cal_year', 'cal_all'), 'cal_upcoming' => array('next_7', 'next_14', 'next_30', 'next_90', 'next_180', 'next_365', 'next_two', 'next_cur_month', 'next_cur_year', 'next_next_month', 'next_next_year', 'next_all'), 'cal_past' => array('past_7', 'past_14', 'past_30', 'past_90', 'past_180', 'past_365', 'past_two', 'past_cur_month', 'past_cur_year', 'past_prev_month', 'past_prev_year', 'past_all'));
    }
}
}

namespace {
/*
 * This file is part of con4gis,
 * the gis-kit for Contao CMS.
 *
 * @package    con4gis
 * @version    6
 * @author     con4gis contributors (see "authors.txt")
 * @license    LGPL-3.0-or-later
 * @copyright  Küstenschmiede GmbH Software & Design
 * @link       https://www.con4gis.org
 */
/***
 * Palettes
 */
$GLOBALS['TL_DCA']['tl_module']['palettes']['c4g_maps'] = '{title_legend},name,headline,type;' . '{c4g_map_legend},c4g_map_id,c4g_map_default_mapservice,c4g_map_width,c4g_map_height,c4g_map_zoom;' . '{protected_legend:hide},protected;' . '{expert_legend:hide},guests,cssID,space';
if ($GLOBALS['con4gis']['forum']['installed']) {
    $insert = '{c4g_forum_maps_legend},c4g_forum_enable_maps;{expert_legend:hide}';
    //insert c4g-maps support when forum is installed
    $GLOBALS['TL_DCA']['tl_module']['palettes']['c4g_forum'] = \str_replace('{expert_legend:hide}', $insert, $GLOBALS['TL_DCA']['tl_module']['palettes']['c4g_forum']);
    $GLOBALS['TL_DCA']['tl_module']['fields']['c4g_forum_enable_maps'] = ['label' => &$GLOBALS['TL_LANG']['tl_module']['c4g_forum_enable_maps'], 'exclude' => \true, 'default' => '', 'inputType' => 'checkbox', 'sql' => "char(1) NOT NULL default ''"];
}
/***
 * Fields
 */
$GLOBALS['TL_DCA']['tl_module']['fields']['c4g_map_id'] = ['label' => &$GLOBALS['TL_LANG']['tl_module']['c4g_map_id'], 'exclude' => \true, 'inputType' => 'select', 'options_callback' => ['tl_module_c4g_maps', 'get_maps'], 'eval' => ['submitOnChange' => \true], 'sql' => "int(10) unsigned NOT NULL default '0'"];
$GLOBALS['TL_DCA']['tl_module']['fields']['c4g_map_width'] = ['label' => &$GLOBALS['TL_LANG']['tl_module']['c4g_map_width'], 'exclude' => \true, 'inputType' => 'inputUnit', 'options' => ['px', '%', 'em', 'vh', 'vw', 'vmin', 'vmax', 'pt', 'pc', 'in', 'cm', 'mm'], 'eval' => ['rgxp' => 'digit_auto_inherit', 'tl_class' => 'w50', 'includeBlankOption' => \true], 'sql' => "varchar(64) NOT NULL default ''"];
$GLOBALS['TL_DCA']['tl_module']['fields']['c4g_map_height'] = ['label' => &$GLOBALS['TL_LANG']['tl_module']['c4g_map_height'], 'exclude' => \true, 'inputType' => 'inputUnit', 'options' => ['px', '%', 'em', 'vh', 'vw', 'vmin', 'vmax', 'pt', 'pc', 'in', 'cm', 'mm'], 'eval' => ['rgxp' => 'digit_auto_inherit', 'tl_class' => 'w50', 'includeBlankOption' => \true], 'sql' => "varchar(64) NOT NULL default ''"];
$GLOBALS['TL_DCA']['tl_module']['fields']['c4g_map_zoom'] = ['label' => &$GLOBALS['TL_LANG']['tl_module']['c4g_map_zoom'], 'exclude' => \true, 'inputType' => 'text', 'eval' => ['mandatory' => \false, 'rgxp' => 'digit'], 'sql' => "int(10) unsigned NOT NULL default '0'"];
$GLOBALS['TL_DCA']['tl_module']['fields']['c4g_map_default_mapservice'] = ['label' => &$GLOBALS['TL_LANG']['tl_module']['c4g_map_default_mapservice'], 'exclude' => \true, 'inputType' => 'select', 'options_callback' => ['tl_module_c4g_maps', 'get_baselayers'], 'eval' => ['mandatory' => \false, 'chosen' => \true, 'includeBlankOption' => \true], 'sql' => "int(10) unsigned NOT NULL default '0'"];
/**
 * Class tl_module_c4g_maps
 */
class tl_module_c4g_maps extends \Backend
{
    protected $firstMapId = \null;
    /**
     * Return all base layers for current Map Profile as array
     * @param object
     * @return array
     */
    public function get_baselayers(\DataContainer $dc)
    {
        $id = 0;
        if ($dc->activeRecord->c4g_map_id != 0) {
            $id = $dc->activeRecord->c4g_map_id;
        } else {
            // take firstMapId, because it will be chosen as DEFAULT value for c4g_map_id
            $id = $this->firstMapId;
        }
        $profile = $this->Database->prepare("SELECT b.baselayers " . "FROM tl_c4g_maps a, tl_c4g_map_profiles b " . "WHERE a.id = ? and a.profile = b.id")->execute($id);
        $ids = \deserialize($profile->baselayers, \true);
        if (\count($ids) > 0) {
            $baseLayers = $this->Database->prepare("SELECT id,name FROM tl_c4g_map_baselayers WHERE id IN (" . \implode(',', $ids) . ") ORDER BY name")->execute();
        } else {
            $baseLayers = $this->Database->prepare("SELECT id,name FROM tl_c4g_map_baselayers ORDER BY name")->execute();
        }
        if ($baseLayers->numRows > 0) {
            while ($baseLayers->next()) {
                $return[$baseLayers->id] = $baseLayers->name;
            }
        }
        return $return;
    }
    /**
     * Return all defined maps
     * @param object
     * @return array
     */
    public function get_maps(\DataContainer $dc)
    {
        $maps = $this->Database->prepare("SELECT * FROM tl_c4g_maps WHERE is_map=1 AND published=1")->execute();
        if ($maps->numRows > 0) {
            while ($maps->next()) {
                if (!isset($this->firstMapId)) {
                    // save first map id
                    $this->firstMapId = $maps->id;
                }
                $return[$maps->id] = $maps->name;
            }
        }
        return $return;
    }
}
}

namespace {
/**
 * notification_center extension for Contao Open Source CMS
 *
 * @copyright  Copyright (c) 2008-2015, terminal42
 * @author     terminal42 gmbh <info@terminal42.ch>
 * @license    LGPL
 */
/**
 * Palettes
 */
$GLOBALS['TL_DCA']['tl_module']['palettes']['registration'] = \str_replace('reg_activate;', 'reg_activate,reg_jumpTo,nc_notification,nc_activation_notification;', $GLOBALS['TL_DCA']['tl_module']['palettes']['registration']);
// Move the "reg_jumpTo" field from the sub palette into the main palette. See #166
$GLOBALS['TL_DCA']['tl_module']['subpalettes']['reg_activate'] = \str_replace('reg_jumpTo,', '', $GLOBALS['TL_DCA']['tl_module']['subpalettes']['reg_activate']);
$GLOBALS['TL_DCA']['tl_module']['palettes']['lostPasswordNotificationCenter'] = \str_replace('reg_password', 'nc_notification', $GLOBALS['TL_DCA']['tl_module']['palettes']['lostPassword']);
$GLOBALS['TL_DCA']['tl_module']['palettes']['newsletterSubscribeNotificationCenter'] = '{title_legend},name,headline,type;{config_legend},nl_channels,nl_hideChannels,disableCaptcha;{text_legend},nl_text,{notification_legend},nc_notification;{redirect_legend},jumpTo;{template_legend:hide},nl_template;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID';
$GLOBALS['TL_DCA']['tl_module']['palettes']['newsletterActivateNotificationCenter'] = '{title_legend},name,headline,type;{notification_legend},nc_notification;{redirect_legend},jumpTo;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID';
$GLOBALS['TL_DCA']['tl_module']['palettes']['newsletterUnsubscribeNotificationCenter'] = '{title_legend},name,headline,type;{config_legend},nl_channels,nl_hideChannels,disableCaptcha;{notification_legend},nc_notification;{redirect_legend},jumpTo;{template_legend:hide},nl_template;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID';
if (\strpos($GLOBALS['TL_DCA']['tl_module']['palettes']['personalData'], 'newsletters')) {
    $GLOBALS['TL_DCA']['tl_module']['palettes']['personalData'] = \str_replace('newsletters;', 'newsletters,nc_notification;', $GLOBALS['TL_DCA']['tl_module']['palettes']['personalData']);
} else {
    $GLOBALS['TL_DCA']['tl_module']['palettes']['personalData'] = \str_replace('editable;', 'editable,nc_notification;', $GLOBALS['TL_DCA']['tl_module']['palettes']['personalData']);
}
/**
 * Fields
 */
$GLOBALS['TL_DCA']['tl_module']['fields']['nc_notification'] = array('label' => &$GLOBALS['TL_LANG']['tl_module']['nc_notification'], 'exclude' => \true, 'inputType' => 'select', 'options_callback' => array('NotificationCenter\\tl_module', 'getNotificationChoices'), 'eval' => array('includeBlankOption' => \true, 'chosen' => \true, 'tl_class' => 'w50'), 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type' => 'hasOne', 'load' => 'lazy', 'table' => 'tl_nc_notification'));
$GLOBALS['TL_DCA']['tl_module']['fields']['nc_activation_notification'] = $GLOBALS['TL_DCA']['tl_module']['fields']['nc_notification'];
$GLOBALS['TL_DCA']['tl_module']['fields']['nc_activation_notification']['label'] =& $GLOBALS['TL_LANG']['tl_module']['nc_activation_notification'];
/**
 * Notification choices
 */
$GLOBALS['TL_DCA']['tl_module']['fields']['nc_notification']['eval']['ncNotificationChoices']['registration'] = array('member_registration');
$GLOBALS['TL_DCA']['tl_module']['fields']['nc_notification']['eval']['ncNotificationChoices']['lostPasswordNotificationCenter'] = array('member_password');
$GLOBALS['TL_DCA']['tl_module']['fields']['nc_notification']['eval']['ncNotificationChoices']['newsletterSubscribeNotificationCenter'] = array('newsletter_subscribe');
$GLOBALS['TL_DCA']['tl_module']['fields']['nc_notification']['eval']['ncNotificationChoices']['newsletterActivateNotificationCenter'] = array('newsletter_activate');
$GLOBALS['TL_DCA']['tl_module']['fields']['nc_notification']['eval']['ncNotificationChoices']['newsletterUnsubscribeNotificationCenter'] = array('newsletter_unsubscribe');
$GLOBALS['TL_DCA']['tl_module']['fields']['nc_activation_notification']['eval']['ncNotificationChoices']['registration'] = array('member_activation');
}
