src/Rhyme/WMassArtsHub/Resources/contao/dca/tl_artshub_submission_profdev.php line 308

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\SubmissionProfdev\Callbacks;
  9.     use Contao\System;
  10.     System::loadLanguageFile('default');
  11.     /**
  12.      * Table tl_artshub_submission_profdev
  13.      */
  14.     $GLOBALS['TL_DCA']['tl_artshub_submission_profdev'] = 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_profdev']['edit'],
  59.                     'href'                => 'act=edit',
  60.                     'icon'                => 'edit.gif'
  61.                 ),
  62.                 'copy' => array
  63.                 (
  64.                     'label'               => &$GLOBALS['TL_LANG']['tl_artshub_submission_profdev']['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_profdev']['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_profdev']['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_profdev']['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,profdev_type,submitted_by,status;{details_legend},description,space_size,space_available_date,profiles;{contact_legend},contact_name,contact_phone,contact_email,contact_url;{location_legend},street,street_2,city,state,postal,latitude,longitude;{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.                 'sorting'                 => true,
  133.                 'inputType'               => 'text',
  134.                 'eval'                    => array('mandatory'=>true'maxlength'=>255'tl_class'=>'w50'),
  135.                 'sql'                     => "varchar(255) NOT NULL default ''"
  136.             ),
  137.             'alias' => array
  138.             (
  139.                 'exclude'                 => true,
  140.                 'inputType'               => 'text',
  141.                 'eval'                    => array('rgxp'=>'alias''doNotCopy'=>true'maxlength'=>128'tl_class'=>'w50'),
  142.                 'save_callback' => array
  143.                 (
  144.                     array(Callbacks::class, 'generateAlias')
  145.                 ),
  146.                 'sql'                     => "varchar(128) BINARY NOT NULL default ''"
  147.             ),
  148.             'profdev_type' => array
  149.             (
  150.                 'exclude' => true,
  151.                 'default' => '',
  152.                 'filter' => true,
  153.                 'inputType' => 'select',
  154.                 'options' => array('training''workshop''class''job''internship''internship_seeking''mentor''mentor_seeking'),
  155.                 'reference' => $GLOBALS['TL_LANG']['tl_artshub_submission_profdev'],
  156.                 'eval' => array('tl_class' => 'w50 clr'),
  157.                 'sql' => "varchar(32) NOT NULL default ''"
  158.             ),
  159.             'submitted_by' => array
  160.             (
  161.                 'exclude' => true,
  162.                 'search' => true,
  163.                 'inputType' => 'text',
  164.                 'eval' => array('doNotCopy' => true'tl_class' => 'w50 clr'),
  165.                 'sql' => "varchar(255) NOT NULL default ''",
  166.             ),
  167.             'status' => array
  168.             (
  169.                 'exclude' => true,
  170.                 'default' => '',
  171.                 'filter' => true,
  172.                 'inputType' => 'select',
  173.                 'options' => array('''approved''rejected'),
  174.                 'reference' => $GLOBALS['TL_LANG']['MSC']['status_options'],
  175.                 'eval' => array('tl_class' => 'w50'),
  176.                 'sql' => "varchar(32) NOT NULL default ''"
  177.             ),
  178.             'profiles' => array
  179.             (
  180.                 'exclude' => true,
  181.                 'search' => true,
  182.                 'filter' => true,
  183.                 'inputType' => 'artshubProfileItemSelector',
  184.                 'foreignKey' => 'tl_artshub_profile_item.name',
  185.                 'eval' => array('multiple' => true'chosen' => true'includeBlankOption' => true'tl_class' => 'w50'),
  186.                 'sql' => "blob NULL",
  187.                 'relation' => array('type' => 'hasMany''load' => 'lazy'),
  188.             ),
  189.             'contact_name' => array
  190.             (
  191.                 'exclude' => true,
  192.                 'search' => true,
  193.                 'inputType' => 'text',
  194.                 'eval' => array('maxlength' => 255'tl_class' => 'w50'),
  195.                 'sql' => "varchar(128) NOT NULL default ''"
  196.             ),
  197.             'contact_phone' => array
  198.             (
  199.                 'exclude' => true,
  200.                 'search' => true,
  201.                 'inputType' => 'text',
  202.                 'eval' => array('maxlength' => 255'tl_class' => 'w50'),
  203.                 'sql' => "varchar(32) NOT NULL default ''"
  204.             ),
  205.             'contact_email' => array
  206.             (
  207.                 'exclude' => true,
  208.                 'search' => true,
  209.                 'inputType' => 'text',
  210.                 'eval' => array('maxlength' => 255'tl_class' => 'w50'),
  211.                 'sql' => "varchar(255) NOT NULL default ''"
  212.             ),
  213.             'contact_url' => array
  214.             (
  215.                 'exclude' => true,
  216.                 'search' => true,
  217.                 'inputType' => 'text',
  218.                 'eval' => array('maxlength' => 255'tl_class' => 'w50'),
  219.                 'sql' => "varchar(255) NOT NULL default ''"
  220.             ),
  221.             'description' => array
  222.             (
  223.                 'exclude'                 => true,
  224.                 'search'                  => true,
  225.                 'inputType'               => 'textarea',
  226.                 'eval'                    => array('mandatory'=>true'rte'=>'tinyMCE''helpwizard'=>true),
  227.                 'attributes'              => array('fe_search'=>true),
  228.                 'explanation'             => 'insertTags',
  229.                 'sql'                     => "mediumtext NULL"
  230.             ),
  231.             'street' => array
  232.             (
  233.                 'exclude'                 => true,
  234.                 'search'                  => true,
  235.                 'inputType'               => 'text',
  236.                 'eval'                    => array('maxlength'=>255'tl_class'=>'w50'),
  237.                 'sql'                     => "varchar(255) NOT NULL default ''"
  238.             ),
  239.             'postal' => array
  240.             (
  241.                 'exclude'                 => true,
  242.                 'search'                  => true,
  243.                 'inputType'               => 'text',
  244.                 'eval'                    => array('maxlength'=>32,  'tl_class'=>'w50'),
  245.                 'sql'                     => "varchar(32) NOT NULL default ''"
  246.             ),
  247.             'city' => array
  248.             (
  249.                 'exclude'                 => true,
  250.                 'filter'                  => true,
  251.                 'search'                  => true,
  252.                 'sorting'                 => true,
  253.                 'inputType'               => 'text',
  254.                 'default'                 => '',
  255.                 'eval'                    => array('maxlength'=>255'tl_class'=>'w50'),
  256.                 'sql'                     => "varchar(255) NOT NULL default ''"
  257.             ),
  258.             'county' => array
  259.             (
  260.                 'exclude'                 => true,
  261.                 'filter'                  => true,
  262.                 'search'                  => true,
  263.                 'sorting'                 => true,
  264.                 'inputType'               => 'text',
  265.                 'default'                 => '',
  266.                 'eval'                    => array('maxlength'=>255'tl_class'=>'w50'),
  267.                 'sql'                     => "varchar(255) NOT NULL default ''"
  268.             ),
  269.             'state' => array
  270.             (
  271.                 'exclude'                 => true,
  272.                 'sorting'                 => true,
  273.                 'inputType'               => 'text',
  274.                 'default'                 => 'MA',
  275.                 'eval'                    => array('maxlength'=>2'tl_class'=>'w50'),
  276.                 'sql'                     => "varchar(2) NOT NULL default ''"
  277.             ),
  278.             'latitude' => array
  279.             (
  280.                 'exclude'                 => true,
  281.                 'search'                  => true,
  282.                 'inputType'               => 'text',
  283.                 'eval'                    => array('maxlength'=>255'tl_class'=>'w50' ),
  284.                 'sql'                     => "varchar(255) NOT NULL default ''"
  285.             ),
  286.             'longitude' => array
  287.             (
  288.                 'exclude'                 => true,
  289.                 'search'                  => true,
  290.                 'inputType'               => 'text',
  291.                 'eval'                    => array('maxlength'=>255'tl_class'=>'w50' ),
  292.                 'sql'                     => "varchar(255) NOT NULL default ''"
  293.             ),
  294.             'images' => array
  295.             (
  296.                 'exclude'                 => true,
  297.                 'inputType'               => 'fileTree',
  298.                 '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'),
  299.                 'sql'                     => "blob NULL",
  300.             ),
  301.             'orderImages' => array
  302.             (
  303.                 'label'                   => &$GLOBALS['TL_LANG']['MSC']['sortOrder'],
  304.                 'sql'                     => "blob NULL"
  305.             ),
  306.             'published' => array
  307.             (
  308.                 'exclude'                 => true,
  309.                 'filter'                  => true,
  310.                 'inputType'               => 'checkbox',
  311.                 'eval'                    => array('tl_class'=>'w50 m12'),
  312.                 'sql'                     => "char(1) NOT NULL default ''"
  313.             ),
  314.             'start' => array
  315.             (
  316.                 'exclude'                 => true,
  317.                 'inputType'               => 'text',
  318.                 'eval'                    => array('rgxp'=>'datim''datepicker'=>true'tl_class'=>'clr w50 wizard'),
  319.                 'sql'                     => "varchar(10) NOT NULL default ''"
  320.             ),
  321.             'stop' => array
  322.             (
  323.                 'exclude'                 => true,
  324.                 'inputType'               => 'text',
  325.                 'eval'                    => array('rgxp'=>'datim''datepicker'=>true'tl_class'=>'w50 wizard'),
  326.                 'sql'                     => "varchar(10) NOT NULL default ''"
  327.             ),
  328.         )
  329.     );
  330. }