<?php

namespace {
$GLOBALS['TL_DCA']['tl_settings'] = array(
    // Config
    'config' => array('dataContainer' => \Contao\DC_File::class, 'closed' => \true),
    // Palettes
    'palettes' => array('default' => '{global_legend},adminEmail;{date_legend},dateFormat,timeFormat,datimFormat,timeZone;{backend_legend:hide},doNotCollapse,resultsPerPage,maxResultsPerPage;{security_legend:hide},disableRefererCheck,allowedTags,allowedAttributes;{files_legend:hide},allowedDownload,gdMaxImgWidth,gdMaxImgHeight;{uploads_legend:hide},uploadTypes,maxFileSize,imageWidth,imageHeight;{timeout_legend:hide},undoPeriod,versionPeriod,logPeriod;{cron_legend:hide},disableCron;{chmod_legend},defaultUser,defaultGroup,defaultChmod'),
    // Fields
    'fields' => array('dateFormat' => array('inputType' => 'text', 'eval' => array('mandatory' => \true, 'helpwizard' => \true, 'decodeEntities' => \true, 'tl_class' => 'w50'), 'explanation' => 'dateFormat'), 'timeFormat' => array('inputType' => 'text', 'eval' => array('mandatory' => \true, 'decodeEntities' => \true, 'tl_class' => 'w50')), 'datimFormat' => array('inputType' => 'text', 'eval' => array('mandatory' => \true, 'decodeEntities' => \true, 'tl_class' => 'w50')), 'timeZone' => array('inputType' => 'select', 'options_callback' => static function () {
        return \array_values(\DateTimeZone::listIdentifiers());
    }, 'eval' => array('chosen' => \true, 'tl_class' => 'w50')), 'adminEmail' => array('inputType' => 'text', 'eval' => array('mandatory' => \true, 'rgxp' => 'friendly', 'decodeEntities' => \true, 'tl_class' => 'w50')), 'disableCron' => array('inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50')), 'resultsPerPage' => array('inputType' => 'text', 'eval' => array('mandatory' => \true, 'rgxp' => 'natural', 'minval' => 1, 'nospace' => \true, 'tl_class' => 'w50 clr')), 'maxResultsPerPage' => array('inputType' => 'text', 'eval' => array('mandatory' => \true, 'rgxp' => 'natural', 'nospace' => \true, 'tl_class' => 'w50')), 'doNotCollapse' => array('inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50')), 'disableRefererCheck' => array('inputType' => 'checkbox'), 'allowedTags' => array('inputType' => 'text', 'eval' => array('useRawRequestData' => \true, 'tl_class' => 'long')), 'allowedAttributes' => array('label' => &$GLOBALS['TL_LANG']['tl_settings']['allowedAttributes'], 'inputType' => 'keyValueWizard', 'eval' => array('tl_class' => 'clr'), 'load_callback' => array(static function ($varValue) {
        $showWarning = \false;
        foreach (\Contao\StringUtil::deserialize($varValue, \true) as $row) {
            if (\in_array('*', \Contao\StringUtil::trimsplit(',', $row['value']), \true)) {
                $showWarning = \true;
                break;
            }
        }
        if ($showWarning) {
            $GLOBALS['TL_DCA']['tl_settings']['fields']['allowedAttributes']['label'][1] = '<span style="color: #c33;">' . $GLOBALS['TL_LANG']['tl_settings']['allowedAttributesWarning'] . '</span>';
        }
        return $varValue;
    }), 'save_callback' => array(static function ($strValue) {
        $arrValue = \Contao\StringUtil::deserialize($strValue, \true);
        $arrAllowedAttributes = array();
        foreach ($arrValue as $arrRow) {
            foreach (\Contao\StringUtil::trimsplit(',', \strtolower($arrRow['key'])) as $strKey) {
                $arrAllowedAttributes[$strKey] = \array_merge($arrAllowedAttributes[$strKey] ?? array(), \Contao\StringUtil::trimsplit(',', \strtolower($arrRow['value'])));
                $arrAllowedAttributes[$strKey] = \array_filter(\array_unique($arrAllowedAttributes[$strKey]));
                \sort($arrAllowedAttributes[$strKey]);
            }
        }
        \ksort($arrAllowedAttributes);
        $arrValue = array();
        foreach ($arrAllowedAttributes as $strTag => $arrAttributes) {
            $arrValue[] = array('key' => $strTag, 'value' => \implode(',', $arrAttributes));
        }
        return \serialize($arrValue);
    })), 'allowedDownload' => array('inputType' => 'text', 'eval' => array('tl_class' => 'w50')), 'gdMaxImgWidth' => array('inputType' => 'text', 'eval' => array('mandatory' => \true, 'rgxp' => 'natural', 'nospace' => \true, 'tl_class' => 'w50 clr')), 'gdMaxImgHeight' => array('inputType' => 'text', 'eval' => array('mandatory' => \true, 'rgxp' => 'natural', 'nospace' => \true, 'tl_class' => 'w50')), 'uploadTypes' => array('inputType' => 'text', 'eval' => array('tl_class' => 'w50')), 'maxFileSize' => array('inputType' => 'text', 'eval' => array('mandatory' => \true, 'rgxp' => 'natural', 'nospace' => \true, 'tl_class' => 'w50')), 'imageWidth' => array('inputType' => 'text', 'eval' => array('mandatory' => \true, 'rgxp' => 'natural', 'nospace' => \true, 'tl_class' => 'w50')), 'imageHeight' => array('inputType' => 'text', 'eval' => array('mandatory' => \true, 'rgxp' => 'natural', 'nospace' => \true, 'tl_class' => 'w50')), 'undoPeriod' => array('inputType' => 'text', 'eval' => array('mandatory' => \true, 'rgxp' => 'natural', 'nospace' => \true, 'tl_class' => 'w50')), 'versionPeriod' => array('inputType' => 'text', 'eval' => array('mandatory' => \true, 'rgxp' => 'natural', 'nospace' => \true, 'tl_class' => 'w50')), 'logPeriod' => array('inputType' => 'text', 'eval' => array('mandatory' => \true, 'rgxp' => 'natural', 'nospace' => \true, 'tl_class' => 'w50')), 'defaultUser' => array('inputType' => 'select', 'foreignKey' => 'tl_user.username', 'eval' => array('chosen' => \true, 'includeBlankOption' => \true, 'tl_class' => 'w50')), 'defaultGroup' => array('inputType' => 'select', 'foreignKey' => 'tl_user_group.name', 'eval' => array('chosen' => \true, 'includeBlankOption' => \true, 'tl_class' => 'w50')), 'defaultChmod' => array('inputType' => 'chmod', 'eval' => array('tl_class' => 'clr'))),
);
}

