src/Rhyme/WMassArtsHub/Resources/contao/dca/tl_artshub_submission_funding.php line 244

Open in your IDE?
  1. <?php
  2. /**
  3.  * Copyright (c) 2020 Rhyme Digital LLC (https://rhyme.digital)
  4.  *
  5.  * @license LGPL-3.0-or-later
  6.  */
  7. namespace {
  8.     use Rhyme\WMassArtsHub\Backend\SubmissionFunding\Callbacks;
  9.     use Contao\System;
  10.     System::loadLanguageFile('default');
  11.     /**
  12.      * Table tl_artshub_submission_funding
  13.      */
  14.     $GLOBALS['TL_DCA']['tl_artshub_submission_funding'] = array
  15.     (
  16.         // Config
  17.         'config' => array
  18.         (
  19.             'dataContainer'               => 'Table',
  20.             'enableVersioning'            => true,
  21.             'sql' => array
  22.             (
  23.                 'keys' => array
  24.                 (
  25.                     'id' => 'primary',
  26.                 )
  27.             )
  28.         ),
  29.         // List
  30.         'list' => array
  31.         (
  32.             'sorting' => array
  33.             (
  34.                 'mode'                    => 2,
  35.                 'flag'                    => 2,
  36.                 'fields'                  => ['title'],
  37.                 'panelLayout'             => 'sort,filter;search,limit'
  38.             ),
  39.             'label' => array
  40.             (
  41.                 'fields'                  => array('title'),
  42.                 'format'                  => '%s'
  43.             ),
  44.             'global_operations' => array
  45.             (
  46.                 'all' => array
  47.                 (
  48.                     'label'               => &$GLOBALS['TL_LANG']['MSC']['all'],
  49.                     'href'                => 'act=select',
  50.                     'class'               => 'header_edit_all',
  51.                     'attributes'          => 'onclick="Backend.getScrollOffset()" accesskey="e"'
  52.                 )
  53.             ),
  54.             'operations' => array
  55.             (
  56.                 'edit' => array
  57.                 (
  58.                     'label'               => &$GLOBALS['TL_LANG']['tl_artshub_submission_funding']['edit'],
  59.                     'href'                => 'act=edit',
  60.                     'icon'                => 'edit.gif'
  61.                 ),
  62.                 'copy' => array
  63.                 (
  64.                     'label'               => &$GLOBALS['TL_LANG']['tl_artshub_submission_funding']['copy'],
  65.                     'href'                => 'act=copy',
  66.                     'icon'                => 'copy.gif',
  67.                 ),
  68.                 'cut' => array
  69.                 (
  70.                     'label'               => &$GLOBALS['TL_LANG']['tl_page']['cut'],
  71.                     'href'                => 'act=paste&amp;mode=cut',
  72.                     'icon'                => 'cut.svg',
  73.                     'attributes'          => 'onclick="Backend.getScrollOffset()"',
  74.                 ),
  75.                 'delete' => array
  76.                 (
  77.                     'label'               => &$GLOBALS['TL_LANG']['tl_artshub_submission_funding']['delete'],
  78.                     'href'                => 'act=delete',
  79.                     'icon'                => 'delete.gif',
  80.                     'attributes'          => 'onclick="if(!confirm(\'' $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"',
  81.                 ),
  82.                 'toggle' => array
  83.                 (
  84.                     'label'               => &$GLOBALS['TL_LANG']['tl_artshub_submission_funding']['toggle'],
  85.                     'icon'                => 'visible.svg',
  86.                     'attributes'          => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
  87.                     'button_callback'     => array(Callbacks::class, 'toggleIcon')
  88.                 ),
  89.                 'show' => array
  90.                 (
  91.                     'label'               => &$GLOBALS['TL_LANG']['tl_artshub_submission_funding']['show'],
  92.                     'href'                => 'act=show',
  93.                     'icon'                => 'show.gif'
  94.                 )
  95.             )
  96.         ),
  97.         // Palettes
  98.         'palettes' => array
  99.         (
  100.             'default'                     => '{general_legend},title,alias,submissionDate,funding_type,submitted_by,status;{details_legend},description,profiles;{contact_legend},contact_name,contact_phone,contact_email,contact_url;{images_legend},images;{publishing_legend},published,start,stop;'
  101.         ),
  102.         // Subpalettes
  103.         'subpalettes' => array
  104.         (
  105.         ),
  106.         // Fields
  107.         'fields' => array
  108.         (
  109.             'id' => array
  110.             (
  111.                 'sql'                     => "int(10) unsigned NOT NULL auto_increment"
  112.             ),
  113.             'tstamp' => array
  114.             (
  115.                 'sql'                     => "int(10) unsigned NOT NULL default '0'"
  116.             ),
  117.             'lead_id' => array
  118.             (
  119.                 'sql'                     => "int(10) unsigned NOT NULL default '0'"
  120.             ),
  121.             'submissionDate' => array
  122.             (
  123.                 'exclude'                 => true,
  124.                 'inputType'               => 'text',
  125.                 'eval'                    => array('rgxp'=>'date''mandatory'=>true'doNotCopy'=>true'datepicker'=>true'tl_class'=>'w50 wizard'),
  126.                 'sql'                     => "int(10) unsigned NULL"
  127.             ),
  128.             'title' => array
  129.             (
  130.                 'exclude'                 => true,
  131.                 'search'                  => true,
  132.                 'inputType'               => 'text',
  133.                 'eval'                    => array('mandatory'=>true'maxlength'=>255'tl_class'=>'w50'),
  134.                 'sql'                     => "varchar(255) NOT NULL default ''"
  135.             ),
  136.             'alias' => array
  137.             (
  138.                 'exclude'                 => true,
  139.                 'inputType'               => 'text',
  140.                 'eval'                    => array('rgxp'=>'alias''doNotCopy'=>true'maxlength'=>128'tl_class'=>'w50'),
  141.                 'save_callback' => array
  142.                 (
  143.                     array(Callbacks::class, 'generateAlias')
  144.                 ),
  145.                 'sql'                     => "varchar(128) BINARY NOT NULL default ''"
  146.             ),
  147.             'funding_type' => array
  148.             (
  149.                 'exclude' => true,
  150.                 'default' => '',
  151.                 'filter' => true,
  152.                 'inputType' => 'select',
  153.                 'options' => array('grant''loan'),
  154.                 'reference' => $GLOBALS['TL_LANG']['tl_artshub_submission_funding'],
  155.                 'eval' => array('tl_class' => 'w50 clr'),
  156.                 'sql' => "varchar(32) NOT NULL default ''"
  157.             ),
  158.             'submitted_by' => array
  159.             (
  160.                 'exclude' => true,
  161.                 'search' => true,
  162.                 'inputType' => 'text',
  163.                 'eval' => array('doNotCopy' => true'tl_class' => 'w50 clr'),
  164.                 'sql' => "varchar(255) NOT NULL default ''",
  165.             ),
  166.             'status' => array
  167.             (
  168.                 'exclude' => true,
  169.                 'default' => '',
  170.                 'filter' => true,
  171.                 'inputType' => 'select',
  172.                 'options' => array('''approved''rejected'),
  173.                 'reference' => $GLOBALS['TL_LANG']['MSC']['status_options'],
  174.                 'eval' => array('tl_class' => 'w50'),
  175.                 'sql' => "varchar(32) NOT NULL default ''"
  176.             ),
  177.             'profiles' => array
  178.             (
  179.                 'exclude' => true,
  180.                 'search' => true,
  181.                 'filter' => true,
  182.                 'inputType' => 'artshubProfileItemSelector',
  183.                 'foreignKey' => 'tl_artshub_profile_item.name',
  184.                 'eval' => array('multiple' => true'chosen' => true'includeBlankOption' => true'tl_class' => 'w50'),
  185.                 'sql' => "blob NULL",
  186.                 'relation' => array('type' => 'hasMany''load' => 'lazy'),
  187.             ),
  188.             'contact_name' => array
  189.             (
  190.                 'exclude' => true,
  191.                 'search' => true,
  192.                 'inputType' => 'text',
  193.                 'eval' => array('maxlength' => 255'tl_class' => 'w50'),
  194.                 'sql' => "varchar(128) NOT NULL default ''"
  195.             ),
  196.             'contact_phone' => array
  197.             (
  198.                 'exclude' => true,
  199.                 'search' => true,
  200.                 'inputType' => 'text',
  201.                 'eval' => array('maxlength' => 255'tl_class' => 'w50'),
  202.                 'sql' => "varchar(32) NOT NULL default ''"
  203.             ),
  204.             'contact_email' => array
  205.             (
  206.                 'exclude' => true,
  207.                 'search' => true,
  208.                 'inputType' => 'text',
  209.                 'eval' => array('maxlength' => 255'tl_class' => 'w50'),
  210.                 'sql' => "varchar(255) NOT NULL default ''"
  211.             ),
  212.             'contact_url' => array
  213.             (
  214.                 'exclude' => true,
  215.                 'search' => true,
  216.                 'inputType' => 'text',
  217.                 'eval' => array('maxlength' => 255'tl_class' => 'w50'),
  218.                 'sql' => "varchar(255) NOT NULL default ''"
  219.             ),
  220.             'description' => array
  221.             (
  222.                 'exclude'                 => true,
  223.                 'search'                  => true,
  224.                 'inputType'               => 'textarea',
  225.                 'eval'                    => array('mandatory'=>true'rte'=>'tinyMCE''helpwizard'=>true),
  226.                 'attributes'              => array('fe_search'=>true),
  227.                 'explanation'             => 'insertTags',
  228.                 'sql'                     => "mediumtext NULL"
  229.             ),
  230.             'images' => array
  231.             (
  232.                 'exclude'                 => true,
  233.                 'inputType'               => 'fileTree',
  234.                 'eval'                    => array('multiple'=>true'fieldType'=>'checkbox''orderField'=>'orderImages''files'=>true'isGallery'=>true'extensions'=>\Contao\Config::get('validImageTypes'), 'tl_class'=>'clr''path'=>\Contao\Config::get('uploadPath').'/media'),
  235.                 'sql'                     => "blob NULL",
  236.             ),
  237.             'orderImages' => array
  238.             (
  239.                 'label'                   => &$GLOBALS['TL_LANG']['MSC']['sortOrder'],
  240.                 'sql'                     => "blob NULL"
  241.             ),
  242.             'published' => array
  243.             (
  244.                 'exclude'                 => true,
  245.                 'filter'                  => true,
  246.                 'inputType'               => 'checkbox',
  247.                 'eval'                    => array('tl_class'=>'w50 m12'),
  248.                 'sql'                     => "char(1) NOT NULL default ''"
  249.             ),
  250.             'start' => array
  251.             (
  252.                 'exclude'                 => true,
  253.                 'inputType'               => 'text',
  254.                 'eval'                    => array('rgxp'=>'datim''datepicker'=>true'tl_class'=>'clr w50 wizard'),
  255.                 'sql'                     => "varchar(10) NOT NULL default ''"
  256.             ),
  257.             'stop' => array
  258.             (
  259.                 'exclude'                 => true,
  260.                 'inputType'               => 'text',
  261.                 'eval'                    => array('rgxp'=>'datim''datepicker'=>true'tl_class'=>'w50 wizard'),
  262.                 'sql'                     => "varchar(10) NOT NULL default ''"
  263.             ),
  264.         )
  265.     );
  266. }