<?php
/**
* Copyright (c) 2020 Rhyme Digital LLC (https://rhyme.digital)
*
* @license LGPL-3.0-or-later
*/
namespace {
use Rhyme\WMassArtsHub\Backend\SubmissionProfdev\Callbacks;
use Contao\System;
System::loadLanguageFile('default');
/**
* Table tl_artshub_submission_profdev
*/
$GLOBALS['TL_DCA']['tl_artshub_submission_profdev'] = array
(
// Config
'config' => array
(
'dataContainer' => 'Table',
'enableVersioning' => true,
'sql' => array
(
'keys' => array
(
'id' => 'primary',
)
)
),
// List
'list' => array
(
'sorting' => array
(
'mode' => 2,
'flag' => 2,
'fields' => ['title'],
'panelLayout' => 'sort,filter;search,limit'
),
'label' => array
(
'fields' => array('title'),
'format' => '%s'
),
'global_operations' => array
(
'all' => array
(
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"'
)
),
'operations' => array
(
'edit' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_artshub_submission_profdev']['edit'],
'href' => 'act=edit',
'icon' => 'edit.gif'
),
'copy' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_artshub_submission_profdev']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif',
),
'cut' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_page']['cut'],
'href' => 'act=paste&mode=cut',
'icon' => 'cut.svg',
'attributes' => 'onclick="Backend.getScrollOffset()"',
),
'delete' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_artshub_submission_profdev']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"',
),
'toggle' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_artshub_submission_profdev']['toggle'],
'icon' => 'visible.svg',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => array(Callbacks::class, 'toggleIcon')
),
'show' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_artshub_submission_profdev']['show'],
'href' => 'act=show',
'icon' => 'show.gif'
)
)
),
// Palettes
'palettes' => array
(
'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;'
),
// Subpalettes
'subpalettes' => array
(
),
// Fields
'fields' => array
(
'id' => array
(
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'tstamp' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'lead_id' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'submissionDate' => array
(
'exclude' => true,
'inputType' => 'text',
'eval' => array('rgxp'=>'date', 'mandatory'=>true, 'doNotCopy'=>true, 'datepicker'=>true, 'tl_class'=>'w50 wizard'),
'sql' => "int(10) unsigned NULL"
),
'title' => array
(
'exclude' => true,
'search' => true,
'sorting' => true,
'inputType' => 'text',
'eval' => array('mandatory'=>true, 'maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'alias' => array
(
'exclude' => true,
'inputType' => 'text',
'eval' => array('rgxp'=>'alias', 'doNotCopy'=>true, 'maxlength'=>128, 'tl_class'=>'w50'),
'save_callback' => array
(
array(Callbacks::class, 'generateAlias')
),
'sql' => "varchar(128) BINARY NOT NULL default ''"
),
'profdev_type' => array
(
'exclude' => true,
'default' => '',
'filter' => true,
'inputType' => 'select',
'options' => array('training', 'workshop', 'class', 'job', 'internship', 'internship_seeking', 'mentor', 'mentor_seeking'),
'reference' => $GLOBALS['TL_LANG']['tl_artshub_submission_profdev'],
'eval' => array('tl_class' => 'w50 clr'),
'sql' => "varchar(32) NOT NULL default ''"
),
'submitted_by' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('doNotCopy' => true, 'tl_class' => 'w50 clr'),
'sql' => "varchar(255) NOT NULL default ''",
),
'status' => array
(
'exclude' => true,
'default' => '',
'filter' => true,
'inputType' => 'select',
'options' => array('', 'approved', 'rejected'),
'reference' => $GLOBALS['TL_LANG']['MSC']['status_options'],
'eval' => array('tl_class' => 'w50'),
'sql' => "varchar(32) NOT NULL default ''"
),
'profiles' => array
(
'exclude' => true,
'search' => true,
'filter' => true,
'inputType' => 'artshubProfileItemSelector',
'foreignKey' => 'tl_artshub_profile_item.name',
'eval' => array('multiple' => true, 'chosen' => true, 'includeBlankOption' => true, 'tl_class' => 'w50'),
'sql' => "blob NULL",
'relation' => array('type' => 'hasMany', 'load' => 'lazy'),
),
'contact_name' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(128) NOT NULL default ''"
),
'contact_phone' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(32) NOT NULL default ''"
),
'contact_email' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'contact_url' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'description' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'textarea',
'eval' => array('mandatory'=>true, 'rte'=>'tinyMCE', 'helpwizard'=>true),
'attributes' => array('fe_search'=>true),
'explanation' => 'insertTags',
'sql' => "mediumtext NULL"
),
'street' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'postal' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>32, 'tl_class'=>'w50'),
'sql' => "varchar(32) NOT NULL default ''"
),
'city' => array
(
'exclude' => true,
'filter' => true,
'search' => true,
'sorting' => true,
'inputType' => 'text',
'default' => '',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'county' => array
(
'exclude' => true,
'filter' => true,
'search' => true,
'sorting' => true,
'inputType' => 'text',
'default' => '',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'state' => array
(
'exclude' => true,
'sorting' => true,
'inputType' => 'text',
'default' => 'MA',
'eval' => array('maxlength'=>2, 'tl_class'=>'w50'),
'sql' => "varchar(2) NOT NULL default ''"
),
'latitude' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50' ),
'sql' => "varchar(255) NOT NULL default ''"
),
'longitude' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50' ),
'sql' => "varchar(255) NOT NULL default ''"
),
'images' => array
(
'exclude' => true,
'inputType' => 'fileTree',
'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'),
'sql' => "blob NULL",
),
'orderImages' => array
(
'label' => &$GLOBALS['TL_LANG']['MSC']['sortOrder'],
'sql' => "blob NULL"
),
'published' => array
(
'exclude' => true,
'filter' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class'=>'w50 m12'),
'sql' => "char(1) NOT NULL default ''"
),
'start' => array
(
'exclude' => true,
'inputType' => 'text',
'eval' => array('rgxp'=>'datim', 'datepicker'=>true, 'tl_class'=>'clr w50 wizard'),
'sql' => "varchar(10) NOT NULL default ''"
),
'stop' => array
(
'exclude' => true,
'inputType' => 'text',
'eval' => array('rgxp'=>'datim', 'datepicker'=>true, 'tl_class'=>'w50 wizard'),
'sql' => "varchar(10) NOT NULL default ''"
),
)
);
}