<?php
/**
* Copyright (C) 2021 Rhyme Digital, LLC.
*
* @link http://rhyme.digital
* @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
*/
namespace {
use Rhyme\WMassArtsHub\Backend\CalendarEvents\Callbacks;
use Contao\ArrayUtil;
/*
* List Operations
*/
ArrayUtil::arrayInsert($GLOBALS['TL_DCA']['tl_calendar_events']['list']['operations'], 7, array(
'preview' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_calendar_events']['preview'],
'icon' => 'forward.svg',
'attributes' => 'target="_blank" onclick="Backend.getScrollOffset(); window.open(this.href); return false"',
'button_callback' => array(Callbacks::class, 'previewIcon')
),
));
ArrayUtil::arrayInsert($GLOBALS['TL_DCA']['tl_calendar_events']['list']['operations'], 8, array(
'rating' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_calendar_events']['rating'],
'href' => '#',
'icon' => 'featured.svg',
'attributes' => 'onclick="Backend.getScrollOffset();"',
'button_callback' => array(Callbacks::class, 'ratingIcon')
),
));
/*
* Palettes
*/
Contao\CoreBundle\DataContainer\PaletteManipulator::create()
->addLegend('related_legend', 'title_legend', Contao\CoreBundle\DataContainer\PaletteManipulator::POSITION_AFTER)
->addField('profiles', 'related_legend', Contao\CoreBundle\DataContainer\PaletteManipulator::POSITION_APPEND)
->addField('member', 'profiles', Contao\CoreBundle\DataContainer\PaletteManipulator::POSITION_AFTER)
->addField('status', 'related_legend', Contao\CoreBundle\DataContainer\PaletteManipulator::POSITION_APPEND)
->addField('sourceFeed', 'related_legend', Contao\CoreBundle\DataContainer\PaletteManipulator::POSITION_APPEND)
->addField('city', 'address', Contao\CoreBundle\DataContainer\PaletteManipulator::POSITION_AFTER)
->addField('latitude', 'city', Contao\CoreBundle\DataContainer\PaletteManipulator::POSITION_AFTER)
->addField('longitude', 'latitude', Contao\CoreBundle\DataContainer\PaletteManipulator::POSITION_AFTER)
->addField('contact_phone', 'longitude', Contao\CoreBundle\DataContainer\PaletteManipulator::POSITION_AFTER)
->addField('contact_email', 'contact_phone', Contao\CoreBundle\DataContainer\PaletteManipulator::POSITION_AFTER)
->addField('contact_name', 'longitude', Contao\CoreBundle\DataContainer\PaletteManipulator::POSITION_AFTER)
->addField('contact_url', 'contact_email', Contao\CoreBundle\DataContainer\PaletteManipulator::POSITION_AFTER)
->addField('tickets_url', 'contact_url', Contao\CoreBundle\DataContainer\PaletteManipulator::POSITION_AFTER)
->addField('additional_details', 'details_legend', Contao\CoreBundle\DataContainer\PaletteManipulator::POSITION_APPEND)
->applyToPalette('default', 'tl_calendar_events');
/*
* Fields
*/
$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['member'] = array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('doNotCopy' => true, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''",
);
$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['status'] = array
(
'exclude' => true,
'default' => '',
'filter' => true,
'inputType' => 'select',
'options' => array('', 'approved', 'rejected'),
'reference' => $GLOBALS['TL_LANG']['tl_calendar_events']['status_options'],
'eval' => array('tl_class' => 'clr w50', 'readonly' => true, 'disabled' => true),
'sql' => "varchar(32) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['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'),
);
$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['sourceFeed'] = array
(
'exclude' => true,
'search' => true,
'filter' => true,
'inputType' => 'select',
'options' => array_keys($GLOBALS['ARTSHUB_FEED_CONFIGS']),
'reference' => &$GLOBALS['TL_LANG']['tl_artshub_feed']['types'],
'eval' => array('maxlength' => 255, 'tl_class' => 'w50', 'readonly' => true, 'disabled' => true),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['city'] = array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['latitude'] = array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['longitude'] = array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['contact_name'] = array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['contact_phone'] = array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(32) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['contact_email'] = array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['contact_url'] = array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['tickets_url'] = array
(
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['additional_details'] = array
(
'inputType' => 'keyValueWizard',
'exclude' => true,
'eval' => array('tl_class' => 'clr xtraWide'),
'sql' => "text NULL"
);
$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['rating'] = array
(
'exclude' => true,
'filter' => true,
'default' => 1,
'inputType' => 'select',
'eval' => array('doNotCopy' => true, 'mandatory' => true, 'tl_class' => 'w50'),
'sql' => "int(10) unsigned NOT NULL default '1'",
);
$GLOBALS['TL_DCA']['tl_calendar_events']['fields']['cacheKey'] = array
(
'sql' => "varchar(255) NOT NULL default ''"
);
}