<?php

/**
 * Tweaks for Contao
 *
 * Copyright (c) 2016 Benjamin Roth [http://www.esales-media.de]
 *
 * @package eSM_tweaks
 * @link    http://www.esales-media.de
 * @license commercial
 */
//$GLOBALS['TL_DCA']['tl_iso_product']['config']['onsubmit_callback'][] = array('eSM_isotope_custom\tl_iso_product','generateSearchKeywords');
$GLOBALS['TL_DCA']['tl_iso_product']['palettes']['__selector__'][] = 'not_buyable';
$GLOBALS['TL_DCA']['tl_iso_product']['subpalettes']['not_buyable'] = 'not_buyable_text';

$GLOBALS['TL_DCA']['tl_iso_product']['fields']['attr_monthyear'] = array
(
    'exclude'               => true,
    'inputType'             => 'select',
    'eval'                  => array('mandatory'=>false, 'tl_class'=>'w50','disabled'=>true,'includeBlankOption'=>true),
    'attributes'            => array(
        'legend' => 'options_legend',
        'fe_filter'=>true,
        'fixed'=>true,
        'variant_fixed'=>true,
        'systemColumn'=>true,
//        'type' => 'select',
        'optionsSource' => 'foreignKey',
        'foreignKey' => 'tl_iso_product_month.month',
    ),
    'foreignKey'            => 'tl_iso_product_month.month',
    'sql'                   => "int(10) NOT NULL default 0"
);

/*$GLOBALS['TL_DCA']['tl_iso_product']['fields']['search_keywords'] = array
(
    'label'                 => &$GLOBALS['TL_LANG']['tl_iso_product']['search_keywords'],
    'exclude'               => true,
    'inputType'             => 'text',
    'eval'                  => array('mandatory'=>false, 'tl_class'=>'w50','readonly'=>true),
    'attributes'            => array('legend'=>'meta_legend', 'fe_search'=>true, 'fixed'=>true, 'variant_fixed'=>true, 'systemColumn'=>true),
    'sql'                   => "varchar(1055) NOT NULL default ''"
);*/

$GLOBALS['TL_DCA']['tl_iso_product']['fields']['not_buyable'] = array
(
    'label'                 => &$GLOBALS['TL_LANG']['tl_iso_product']['not_buyable'],
    'exclude'               => true,
    'filter'                => true,
    'inputType'             => 'checkbox',
    'eval'                  => array('tl_class'=>'w50 m12 clr','submitOnChange'=>true),
    'attributes'            => array('legend'=>'publish_legend', 'fixed'=>true, 'variant_fixed'=>true, 'systemColumn'=>true),
    'sql'                   => "char(1) NOT NULL default ''",
);

$GLOBALS['TL_DCA']['tl_iso_product']['fields']['not_buyable_text'] = array
(
    'label'                 => &$GLOBALS['TL_LANG']['tl_iso_product']['not_buyable_text'],
    'exclude'               => true,
    'inputType'             => 'text',
    'eval'                  => array('maxlength'=>255,'tl_class'=>'w50'),
    'sql'                   => "varchar(255) NOT NULL default ''",
);
