<?php

/**
 * @package    contao-form-validation
 * @author     David Molineus <*****@*****.**>
 * @copyright  2015-2016 netzmacht David Molineus
 * @license    LGPL 3.0
 * @filesource
 *
 */
$GLOBALS['TL_DCA']['tl_form_validation'] = array('config' => array('dataContainer' => 'Table', 'enableVersioning' => true, 'onload_callback' => array(\Netzmacht\Contao\FormValidation\Dca\ValidationCallbacks::callback('initializeView')), 'onsubmit_callback' => array(\Netzmacht\Contao\FormValidation\Dca\ValidationCallbacks::callback('clearCache')), 'sql' => array('keys' => array('id' => 'primary'))), 'list' => array('sorting' => array('mode' => 1, 'fields' => array('title'), 'flag' => 1, 'panelLayout' => 'limit', 'headerFields' => array('title', 'type')), 'label' => array('fields' => array('title', 'type'), 'format' => '%s <span class="tl_gray">[%s]</span>'), 'global_operations' => array('form' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['form'], 'href' => 'table=tl_form', 'icon' => 'form.gif', 'attributes' => 'onclick="Backend.getScrollOffset();"'), 'all' => array('label' => &$GLOBALS['TL_LANG']['MSC']['all'], 'href' => 'act=select', 'class' => 'header_edit_all', 'attributes' => 'onclick="Backend.getScrollOffset();" accesskey="e"')), 'operations' => array('edit' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['edit'], 'href' => 'act=edit', 'icon' => 'edit.gif'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['show'], 'href' => 'act=show', 'icon' => 'show.gif'))), 'metapalettes' => array('default' => array('title' => array('title', 'framework', 'message'), 'config' => array('live', 'threshold', 'autofocus', 'verbose'), 'icon' => array('icon_valid', 'icon_invalid', 'icon_validating'), 'selector' => array('button_selector', 'button_disabled', 'error_class', 'error_container', 'excluded'))), 'metasubpalettes' => array('autoPan' => array('autoPanPadding')), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'title' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['title'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'framework' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['framework'], 'inputType' => 'select', 'exclude' => true, 'options_callback' => \Netzmacht\Contao\FormValidation\Dca\FormCallbacks::callback('getFrameworks'), 'eval' => array('tl_class' => 'w50', 'includeBlankOption' => true), 'sql' => "varchar(128) NOT NULL default ''"), 'live' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['live'], 'inputType' => 'select', 'exclude' => true, 'options' => array('enabled', 'disabled', 'submitted'), 'default' => 'enabled', 'eval' => array('tl_class' => 'w50', 'choosen' => true), 'sql' => "varchar(10) NOT NULL default ''"), 'autofocus' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['autofocus'], 'inputType' => 'checkbox', 'exclude' => true, 'default' => true, 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'message' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['message'], 'inputType' => 'text', 'exclude' => true, 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(128) NOT NULL default ''"), 'threshold' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['threshold'], 'inputType' => 'text', 'exclude' => true, 'eval' => array('tl_class' => 'w50', 'rxgp' => 'digit', 'nullIfEmpty' => true), 'sql' => "int(3) NULL"), 'verbose' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['verbose'], 'inputType' => 'checkbox', 'exclude' => true, 'default' => true, 'eval' => array('tl_class' => 'w50'), 'sql' => "char(1) NOT NULL default ''"), 'button_selector' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['button_selector'], 'inputType' => 'text', 'exclude' => true, 'eval' => array('tl_class' => 'w50', 'decodeEntities' => true), 'sql' => "varchar(128) NOT NULL default ''"), 'button_disabled' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['button_disabled'], 'inputType' => 'text', 'exclude' => true, 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(128) NOT NULL default ''"), 'icon_valid' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['icon_valid'], 'inputType' => 'text', 'exclude' => true, 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(128) NOT NULL default ''"), 'icon_invalid' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['icon_invalid'], 'inputType' => 'text', 'exclude' => true, 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(128) NOT NULL default ''"), 'icon_validating' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['icon_validating'], 'inputType' => 'text', 'exclude' => true, 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(128) NOT NULL default ''"), 'error_class' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['error_class'], 'inputType' => 'text', 'exclude' => true, 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(128) NOT NULL default ''"), 'error_container' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['error_container'], 'inputType' => 'text', 'exclude' => true, 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(128) NOT NULL default ''"), 'excluded' => array('label' => &$GLOBALS['TL_LANG']['tl_form_validation']['excluded'], 'inputType' => 'multiColumnWizard', 'exclude' => true, 'eval' => array('tl_class' => 'clr', 'columnFields' => array('exclude' => array('inputType' => 'text', 'exclude' => true, 'eval' => array('style' => 'width: 300px'), 'sql' => "varchar(128) NOT NULL default ''")), 'flatArray' => true), 'sql' => "mediumblob NULL")));
<?php

/**
 * @package    contao-form-validation
 * @author     David Molineus <*****@*****.**>
 * @copyright  2015-2016 netzmacht David Molineus
 * @license    LGPL 3.0
 * @filesource
 *
 */
/*
 * Config
 */
$GLOBALS['TL_DCA']['tl_form']['config']['onsubmit_callback'][] = \Netzmacht\Contao\FormValidation\Dca\FormCallbacks::callback('clearCache');
$GLOBALS['TL_DCA']['tl_form']['config']['ondelete_callback'][] = \Netzmacht\Contao\FormValidation\Dca\FormCallbacks::callback('clearCache');
/*
 * Global operations.
 */
array_insert($GLOBALS['TL_DCA']['tl_form']['list']['global_operations'], 0, array('formvalidation' => array('label' => &$GLOBALS['TL_LANG']['tl_form']['formvalidation'], 'href' => 'table=tl_form_validation', 'icon' => 'form.gif', 'attributes' => 'onclick="Backend.getScrollOffset();"')));
/*
 * Palettes
 */
\Bit3\Contao\MetaPalettes\MetaPalettes::appendBefore('tl_form', 'expert', array('formvalidation' => array(':hide', 'fv_active')));
$GLOBALS['TL_DCA']['tl_form']['metasubpalettes']['fv_active'] = array('fv_setting');
/*
 * Fields
 */
$GLOBALS['TL_DCA']['tl_form']['fields']['fv_active'] = array('label' => &$GLOBALS['TL_LANG']['tl_form']['fv_active'], 'inputType' => 'checkbox', 'exclude' => true, 'eval' => array('tl_class' => 'w50 m12', 'submitOnChange' => true), 'sql' => "char(1) NOT NULL default ''");
$GLOBALS['TL_DCA']['tl_form']['fields']['fv_setting'] = array('label' => &$GLOBALS['TL_LANG']['tl_form']['fv_setting'], 'inputType' => 'select', 'exclude' => true, 'options_callback' => \Netzmacht\Contao\FormValidation\Dca\FormCallbacks::callback('getSettings'), 'save_callback' => array(\Netzmacht\Contao\FormValidation\Dca\FormCallbacks::callback('addIncompleteWarning')), 'wizard' => array(\Netzmacht\Contao\Toolkit\Dca\Callback\CallbackFactory::popupWizard('do=form&amp;table=tl_form_validation', $GLOBALS['TL_LANG']['tl_form']['fv_edit_setting'][0], $GLOBALS['TL_LANG']['tl_form']['fv_edit_setting'][1], 'edit.gif')), 'eval' => array('includeBlankOption' => true, 'chosen' => true, 'tl_class' => 'w50'), 'sql' => "int(10) NOT NULL default '0'");