<?php
/**
* Copyright (c) 2021 Rhyme Digital LLC (https://rhyme.digital)
*
* @license LGPL-3.0-or-later
*/
namespace {
use Rhyme\WMassArtsHub\Backend\Profile\Callbacks;
/**
* Table tl_artshub_profile_item
*/
$GLOBALS['TL_DCA']['tl_artshub_profile_item'] = array
(
// Config
'config' => array
(
'dataContainer' => 'Table',
'switchToEdit' => true,
'enableVersioning' => true,
'onload_callback' => [
[Callbacks::class, 'checkPermission'],
],
'sql' => array
(
'keys' => array
(
'id' => 'primary',
'alias' => 'index',
'uuid' => 'index',
)
)
),
// List
'list' => array
(
'sorting' => array
(
'mode' => 2,
'fields' => array('name,profile_score'),
'flag' => 12,
'panelLayout' => 'filter;sort;search,limit'
),
'label' => array
(
'fields' => array('name'),
'format' => '%s',
'label_callback' => [Callbacks::class, 'labelCallback'],
),
'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_profile_item']['edit'],
'href' => 'act=edit',
'icon' => 'edit.gif'
),
'copy' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_artshub_profile_item']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif',
),
'delete' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_artshub_profile_item']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"',
),
'toggle' => array
(
'icon' => 'visible.svg',
'attributes' => 'onclick="Backend.getScrollOffset();return AjaxRequest.toggleVisibility(this,%s)"',
'button_callback' => array(Callbacks::class, 'toggleIcon'),
'showInHeader' => true
),
'feature' => array
(
'icon' => 'featured.svg',
'attributes' => 'onclick="Backend.getScrollOffset();return RhymeAjaxRequest.toggleFeatured(this,%s)"',
'button_callback' => array(Callbacks::class, 'iconFeatured')
),
'show' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_artshub_profile_item']['show'],
'href' => 'act=show',
'icon' => 'show.gif'
)
)
),
// Palettes
'palettes' => array
(
'default' => '{general_legend},name,alias,year_founded,primary_type,primary_discipline,disciplines,activities;{text_legend},description;{address_legend},street,street2,city,county,state,postal,latitude,longitude;{contact_legend},contact_name,contact_title,mailing_street_1,mailing_street_2,mailing_city,mailing_state,mailing_zip,phone,fax,email,website,facebook,instagram,twitter;{image_legend},main_image,images,video_urls;{venues_legend},has_venues,events_per_year;{publishing_legend},published,featured,bipoc,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'"
),
'sorting' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'created' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'changed' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'revised' => array
(
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'uuid' => array
(
'sql' => "binary(16) NULL"
),
'raw_uuid' => array
(
'sql' => "varchar(64) NOT NULL default ''"
),
'type' => array
(
'sql' => "varchar(64) NOT NULL default ''"
),
'name' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('mandatory'=>true, 'maxlength'=>255, 'tl_class'=>'clr w50'),
'attributes' => array('fe_sorting'=>true, 'fe_search'=>true),
'sql' => "varchar(255) NOT NULL default ''"
),
'alias' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('rgxp'=>'alias', 'doNotCopy'=>true, 'maxlength'=>255, 'tl_class'=>'w50'),
'save_callback' => [
[Callbacks::class, 'generateAlias'],
],
'sql' => "varchar(255) NOT NULL default ''"
),
'year_founded' => array
(
'exclude' => true,
'inputType' => 'text',
'eval' => array('rgxp'=>'date', 'datepicker'=>true, 'tl_class'=>'w50 wizard'),
'sql' => "varchar(10) NOT NULL default ''"
),
'primary_type' => array
(
'exclude' => true,
'filter' => true,
'inputType' => 'select',
'foreignKey' => 'tl_artshub_profile_type.name',
'eval' => array('doNotSaveEmpty'=>true, 'chosen' => true, 'tl_class'=>'clr w50'),
'relation' => array('type'=>'hasOne', 'load'=>'lazy'),
'save_callback' => [
[Callbacks::class, 'saveTypes'],
],
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'primary_discipline' => array
(
'exclude' => true,
'filter' => true,
'inputType' => 'select',
'foreignKey' => 'tl_artshub_profile_discipline.name',
'eval' => array('doNotSaveEmpty'=>true, 'chosen' => true, 'tl_class'=>'w50'),
'relation' => array('type'=>'hasOne', 'load'=>'lazy'),
'save_callback' => [
[Callbacks::class, 'saveDisciplines'],
],
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'disciplines' => array
(
'exclude' => true,
'inputType' => 'select',
'foreignKey' => 'tl_artshub_profile_discipline.name',
'eval' => array('doNotSaveEmpty'=>true, 'multiple'=>true, 'chosen' => true, 'tl_class'=>'w50'),
'relation' => array('type'=>'hasMany', 'load'=>'lazy'),
'save_callback' => [
[Callbacks::class, 'saveDisciplines'],
],
'sql' => "blob NULL"
),
'activities' => array
(
'exclude' => true,
'inputType' => 'select',
'foreignKey' => 'tl_artshub_profile_activity.name',
'eval' => array('doNotSaveEmpty'=>true, 'multiple'=>true, 'chosen' => true, 'tl_class'=>'w50'),
'relation' => array('type'=>'hasMany', 'load'=>'lazy'),
'save_callback' => [
[Callbacks::class, 'saveActivities'],
],
'sql' => "blob NULL"
),
'main_image' => array
(
'exclude' => true,
'inputType' => 'fileTree',
'eval' => array('filesOnly'=>true, 'fieldType'=>'radio', 'mandatory'=>true, 'tl_class'=>'w50', 'extensions'=>\Contao\Config::get('validImageTypes'), 'path'=>\Contao\Config::get('uploadPath').'/media'),
'sql' => "binary(16) NULL"
),
'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"
),
'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 ''"
),
'street2' => 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 ''"
),
'mailing_street_1' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
),
'contact_name' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'contact_title' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'mailing_street_2' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
),
'mailing_city' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>64, 'tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
),
'mailing_state' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>4, 'tl_class'=>'w50'),
'sql' => "varchar(4) NOT NULL default ''"
),
'mailing_zip' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>10, 'tl_class'=>'w50'),
'sql' => "varchar(10) 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 ''"
),
'phone' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>64, 'decodeEntities'=>true, 'tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
),
'fax' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>64, 'rgxp'=>'phone', 'decodeEntities'=>true, 'tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
),
'email' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'rgxp'=>'email', 'decodeEntities'=>true, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'website' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('rgxp'=>'url', 'maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'facebook' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('rgxp'=>'url', 'maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'instagram' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('rgxp'=>'url', 'maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'twitter' => array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('rgxp'=>'url', 'maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
),
'has_venues' => array
(
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class'=>'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'events_per_year' => array
(
'exclude' => true,
'inputType' => 'text',
'eval' => array('tl_class'=>'w50'),
'sql' => "int(10) unsigned NOT NULL default '0'"
),
'geographic_reach' => array
(
'sql' => "blob NULL"
),
'seasons_active' => array
(
'sql' => "blob NULL"
),
'professional_associations' => array
(
'sql' => "blob NULL"
),
'accessibility_comments' => array
(
'sql' => "mediumtext NULL"
),
'accessibility_of_services' => array
(
'sql' => "blob NULL"
),
'arts_community' => array
(
'sql' => "blob NULL"
),
'awards' => array
(
'sql' => "blob NULL"
),
'education' => array
(
'sql' => "blob NULL"
),
'is_native_american_artist' => array
(
'sql' => "char(1) NOT NULL default ''"
),
'is_teaching_artist' => array
(
'sql' => "char(1) NOT NULL default ''"
),
'is_nefa_grant_recipient' => array
(
'sql' => "char(1) NOT NULL default ''"
),
'is_touring_artist' => array
(
'sql' => "char(1) NOT NULL default ''"
),
'profile_score' => array
(
'exclude' => true,
'sorting' => true,
'inputType' => 'text',
'eval' => array('tl_class'=>'w50'),
'attributes' => array('fe_sorting'=>true),
'sql' => "decimal(12,2) NOT NULL default '0.00'",
),
'related_profile_ids' => array
(
'sql' => "blob NULL"
),
'url_collections' => array
(
'sql' => "blob NULL"
),
'video_urls' => array
(
'inputType' => 'arrayWizard',
'eval' => array
(
'allowHtml' => true,
'multiple' => true,
'metaFields' => array
(
'title' => 'maxlength="255"',
'alt' => 'maxlength="255"',
'link' => array('attributes'=>'maxlength="255"'),
'caption' => array('type'=>'textarea')
)
),
'sql' => "blob NULL"
),
'published' => array
(
'exclude' => true,
'filter' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class'=>'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'featured' => array
(
'exclude' => true,
'filter' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class'=>'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'bipoc' => array
(
'exclude' => true,
'filter' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class'=>'w50'),
'sql' => "char(1) NOT NULL default ''"
),
'api_version' => array
(
'sql' => "varchar(255) 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 ''"
),
)
);
}