/**
  * Generate the widget and return it as string
  *
  * @return string
  */
 public function generate()
 {
     $fieldName = substr($this->strId, 0, -21);
     $fieldIndex = explode('__', $fieldName);
     $fieldIndex = (int) $fieldIndex[count($fieldIndex) - 1];
     $toolbar = '<div class="rsce_list_toolbar">';
     $toolbar .= '<a href="" class="rsce_list_toolbar_up" onclick="rsceMoveElement(this, -1);return false;" title="' . $GLOBALS['TL_LANG']['rocksolid_custom_elements']['list_item_up'] . '" data-rsce-title="' . $GLOBALS['TL_LANG']['rocksolid_custom_elements']['list_item_up'] . '"><img width="13" height="16" alt="' . $GLOBALS['TL_LANG']['rocksolid_custom_elements']['list_item_up'] . '" src="system/themes/' . \Controller::getTheme() . '/images/up.gif"></a> ';
     $toolbar .= '<a href="" class="rsce_list_toolbar_down" onclick="rsceMoveElement(this, 1);return false;" title="' . $GLOBALS['TL_LANG']['rocksolid_custom_elements']['list_item_down'] . '" data-rsce-title="' . $GLOBALS['TL_LANG']['rocksolid_custom_elements']['list_item_down'] . '"><img width="13" height="16" alt="' . $GLOBALS['TL_LANG']['rocksolid_custom_elements']['list_item_down'] . '" src="system/themes/' . \Controller::getTheme() . '/images/down.gif"></a> ';
     $toolbar .= \Controller::generateImage('drag.gif', '', 'class="drag-handle rsce_list_toolbar_drag" title="' . sprintf($GLOBALS['TL_LANG']['MSC']['move']) . '"') . ' ';
     $toolbar .= '<a href="" class="rsce_list_toolbar_delete" onclick="rsceDeleteElement(this);return false;" title="' . $GLOBALS['TL_LANG']['rocksolid_custom_elements']['list_item_delete'] . '" data-rsce-title="' . $GLOBALS['TL_LANG']['rocksolid_custom_elements']['list_item_delete'] . '"><img width="14" height="16" alt="' . $GLOBALS['TL_LANG']['rocksolid_custom_elements']['list_item_delete'] . '" src="system/themes/' . \Controller::getTheme() . '/images/delete.gif"></a> ';
     $toolbar .= '<a href="" class="rsce_list_toolbar_new" onclick="rsceNewElementAfter(this);return false;" title="' . $GLOBALS['TL_LANG']['rocksolid_custom_elements']['list_item_new'] . '" data-rsce-title="' . $GLOBALS['TL_LANG']['rocksolid_custom_elements']['list_item_new'] . '"><img width="12" height="16" alt="' . $GLOBALS['TL_LANG']['rocksolid_custom_elements']['list_item_new'] . '" src="system/themes/' . \Controller::getTheme() . '/images/new.gif"></a> ';
     $toolbar .= '</div>';
     return '<div class="rsce_list_item' . (empty($this->arrConfiguration['tl_class']) ? '' : ' ' . $this->arrConfiguration['tl_class']) . '" data-rsce-name="' . $fieldName . '">' . ($this->strLabel ? '<div class="rsce_list_item_title" data-rsce-label="' . $this->arrConfiguration['label_template'] . '">' . $this->strLabel . '</div>' : '') . $toolbar . '<fieldset class="tl_box rsce_group rsce_group_no_legend">';
 }
Example #2
0
<?php

/*
 * Copyright MADE/YOUR/DAY OG <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
/**
 * RockSolid Slider DCA
 *
 * @author Martin Auswöger <*****@*****.**>
 */
$GLOBALS['TL_DCA']['tl_rocksolid_slider'] = array('config' => array('dataContainer' => 'Table', 'ctable' => array('tl_rocksolid_slide'), 'switchToEdit' => true, 'enableVersioning' => true, 'sql' => array('keys' => array('id' => 'primary'))), 'list' => array('sorting' => array('mode' => 1, 'fields' => array('name'), 'flag' => 1, 'panelLayout' => 'filter;search,limit'), 'label' => array('fields' => array('name'), 'format' => '%s'), 'global_operations' => array('license' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slider']['editLicense'], 'href' => 'table=tl_rocksolid_slider_license', 'class' => 'header_icon', 'icon' => 'system/themes/' . \Controller::getTheme() . '/images/settings.gif'), '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_rocksolid_slider']['edit'], 'href' => 'table=tl_rocksolid_slide', 'icon' => 'edit.gif', 'attributes' => 'class="contextmenu"'), 'editheader' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slider']['editheader'], 'href' => 'act=edit', 'icon' => 'header.gif', 'attributes' => 'class="edit-header"'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slider']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slider']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slider']['show'], 'href' => 'act=show', 'icon' => 'show.gif'))), 'palettes' => array('default' => '{slider_legend},name,multiSRC,size'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'name' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slider']['name'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'maxlength' => 255), 'sql' => "varchar(255) NOT NULL default ''"), 'multiSRC' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slider']['multiSRC'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('multiple' => true, 'fieldType' => 'checkbox', 'orderField' => 'orderSRC', 'files' => true, 'filesOnly' => true, 'isGallery' => true, 'extensions' => \Config::get('validImageTypes')), 'sql' => "blob NULL"), 'orderSRC' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slider']['orderSRC'], 'sql' => "blob NULL")));
<?php