namespace {
$GLOBALS['TL_DCA']['tl_settings']['palettes']['default'] .= ';{tossn_captcha_legend},tc_captchaimage,tc_length,tc_fontsize,tc_chars,tc_bgimage,tc_font';
$GLOBALS['TL_DCA']['tl_settings']['fields']['tc_captchaimage'] = ['label' => &$GLOBALS['TL_LANG']['tl_settings']['tc_captchaimage'], 'inputType' => 'checkbox', 'eval' => ['tl_class' => 'clr']];
$GLOBALS['TL_DCA']['tl_settings']['fields']['tc_length'] = ['label' => &$GLOBALS['TL_LANG']['tl_settings']['tc_length'], 'default' => 5, 'inputType' => 'text', 'eval' => ['rgxp' => 'digit', 'tl_class' => 'clr']];
$GLOBALS['TL_DCA']['tl_settings']['fields']['tc_fontsize'] = ['label' => &$GLOBALS['TL_LANG']['tl_settings']['tc_fontsize'], 'default' => 30, 'inputType' => 'text', 'eval' => ['rgxp' => 'digit', 'tl_class' => 'clr']];
$GLOBALS['TL_DCA']['tl_settings']['fields']['tc_chars'] = ['label' => &$GLOBALS['TL_LANG']['tl_settings']['tc_chars'], 'inputType' => 'select', 'options' => ['num', 'alphalower', 'alphaupper', 'alpha', 'numalphalower', 'numalphaupper', 'numalpha'], 'reference' => &$GLOBALS['TL_LANG']['tl_settings']['tc_charslabel'], 'eval' => ['tl_class' => 'clr']];
$GLOBALS['TL_DCA']['tl_settings']['fields']['tc_bgimage'] = ['label' => &$GLOBALS['TL_LANG']['tl_settings']['tc_bgimage'], 'inputType' => 'fileTree', 'eval' => ['files' => \true, 'filesOnly' => \true, 'extensions' => 'jpg,png,gif', 'fieldType' => 'radio', 'tl_class' => 'clr']];
$GLOBALS['TL_DCA']['tl_settings']['fields']['tc_font'] = ['label' => &$GLOBALS['TL_LANG']['tl_settings']['tc_font'], 'inputType' => 'fileTree', 'eval' => ['files' => \true, 'filesOnly' => \true, 'extensions' => 'ttf', 'fieldType' => 'radio', 'tl_class' => 'clr']];
}
