<?php

/**
 * Pagelist for Contao
 *
 * Copyright (c) 2015 Benjamin Roth
 *
 * @license LGPL-3.0+
 */

/**
 * Palettes
 */
$GLOBALS['TL_DCA']['tl_page']['palettes']['regular'] = str_replace('{meta_legend}', '{teaser_legend},teaserCssID,teaser,teaserSRC,teaserSize;{meta_legend}',$GLOBALS['TL_DCA']['tl_page']['palettes']['regular']);


/**
 * Fields
 */
$GLOBALS['TL_DCA']['tl_page']['fields']['teaserSRC'] = array
(
    'label'                   => &$GLOBALS['TL_LANG']['tl_page']['teaserSRC'],
    'exclude'                 => true,
    'inputType'               => 'fileTree',
    'eval'                    => array('fieldType'=>'radio', 'multiple'=>false, 'files'=>true, 'filesOnly'=>true, 'extensions'=>'jpg,gif,png,jpeg'),
    'sql'                     => 'binary(16) NULL'
);

$GLOBALS['TL_DCA']['tl_page']['fields']['teaserSize'] = array
(
    'label'                   => &$GLOBALS['TL_LANG']['tl_page']['teaserSize'],
    'exclude'                 => true,
    'inputType'               => 'imageSize',
    'options'                 => System::getImageSizes(),
    'reference'               => &$GLOBALS['TL_LANG']['MSC'],
    'eval'                    => array('rgxp'=>'natural', 'includeBlankOption'=>true, 'nospace'=>true, 'helpwizard'=>true),
    'sql'                     => "varchar(64) NOT NULL default ''"
);

$GLOBALS['TL_DCA']['tl_page']['fields']['teaserCssID'] = array
(
  'label'                   => &$GLOBALS['TL_LANG']['tl_page']['teaserCssID'],
  'exclude'                 => true,
  'inputType'               => 'text',
  'eval'                    => array('multiple'=>true, 'size'=>2),
  'sql'                     => "varchar(255) NOT NULL default ''"
);

$GLOBALS['TL_DCA']['tl_page']['fields']['teaser'] = array
(
  'label'                   => &$GLOBALS['TL_LANG']['tl_page']['teaser'],
  'exclude'                 => true,
  'inputType'               => 'textarea',
  'search'                  => true,
  'eval'                    => array('rte'=>'tinyMCE', 'tl_class'=>'clr'),
  'sql'                     => "text NULL"
);