/*
 * Copyright MADE/YOUR/DAY OG <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
/**
 * RockSolid Mega Menu DCA
 *
 * @author Martin Auswöger <*****@*****.**>
 */
if (TL_MODE === 'BE') {
    $GLOBALS['TL_CSS'][] = (version_compare(VERSION, '4.0', '>=') ? 'bundles/rocksolidcolumns' : 'system/modules/rocksolid-columns/assets') . '/css/be_main.css';
    // Load module language file
    $this->loadLanguageFile('tl_module');
}
$GLOBALS['TL_DCA']['tl_rocksolid_mega_menu'] = array('config' => array('dataContainer' => 'Table', 'ctable' => array('tl_rocksolid_mega_menu_column'), 'switchToEdit' => true, 'enableVersioning' => true, 'sql' => array('keys' => array('id' => 'primary')), 'onload_callback' => array(array('MadeYourDay\\Contao\\MegaMenu\\MegaMenu', 'dcaOnloadCallback'))), 'list' => array('sorting' => array('mode' => 1, 'fields' => array('name'), 'flag' => 1, 'panelLayout' => 'filter;search,limit'), 'label' => array('fields' => array('name'), 'format' => '%s'), 'global_operations' => array('license' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['editLicense'], 'href' => 'table=tl_rocksolid_mega_menu_license', 'class' => 'header_icon', 'icon' => 'system/themes/' . \Controller::getTheme() . '/images/settings.gif'), '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_rocksolid_mega_menu']['edit'], 'href' => 'table=tl_rocksolid_mega_menu_column', 'icon' => 'edit.gif', 'attributes' => 'class="contextmenu"'), 'editheader' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['editheader'], 'href' => 'act=edit', 'icon' => 'header.gif', 'attributes' => 'class="edit-header"'), 'copy' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['copy'], 'href' => 'act=copy', 'icon' => 'copy.gif'), 'delete' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['delete'], 'href' => 'act=delete', 'icon' => 'delete.gif', 'attributes' => 'onclick="if(!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\'))return false;Backend.getScrollOffset()"'), 'show' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['show'], 'href' => 'act=show', 'icon' => 'show.gif'))), 'palettes' => array('__selector__' => array('type'), 'default' => '{type_legend},name,type', 'auto' => '{type_legend},name,type;{rs_columns_legend},rs_columns_large,rs_columns_medium,rs_columns_small;{slider_legend},slider,sliderNavType,sliderControls,sliderSkin,sliderGapSize,sliderMaxCount,sliderMinSize,sliderPrevNextSteps,sliderLoop;{settings_legend},imageSize;{background_legend},backgroundImage,backgroundImageSize,backgroundSize,backgroundPosition,backgroundRepeat;{expert_legend},cssClass,cssId', 'auto_images' => '{type_legend},name,type;{rs_columns_legend},rs_columns_large,rs_columns_medium,rs_columns_small;{slider_legend},slider,sliderNavType,sliderControls,sliderSkin,sliderGapSize,sliderMaxCount,sliderMinSize,sliderPrevNextSteps,sliderLoop;{settings_legend},imageSize;{background_legend},backgroundImage,backgroundImageSize,backgroundSize,backgroundPosition,backgroundRepeat;{expert_legend},cssClass,cssId', 'manual' => '{type_legend},name,type;{rs_columns_legend},rs_columns_large,rs_columns_medium,rs_columns_small;{slider_legend},slider,sliderNavType,sliderControls,sliderSkin,sliderGapSize,sliderMaxCount,sliderMinSize,sliderPrevNextSteps,sliderLoop;{background_legend},backgroundImage,backgroundImageSize,backgroundSize,backgroundPosition,backgroundRepeat;{expert_legend},cssClass,cssId', 'html' => '{type_legend},name,type;{html_legend},html;{background_legend},backgroundImage,backgroundImageSize,backgroundSize,backgroundPosition,backgroundRepeat;{expert_legend},cssClass,cssId'), 'fields' => array('id' => array('sql' => "int(10) unsigned NOT NULL auto_increment"), 'tstamp' => array('sql' => "int(10) unsigned NOT NULL default '0'"), 'name' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['name'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('mandatory' => true, 'tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''"), 'type' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['type'], 'exclude' => true, 'inputType' => 'select', 'options' => array('auto', 'auto_images', 'manual', 'html'), 'reference' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['types'], 'eval' => array('mandatory' => true, 'chosen' => true, 'submitOnChange' => true, 'includeBlankOption' => true, 'tl_class' => 'w50'), 'sql' => "varchar(32) NOT NULL default ''"), 'rs_columns_large' => array('inputType' => 'text', 'exclude' => true, 'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['rs_columns_large'], 'eval' => array('mandatory' => true, 'tl_class' => 'rs_columns_w33'), 'sql' => "varchar(255) NOT NULL default ''"), 'rs_columns_medium' => array('inputType' => 'text', 'exclude' => true, 'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['rs_columns_medium'], 'eval' => array('tl_class' => 'rs_columns_w33'), 'sql' => "varchar(255) NOT NULL default ''"), 'rs_columns_small' => array('inputType' => 'text', 'exclude' => true, 'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['rs_columns_small'], 'eval' => array('tl_class' => 'rs_columns_w33'), 'sql' => "varchar(255) NOT NULL default ''"), 'slider' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['slider'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'clr'), 'sql' => "char(1) NOT NULL default ''"), 'sliderNavType' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_navType'], 'exclude' => true, 'inputType' => 'select', 'options' => array('bullets' => $GLOBALS['TL_LANG']['tl_module']['rsts_navType_bullets'], 'numbers' => $GLOBALS['TL_LANG']['tl_module']['rsts_navType_numbers'], 'tabs' => $GLOBALS['TL_LANG']['tl_module']['rsts_navType_tabs'], 'none' => $GLOBALS['TL_LANG']['tl_module']['rsts_navType_none']), 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'sliderControls' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_controls'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 m12'), 'sql' => "char(1) NOT NULL default '1'"), 'sliderSkin' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_customSkin'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'sliderGapSize' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_gapSize'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default '0%'"), 'sliderMaxCount' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_slideMaxCount'], 'exclude' => true, 'inputType' => 'select', 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20), 'eval' => array('tl_class' => 'w50', 'includeBlankOption' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'sliderMinSize' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_slideMinSize'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('tl_class' => 'w50'), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'sliderPrevNextSteps' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_prevNextSteps'], 'exclude' => true, 'inputType' => 'select', 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20), 'eval' => array('tl_class' => 'w50', 'includeBlankOption' => true), 'sql' => "int(10) unsigned NOT NULL default '0'"), 'sliderLoop' => array('label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_loop'], 'exclude' => true, 'inputType' => 'checkbox', 'eval' => array('tl_class' => 'w50 m12'), 'sql' => "char(1) NOT NULL default ''"), 'imageSize' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['imageSize'], 'exclude' => true, 'inputType' => 'imageSize', 'options' => version_compare(VERSION, '3.4', '<') ? $GLOBALS['TL_CROP'] : System::getImageSizes(), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('rgxp' => 'digit', 'nospace' => true, 'helpwizard' => true, 'includeBlankOption' => true), 'sql' => "varchar(64) NOT NULL default ''"), 'html' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['html'], 'exclude' => true, 'inputType' => 'textarea', 'eval' => array('mandatory' => true, 'allowHtml' => true, 'class' => 'monospace', 'rte' => 'ace|html'), 'explanation' => 'insertTags', 'sql' => "mediumtext NULL"), 'backgroundImage' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['backgroundImage'], 'exclude' => true, 'inputType' => 'fileTree', 'eval' => array('fieldType' => 'radio', 'files' => true, 'filesOnly' => true, 'tl_class' => 'clr', 'extensions' => \Config::get('validImageTypes')), 'sql' => version_compare(VERSION, '3.2', '<') ? "varchar(255) NOT NULL default ''" : "binary(16) NULL"), 'backgroundImageSize' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['backgroundImageSize'], 'exclude' => true, 'inputType' => 'imageSize', 'options' => version_compare(VERSION, '3.4', '<') ? $GLOBALS['TL_CROP'] : System::getImageSizes(), 'reference' => &$GLOBALS['TL_LANG']['MSC'], 'eval' => array('rgxp' => 'digit', 'nospace' => true, 'helpwizard' => true, 'tl_class' => 'w50', 'includeBlankOption' => true), 'sql' => "varchar(64) NOT NULL default ''"), 'backgroundSize' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['backgroundSize'], 'exclude' => true, 'inputType' => 'select', 'options' => array('auto', 'cover', 'contain'), 'reference' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['backgroundSizes'], 'eval' => array('includeBlankOption' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'backgroundPosition' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['backgroundPosition'], 'exclude' => true, 'inputType' => 'select', 'options' => array('left top', 'left center', 'left bottom', 'center top', 'center center', 'center bottom', 'right top', 'right center', 'right bottom'), 'reference' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['backgroundPositions'], 'eval' => array('includeBlankOption' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'backgroundRepeat' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['backgroundRepeat'], 'exclude' => true, 'inputType' => 'select', 'options' => array('no-repeat', 'repeat-x', 'repeat-y', 'repeat'), 'reference' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['backgroundRepeats'], 'eval' => array('includeBlankOption' => true, 'tl_class' => 'w50'), 'sql' => "varchar(64) NOT NULL default ''"), 'cssClass' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['cssClass'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('tl_class' => 'w50 clr'), 'sql' => "varchar(255) NOT NULL default ''"), 'cssId' => array('label' => &$GLOBALS['TL_LANG']['tl_rocksolid_mega_menu']['cssId'], 'exclude' => true, 'inputType' => 'text', 'eval' => array('tl_class' => 'w50'), 'sql' => "varchar(255) NOT NULL default ''")));