system/modules/pct_revolutionslider/dca/tl_revolutionslider_slides.php line 254

Open in your IDE?
  1. <?php
  2. /**
  3.  * Contao Open Source CMS
  4.  * 
  5.  * Copyright (C) 2005-2013 Leo Feyer
  6.  * 
  7.  * @copyright    Tim Gatzky 2013, Premium Contao Webworks, Premium Contao Themes
  8.  * @author        Tim Gatzky <info@tim-gatzky.de>
  9.  * @package        revolutionslider
  10.  * @link        http://contao.org
  11.  */
  12. /**
  13.  * Load language file
  14.  */
  15. \Contao\System::loadLanguageFile('tl_module');
  16. \Contao\System::loadLanguageFile('tl_content');
  17. \Contao\System::loadLanguageFile('tl_revolutionslider');
  18. /**
  19.  * Table tl_revolutionslider_slides
  20.  */
  21. $GLOBALS['TL_DCA']['tl_revolutionslider_slides'] = array
  22. (
  23.     // Config
  24.     'config' => array
  25.     (
  26.         'dataContainer'               => 'Table',
  27.         'ptable'                      => 'tl_revolutionslider',
  28.         'ctable'                      => array('tl_content'),
  29.         'switchToEdit'                => true,
  30.         'enableVersioning'            => true,
  31.         'onload_callback'            => array
  32.         (
  33.             array('RevolutionSlider\Backend\TableRevolutionSliderSlides''modifyDCA'),
  34.             array('RevolutionSlider\Backend\TableRevolutionSliderSlides''loadStyles'),
  35.             array('RevolutionSlider\Backend\TableRevolutionSliderSlides''checkPermission'),
  36.         ),
  37.         'sql' => array
  38.         (
  39.             'keys' => array
  40.             (
  41.                 'id' => 'primary',
  42.                 'pid' => 'index',
  43.             )
  44.         )
  45.     ),
  46.     // List
  47.     'list' => array
  48.     (
  49.         'sorting' => array
  50.         (
  51.             'mode'                    => 4,
  52.             'fields'                  => array('sorting'),
  53.             'headerFields'            => array('title'),
  54.             'panelLayout'             => 'search,limit',
  55.             'child_record_callback'   => array('RevolutionSlider\Backend\TableRevolutionSliderSlides''listSlides'),
  56.         ),
  57.         'label' => array
  58.         (
  59.             'fields'                  => array('title'),
  60.             'format'                  => '%s'
  61.         ),
  62.         'global_operations' => array
  63.         (
  64.             'all' => array
  65.             (
  66.                 'label'               => &$GLOBALS['TL_LANG']['MSC']['all'],
  67.                 'href'                => 'act=select',
  68.                 'class'               => 'header_edit_all',
  69.                 'attributes'          => 'onclick="Backend.getScrollOffset()" accesskey="e"'
  70.             ),
  71.         ),
  72.         'operations' => array
  73.         (
  74.             'edit' => array
  75.             (
  76.                 'label'               => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['edit'],
  77.                 'href'                => 'table=tl_content&mode=2',
  78.                 'icon'                => 'edit.gif',
  79.                 #'button_callback'     => array('TableRevolutionSliderSlides', 'edit'),
  80.             ),
  81.             'editheader' => array
  82.             (
  83.                'label'               => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['editheader'],
  84.                'href'                => 'act=edit',
  85.                'icon'                => REVOLUTIONSLIDER_PATH.'/assets/img/header.gif',
  86.                'button_callback'     => array('RevolutionSlider\Backend\TableRevolutionSliderSlides''editHeader'),
  87.             ),
  88.             'copy' => array
  89.             (
  90.                 'label'               => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['copy'],
  91.                 'href'                => 'act=paste&amp;mode=copy',
  92.                 'icon'                => 'copy.gif',
  93.                 'button_callback'     => array('RevolutionSlider\Backend\TableRevolutionSliderSlides''copyButton'),
  94.             ),
  95.             'cut' => array
  96.             (
  97.                 'label'               => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['cut'],
  98.                 'href'                => 'act=paste&amp;mode=cut',
  99.                 'icon'                => 'cut.gif',
  100.                 'button_callback'     => array('RevolutionSlider\Backend\TableRevolutionSliderSlides''cutButton'),
  101.             ),
  102.             'delete' => array
  103.             (
  104.                 'label'               => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['delete'],
  105.                 'href'                => 'act=delete',
  106.                 'icon'                => 'delete.gif',
  107.                 'attributes'          => 'onclick="if(!confirm(\'' $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"',
  108.                 'button_callback'     => array('RevolutionSlider\Backend\TableRevolutionSliderSlides''deleteButton'),
  109.             ),
  110.             'toggle' => array
  111.             (
  112.                 'label'               => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['toggle'],
  113.                 'icon'                => 'visible.gif',
  114.                 'attributes'          => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
  115.                 'button_callback'     => array('RevolutionSlider\Backend\TableRevolutionSliderSlides''toggleIcon')
  116.             ),
  117.             'show' => array
  118.             (
  119.                 'label'               => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['show'],
  120.                 'href'                => 'act=show',
  121.                 'icon'                => 'show.gif'
  122.             ),
  123.         )
  124.     ),
  125.     
  126.     // Palettes
  127.     'palettes' => array
  128.     (
  129.         '__selector__'                => array('background','kenburns'),
  130.         'default'                   => '{title_legend},title,subtitle;{settings_legend},transition,slideUrl,newWindow;{background_legend:hide},background;{expert_settings_legend:hide},masterspeed,delay,singleSRC_thumb,lazyload;{expert_legend},cssID,published;',
  131.         'image'                        => '{title_legend},title,subtitle;{settings_legend},transition,slideUrl,newWindow;{background_legend:hide},background,singleSRC,size,data_bgfit,data_bgposition,data_bgrepeat,lazyload,kenburns;{expert_settings_legend:hide},masterspeed,delay,singleSRC_thumb;{expert_legend},cssID,published;',
  132.         'colored'                    => '{title_legend},title,subtitle;{settings_legend},transition,slideUrl,newWindow;{background_legend:hide},background,data_bgcolor;{expert_settings_legend:hide},masterspeed,delay,singleSRC_thumb;{expert_legend},cssID,published;',
  133.         'videomp4'                    => '{title_legend},title,subtitle;{settings_legend},transition,slideUrl,newWindow;{background_legend:hide},background;{video_source_legend:hide},videoSRC,singleSRC;{video_settings_legend:hide},loop,nextslideatend;{expert_settings_legend:hide},masterspeed,delay,singleSRC_thumb;{expert_legend},cssID,published;',
  134.         'external'                    => '{title_legend},title,subtitle;{settings_legend},transition,slideUrl,newWindow;{background_legend:hide},background;{video_source_legend:hide},videoURL,singleSRC;{video_settings_legend:hide},loop,nextslideatend;{expert_settings_legend:hide},masterspeed,delay,singleSRC_thumb;{expert_legend},cssID,published;'
  135.     ),
  136.     // Subpalettes
  137.     'subpalettes' => array
  138.     (
  139.         'kenburns'                     => 'data_duration,data_ease,data_bgposition_OUT,data_bgscale',
  140.     ),
  141.     // Fields
  142.     'fields' => array
  143.     (
  144.         'id' => array
  145.         (
  146.             'sql'                     => "int(10) unsigned NOT NULL auto_increment",
  147.         ),
  148.         'pid' => array
  149.         (
  150.             'sql'                     => "int(10) unsigned NOT NULL default '0'",
  151.         ),
  152.         'sorting' => array
  153.         (
  154.             'sql'                     => "int(10) unsigned NOT NULL default '0'",
  155.         ),
  156.         'tstamp' => array
  157.         (
  158.             'sql'                     => "int(10) unsigned NOT NULL default '0'",
  159.         ),
  160.         'title' => array
  161.         (
  162.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['title'],
  163.             'exclude'                 => true,
  164.             'search'                  => true,
  165.             'inputType'               => 'text',
  166.             'eval'                    => array('mandatory'=>true'maxlength'=>255'tl_class'=>'w50'),
  167.             'sql'                      => "varchar(255) NOT NULL default ''",
  168.         ),
  169.         'subtitle' => array
  170.         (
  171.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['subtitle'],
  172.             'exclude'                 => true,
  173.             'search'                  => true,
  174.             'inputType'               => 'text',
  175.             'eval'                    => array('decodeEntities'=>true'tl_class'=>'w50'),
  176.             'sql'                      => "tinytext NULL",
  177.         ),
  178.         'transition' => array
  179.         (
  180.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['transition'],
  181.             'exclude'                 => true,
  182.             'inputType'               => 'select',
  183.             'default'                  => 'fade',
  184.             'options_callback'          => array('RevolutionSlider\Core\RevolutionSlider''getTransitions'),
  185.             'reference'                  => &$GLOBALS['TL_LANG']['revolutionSliderTransitionsClasses'],
  186.             'eval'                    => array('includeBlankOption'=>true,'tl_class'=>'w50','chosen'=>true),
  187.             'sql'                      => "varchar(64) NOT NULL default ''",
  188.         ),
  189.         'slideUrl' => array
  190.         (
  191.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['slideUrl'],
  192.             'exclude'                 => true,
  193.             'inputType'               => 'text',
  194.             'eval'                    => array('rgxp'=>'url''dcaPicker'=>true'decodeEntities'=>true'maxlength'=>255,'tl_class'=>'clr w50 wizard'),
  195.             'sql'                      => "varchar(255) NOT NULL default ''",
  196.         ),
  197.         'newWindow' => array
  198.         (
  199.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['newWindow'],
  200.             'exclude'                 => true,
  201.             'inputType'               => 'checkbox',
  202.             'eval'                    => array('tl_class'=>'w50 m12'),
  203.             'sql'                      => "char(1) NOT NULL default ''",
  204.         ),
  205.         'masterspeed' => array
  206.         (
  207.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['masterspeed'],
  208.             'exclude'                 => true,
  209.             'inputType'               => 'text',
  210.             'default'                  => '0.03',
  211.             'eval'                    => array('tl_class'=>'clr w50'),
  212.             'sql'                      => "varchar(16) NOT NULL default ''",
  213.         ),
  214.         'delay' => array
  215.         (
  216.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['delay'],
  217.             'exclude'                 => true,
  218.             'inputType'               => 'text',
  219.             'eval'                    => array('tl_class'=>'w50'),
  220.             'sql'                      => "varchar(10) NOT NULL default ''",
  221.         ),
  222.         'lazyload' => array
  223.         (
  224.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['lazyload'],
  225.             'exclude'                 => true,
  226.             'inputType'               => 'checkbox',
  227.             'eval'                    => array('tl_class'=>'m12 w50'),
  228.             'sql'                      => "char(1) NOT NULL default ''",
  229.         ),
  230.         'singleSRC_thumb' => array
  231.         (
  232.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['singleSRC_thumb'],
  233.             'exclude'                 => true,
  234.             'inputType'               => 'fileTree',
  235.             'eval'                    => array('fieldType'=>'radio''files'=>true'tl_class'=>'clr w50'),
  236.             'sql'                      =>  "binary(16) NULL",
  237.         ),
  238.         'singleSRC' => array
  239.         (
  240.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['singleSRC'],
  241.             'exclude'                 => true,
  242.             'inputType'               => 'fileTree',
  243.             'eval'                    => array('mandatory'=>true'fieldType'=>'radio''files'=>true'filesOnly'=>true'tl_class'=>'clr'),
  244.             'sql'                      => "binary(16) NULL",
  245.         ),
  246.         'size' => array
  247.         (
  248.             'label'                   => &$GLOBALS['TL_LANG']['tl_content']['size'],
  249.             'exclude'                 => true,
  250.             'inputType'               => 'imageSize',
  251.             'options'                  => \Contao\System::getImageSizes(),
  252.             'reference'               => &$GLOBALS['TL_LANG']['MSC'],
  253.             'eval'                    => array('tl_class'=>'clr w50','rgxp'=>'natural''includeBlankOption'=>true'nospace'=>true'helpwizard'=>true,),
  254.             'sql'                     => "varchar(64) NOT NULL default ''"
  255.         ),
  256.         'background' => array
  257.         (
  258.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['background'],
  259.             'exclude'                 => true,
  260.             'inputType'               => 'select',
  261.             'options'                    => array('image','colored','transparent','videomp4','external'),
  262.             'default'                  => 'image',
  263.             'reference'                  => $GLOBALS['TL_LANG']['tl_revolutionslider_slides']['background'],
  264.             'eval'                    => array('tl_class'=>'clr w50','chosen'=>true,'submitOnChange'=>true,'mandatory'=>true),
  265.             'sql'                      => "varchar(16) NOT NULL default ''",
  266.         ),
  267.         'data_bgfit' => array
  268.         (
  269.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['data_bgfit'],
  270.             'exclude'                 => true,
  271.             'inputType'               => 'select',
  272.             'options'                    => array('cover','contain','normal'),
  273.             'eval'                    => array('tl_class'=>'clr w50','chosen'=>true),
  274.             'sql'                      => "varchar(16) NOT NULL default ''",    
  275.         ),
  276.         'data_bgposition' => array
  277.         (
  278.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['data_bgposition'],
  279.             'exclude'                 => true,
  280.             'inputType'               => 'select',
  281.             'options'                    => array('left top','center top','right top','left center','center center','right center','left bottom','center bottom','right bottom'),
  282.             'eval'                    => array('tl_class'=>'w50','chosen'=>true),
  283.             'reference'                  => $GLOBALS['TL_LANG']['tl_revolutionslider_slides']['data_bgposition'],
  284.             'sql'                      => "varchar(16) NOT NULL default ''",    
  285.         ),
  286.         'data_bgrepeat' => array
  287.         (
  288.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['data_bgrepeat'],
  289.             'exclude'                 => true,
  290.             'inputType'               => 'checkbox',
  291.             'eval'                    => array('tl_class'=>'m12 w50'),
  292.             'sql'                      => "char(1) NOT NULL default ''",    
  293.         ),
  294.         'data_bgcolor' => array
  295.         (
  296.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['data_bgcolor'],
  297.             'exclude'                 => true,
  298.             'inputType'               => 'text',
  299.             'eval'                    => array('maxlength'=>6'colorpicker'=>true'isHexColor'=>true'decodeEntities'=>true'tl_class'=>'w50 wizard'),
  300.             'sql'                      => "varchar(64) NOT NULL default ''",    
  301.         ),
  302.         'kenburns' => array
  303.         (
  304.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['kenburns'],
  305.             'exclude'                 => true,
  306.             'inputType'               => 'checkbox',
  307.             'eval'                    => array('tl_class'=>'clr w50','submitOnChange'=>true),
  308.             'sql'                      => "char(1) NOT NULL default ''",    
  309.         ),
  310.         'data_duration' => array
  311.         (
  312.             'label'                   => &$GLOBALS['TL_LANG']['tl_content']['revolutionslider_data_speed'],
  313.             'exclude'                 => true,
  314.             'inputType'               => 'text',
  315.             'eval'                    => array('tl_class'=>'w50 clr','rgxp'=>'digit'),
  316.             'sql'                      => "int(10) NOT NULL default '0'",    
  317.         ),
  318.         'data_bgposition_OUT' => array
  319.         (
  320.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['data_bgposition_OUT'],
  321.             'exclude'                 => true,
  322.             'inputType'               => 'select',
  323.             'options'                    => array('left top','center top','right top','left center','center center','right center','left bottom','center bottom','right bottom'),
  324.             'eval'                    => array('tl_class'=>'w50','chosen'=>true),
  325.             'reference'                  => $GLOBALS['TL_LANG']['tl_revolutionslider_slides']['data_bgposition'],
  326.             'sql'                      => "varchar(16) NOT NULL default ''",    
  327.         ),
  328.         'data_bgscale' => array
  329.         (
  330.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['data_scale'],
  331.             'exclude'                 => true,
  332.             'inputType'               => 'text',
  333.             'eval'                    => array('multiple'=>true'size'=>2'tl_class'=>'w50','rgxp'=>'digit'),
  334.             'sql'                      => "varchar(255) NOT NULL default ''",
  335.         ),
  336.         'data_ease' => array
  337.         (
  338.             'label'                   => &$GLOBALS['TL_LANG']['tl_content']['revolutionslider_data_easing'],
  339.             'exclude'                 => true,
  340.             'inputType'               => 'select',
  341.             'options_callback'          => array('RevolutionSlider\Core\RevolutionSlider','getTransitionEasings'),
  342.             'eval'                    => array('tl_class'=>'w50','chosen'=>true),
  343.             'sql'                      => "varchar(64) NOT NULL default ''",
  344.         ),
  345.         
  346.         'cssID' => array
  347.         (
  348.             'label'                   => &$GLOBALS['TL_LANG']['tl_module']['cssID'],
  349.             'exclude'                 => true,
  350.             'inputType'               => 'text',
  351.             'eval'                    => array('multiple'=>true'size'=>2'tl_class'=>'w50'),
  352.             'sql'                      => "varchar(255) NOT NULL default ''",
  353.         ),
  354.         'published' => array
  355.         (
  356.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['published'],
  357.             'exclude'                 => true,
  358.             'filter'                  => true,
  359.             'flag'                    => 1,
  360.             'inputType'               => 'checkbox',
  361.             'eval'                    => array('tl_class'=>'clr','doNotCopy'=>true),
  362.             'sql'                     => "char(1) NOT NULL default ''"
  363.         ),
  364.         // video
  365.         'videoSRC' => array
  366.         (
  367.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['videoSRC'],
  368.             'exclude'                 => true,
  369.             'inputType'               => 'fileTree',
  370.             'eval'                    => array('mandatory'=>true,'extensions'=>'mp4''fieldType'=>'radio''files'=>true'filesOnly'=>true'tl_class'=>'clr'),
  371.             'sql'                      => "binary(16) NULL",
  372.         ),
  373.         'videoURL' => array
  374.         (
  375.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['videoURL'],
  376.             'exclude'                 => true,
  377.             'search'                  => true,
  378.             'inputType'               => 'text',
  379.             'eval'                    => array('mandatory'=>true'rgxp'=>'url''decodeEntities'=>true'maxlength'=>255'addWizardClass'=>false'tl_class'=>'long'),
  380.             'sql'                     => "varchar(255) NOT NULL default ''"
  381.         ),
  382.         'loop' => array
  383.         (
  384.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['loop'],
  385.             'exclude'                 => true,
  386.             'inputType'               => 'checkbox',
  387.             'eval'                    => array('tl_class'=>'w50'),
  388.             'sql'                      => "char(1) NOT NULL default ''",
  389.         ),
  390.         'nextslideatend' => array
  391.         (
  392.             'label'                   => &$GLOBALS['TL_LANG']['tl_revolutionslider_slides']['nextslideatend'],
  393.             'exclude'                 => true,
  394.             'inputType'               => 'checkbox',
  395.             'default'                  => 1,
  396.             'eval'                    => array('tl_class'=>'w50'),
  397.             'sql'                      => "char(1) NOT NULL default ''",
  398.         )
  399.     )
  400. );