src/Document/Areabrick/Keyvisual.php line 35

Open in your IDE?
  1. <?php
  2. namespace App\Document\Areabrick;
  3. use Pimcore\Extension\Document\Areabrick\EditableDialogBoxConfiguration;
  4. use Pimcore\Extension\Document\Areabrick\EditableDialogBoxInterface;
  5. use Pimcore\Model\DataObject\VehicleFilterEntity;
  6. use Pimcore\Model\Document\Editable;
  7. use Pimcore\Model\Document\Editable\Area\Info;
  8. use Pimcore\Translation\Translator;
  9. class Keyvisual extends BaseAreabrick implements EditableDialogBoxInterface
  10. {
  11.     private const DEFAULT_SLIDES 3;
  12.     
  13.     public function __construct(Translator $translator)
  14.     {
  15.         $this->translator $translator;
  16.     }
  17.     public function getName(): string
  18.     {
  19.         return $this->translator->trans('Keyvisual', [], 'admin');
  20.     }
  21.     public function action(Info $info): void
  22.     {
  23.         $info->setParams([
  24.             'vehicleCategories' => $this->getVehicleCategories(),
  25.             'vehicleMakes' => $this->getVehicleMakes(),
  26.             'slideCount' => $this->getSlideCount($info)
  27.         ]);
  28.     }
  29.     private function getVehicleCategories(): array
  30.     {
  31.         try {
  32.             $currentCat VehicleFilterEntity::getByName('Kategorie')->current();
  33.             return ($currentCat instanceof VehicleFilterEntity
  34.                 ? $currentCat->getFilterValues()[0
  35.                 : [];
  36.         } catch (\Exception) {
  37.             return [];
  38.         }
  39.     }
  40.     private function getVehicleMakes(): array
  41.     {
  42.         try {
  43.             $currentMak VehicleFilterEntity::getByName('Marke')->current();
  44.             return ($currentMak instanceof VehicleFilterEntity
  45.                 ? $currentMak->getFilterValues()[0
  46.                 : [];
  47.         } catch (\Exception) {
  48.             return [];
  49.         }
  50.     }
  51.     private function getSlideCount(?Info $info null): int
  52.     {
  53.         if ($info === null) {
  54.             return self::DEFAULT_SLIDES;
  55.         }
  56.         
  57.         $slideCountEditable $info->getDocument()->getEditable('slideCount');
  58.         return $slideCountEditable ? (int)$slideCountEditable->getValue() : self::DEFAULT_SLIDES;
  59.     }
  60.     public function getEditableDialogBoxConfiguration(Editable $area, ?Info $info): EditableDialogBoxConfiguration
  61.     {
  62.         $config = new EditableDialogBoxConfiguration();
  63.         $config->setWidth(900);
  64.         $config->setHeight(800);
  65.         
  66.         $maxSlides 10;
  67.         $brandStyles $info?->getDocument()?->getProperty('brandStyles') ?? 'none';
  68.         
  69.         $tabItems = [
  70.             // General Settings Tab
  71.             [
  72.                 'type' => 'panel',
  73.                 'title' => $this->translator->trans('Einstellungen', [], 'admin'),
  74.                 'layout' => 'fit',
  75.                 'autoScroll' => true,
  76.                 'bodyStyle' => 'padding: 20px',
  77.                 'items' => [
  78.                     [
  79.                         'type' => 'fieldset',
  80.                         'title' => $this->translator->trans('Slides ein-/ausschalten', [], 'admin'),
  81.                         'description' => $this->translator->trans('Aktivieren Sie die gewünschten Slides. Wenn kein Slide aktiviert ist, wird der bestehende Inhalt verwendet.', [], 'admin'),
  82.                         'style' => 'margin-bottom: 15px',
  83.                         'autoHeight' => true,
  84.                         'defaults' => [
  85.                             'anchor' => '100%'
  86.                         ],
  87.                         'items' => [
  88.                             [
  89.                                 'type' => 'container',
  90.                                 'layout' => [
  91.                                     'type' => 'vbox',
  92.                                     'align' => 'stretch'
  93.                                 ],
  94.                                 'height' => 'auto',
  95.                                 'style' => 'width: 100%',
  96.                                 'items' => array_map(function($i) {
  97.                                     return [
  98.                                         'type' => 'container',
  99.                                         'layout' => [
  100.                                             'type' => 'hbox',
  101.                                             'align' => 'middle'
  102.                                         ],
  103.                                         'height' => 40,
  104.                                         'style' => 'width: 100%; align-items: center; padding: 8px; margin-bottom: 5px; background: #f8f9fa; border-radius: 4px;',
  105.                                         'items' => [
  106.                                             [
  107.                                                 'type' => 'checkbox',
  108.                                                 'name' => 'slide_active_' $i,
  109.                                                 'label' => $this->translator->trans('Slide %number%', ['%number%' => $i], 'admin'),
  110.                                                 'style' => 'transform: scale(1.2); margin-right: 15px;',
  111.                                                 'fieldStyle' => 'font-weight: 500; color: #495057;',
  112.                                                 'flex' => 1,
  113.                                                 'config' => [
  114.                                                     'defaultValue' => false
  115.                                                 ]
  116.                                             ],
  117.                                             [
  118.                                                 'type' => 'button',
  119.                                                 'text' => $this->translator->trans('Bearbeiten', [], 'admin'),
  120.                                                 'iconCls' => 'pimcore_icon_edit',
  121.                                                 'style' => 'margin-left: auto; background: #0d6efd; color: white; border-radius: 4px; padding: 5px 10px;',
  122.                                                 'handler' => 'function() { this.up("#keyvisual-config-tabs").setActiveTab(' . ($i 1) . '); }'
  123.                                             ]
  124.                                         ]
  125.                                     ];
  126.                                 }, range(1$maxSlides))
  127.                             ]
  128.                         ]
  129.                     ],
  130.                     [
  131.                         'type' => 'fieldset',
  132.                         'title' => $this->translator->trans('Übergangsanimation', [], 'admin'),
  133.                         'description' => $this->translator->trans('Configure how the slideshow animates and behaves', [], 'admin'),
  134.                         'collapsible' => true,
  135.                         'collapsed' => false,
  136.                         'style' => 'margin-top: 20px',
  137.                         'items' => [
  138.                             [
  139.                                 'type' => 'checkbox',
  140.                                 'name' => 'enable_autoplay',
  141.                                 'label' => $this->translator->trans('Automatischen Bildwechsel aktivieren', [], 'admin'),
  142.                                 'description' => $this->translator->trans('Automatically transition between slides', [], 'admin')
  143.                             ],
  144.                             [
  145.                                 'type' => 'numeric',
  146.                                 'name' => 'autoplay_delay',
  147.                                 'label' => $this->translator->trans('Zeit zwischen Bildwechseln (in Millisekunden)', [], 'admin'),
  148.                                 'description' => $this->translator->trans('Time to wait before showing the next slide (in milliseconds)', [], 'admin'),
  149.                                 'config' => [
  150.                                     'minValue' => 1000,
  151.                                     'maxValue' => 10000,
  152.                                     'defaultValue' => 5000,
  153.                                     'decimalPrecision' => 0,
  154.                                     'width' => 200
  155.                                 ],
  156.                                 'conditions' => [
  157.                                     'enabled' => [
  158.                                         'type' => 'editableRenderer',
  159.                                         'config' => [
  160.                                             'renderlet' => 'enable_autoplay',
  161.                                             'operator' => '==',
  162.                                             'value' => true
  163.                                         ]
  164.                                     ]
  165.                                 ]
  166.                             ]
  167.                         ]
  168.                     ],
  169.                     [
  170.                         'type' => 'fieldset',
  171.                         'title' => $this->translator->trans('Zusatzfunktionen', [], 'admin'),
  172.                         'description' => $this->translator->trans('Enable or disable additional functionality', [], 'admin'),
  173.                         'collapsible' => true,
  174.                         'collapsed' => false,
  175.                         'style' => 'margin-top: 20px',
  176.                         'items' => [
  177.                             [
  178.                                 'type' => 'checkbox',
  179.                                 'name' => 'show_widget',
  180.                                 'label' => $this->translator->trans('Search Widget anzeigen?', [], 'admin'),
  181.                                 'description' => $this->translator->trans('Display a search widget that allows users to quickly find vehicles', [], 'admin')
  182.                             ]
  183.                         ]
  184.                     ],
  185.                     [
  186.                         'type' => 'fieldset',
  187.                         'title' => $this->translator->trans('Design Einstellungen', [], 'admin'),
  188.                         'description' => $this->translator->trans('Wählen Sie das gewünschte Layout für den Slider', [], 'admin'),
  189.                         'style' => 'margin-bottom: 15px',
  190.                         'items' => [
  191.                             [
  192.                                 'type' => 'select',
  193.                                 'name' => 'keyvisual_design',
  194.                                 'label' => $this->translator->trans('Layout Variante', [], 'admin'),
  195.                                 'config' => [
  196.                                     'defaultValue' => 'fullscreen',
  197.                                     'store' => [
  198.                                         ['fullscreen'$this->translator->trans('Vollbild (Standard)', [], 'admin')],
  199.                                         ['compact'$this->translator->trans('Kompakt mit sichtbarem Content', [], 'admin')],
  200.                                     ]
  201.                                 ]
  202.                             ],
  203.                             [
  204.                                 'type' => 'select',
  205.                                 'name' => 'keyvisual_mobile_design',
  206.                                 'label' => $this->translator->trans('Layout Variante (Mobile)', [], 'admin'),
  207.                                 'description' => $this->translator->trans('Spezifische Einstellung für mobile Geräte. Falls nicht gesetzt, wird die Desktop-Variante verwendet.', [], 'admin'),
  208.                                 'config' => [
  209.                                     'defaultValue' => 'inherit',
  210.                                     'store' => [
  211.                                         ['inherit'$this->translator->trans('Desktop-Einstellung übernehmen', [], 'admin')],
  212.                                         ['fullscreen'$this->translator->trans('Vollbild', [], 'admin')],
  213.                                         ['compact'$this->translator->trans('Kompakt mit sichtbarem Content', [], 'admin')],
  214.                                     ]
  215.                                 ]
  216.                             ],
  217.                             [
  218.                                 'type' => 'select',
  219.                                 'name' => 'content_text_alignment',
  220.                                 'label' => $this->translator->trans('Content Ausrichtung', [], 'admin'),
  221.                                 'config' => [
  222.                                     'defaultValue' => 'text-start',
  223.                                     'store' => [
  224.                                         ['text-start'$this->translator->trans('Linksbündig', [], 'admin')],
  225.                                         ['text-center'$this->translator->trans('Zentriert', [], 'admin')],
  226.                                         ['text-end'$this->translator->trans('Rechtsbündig', [], 'admin')]
  227.                                     ]
  228.                                 ]
  229.                             ],
  230.                         ]
  231.                     ],
  232.                 ]
  233.             ],
  234.             // Legacy Content Tab
  235.             [
  236.                 'type' => 'panel',
  237.                 'title' => $this->translator->trans('Alte Version', [], 'admin'),
  238.                 'layout' => 'fit',
  239.                 'autoScroll' => true,
  240.                 'bodyStyle' => 'padding: 20px',
  241.                 'items' => [
  242.                     [
  243.                         'type' => 'fieldset',
  244.                         'title' => $this->translator->trans('Einzelner Slide', [], 'admin'),
  245.                         'description' => $this->translator->trans('Diese Einstellungen werden verwendet, wenn keine Slides aktiviert sind.', [], 'admin'),
  246.                         'items' => [
  247.                             [
  248.                                 'type' => 'image',
  249.                                 'name' => 'kv-image',
  250.                                 'label' => $this->translator->trans('Desktop Bild:', [], 'admin'),
  251.                                 'description' => $this->translator->trans('Empfohlene Größe: 1920x1080px', [], 'admin')
  252.                             ],
  253.                             [
  254.                                 'type' => 'image',
  255.                                 'name' => 'kv-mobile-image',
  256.                                 'label' => $this->translator->trans('Mobile Bild:', [], 'admin'),
  257.                                 'description' => $this->translator->trans('Empfohlene Größe: 768x1024px', [], 'admin')
  258.                             ],
  259.                             [
  260.                                 'type' => $brandStyles === 'Mini' 'wysiwyg' 'input',
  261.                                 'name' => 'kv-headline',
  262.                                 'label' => $this->translator->trans('Überschrift:', [], 'admin')
  263.                             ],
  264.                             [
  265.                                 'type' => 'input',
  266.                                 'name' => 'kv-text',
  267.                                 'label' => $this->translator->trans('Text:', [], 'admin')
  268.                             ],
  269.                             [
  270.                                 'type' => 'link',
  271.                                 'name' => 'kv-link',
  272.                                 'label' => $this->translator->trans('Button Link:', [], 'admin')
  273.                             ],
  274.                             [
  275.                                 'type' => 'select',
  276.                                 'name' => 'button_style',
  277.                                 'label' => $this->translator->trans('Button Style', [], 'admin'),
  278.                                 'config' => [
  279.                                     'defaultValue' => 'btn-secondary',
  280.                                     'store' => [
  281.                                         ['btn-primary'$this->translator->trans('Blauer Button', [], 'admin')],
  282.                                         ['btn-secondary'$this->translator->trans('Outline Button', [], 'admin')]
  283.                                     ]
  284.                                 ]
  285.                             ]
  286.                         ]
  287.                     ],
  288.                     [
  289.                         'type' => 'fieldset',
  290.                         'title' => $this->translator->trans('Verbrauchshinweise', [], 'admin'),
  291.                         'description' => $this->translator->trans('Konfigurieren Sie die Anzeige der Verbrauchshinweise', [], 'admin'),
  292.                         'style' => 'margin-bottom: 15px',
  293.                         'items' => [
  294.                             [
  295.                                 'type' => 'checkbox',
  296.                                 'name' => 'show_consumption_notice',
  297.                                 'label' => $this->translator->trans('Verbrauchshinweise anzeigen', [], 'admin')
  298.                             ],
  299.                             [
  300.                                 'type' => 'checkbox',
  301.                                 'name' => 'consumption_notice_transparent',
  302.                                 'label' => $this->translator->trans('Transparenter Hintergrund', [], 'admin'),
  303.                                 'description' => $this->translator->trans('Nur Text ohne Hintergrund anzeigen', [], 'admin'),
  304.                                 'conditions' => [
  305.                                     'enabled' => [
  306.                                         'type' => 'editableRenderer',
  307.                                         'config' => [
  308.                                             'renderlet' => 'show_consumption_notice',
  309.                                             'operator' => '==',
  310.                                             'value' => true
  311.                                         ]
  312.                                     ]
  313.                                 ]
  314.                             ],
  315.                             [
  316.                                 'type' => 'select',
  317.                                 'name' => 'consumption_notice_color',
  318.                                 'label' => $this->translator->trans('Textfarbe', [], 'admin'),
  319.                                 'config' => [
  320.                                     'defaultValue' => 'white',
  321.                                     'store' => [
  322.                                         ['white'$this->translator->trans('Weiß', [], 'admin')],
  323.                                         ['black'$this->translator->trans('Schwarz', [], 'admin')]
  324.                                     ]
  325.                                 ],
  326.                                 'conditions' => [
  327.                                     'enabled' => [
  328.                                         'type' => 'editableRenderer',
  329.                                         'config' => [
  330.                                             'renderlet' => 'show_consumption_notice',
  331.                                             'operator' => '==',
  332.                                             'value' => true
  333.                                         ]
  334.                                     ]
  335.                                 ]
  336.                             ],
  337.                             [
  338.                                 'type' => 'textarea',
  339.                                 'name' => 'consumption_notice_text',
  340.                                 'label' => $this->translator->trans('Text für Verbrauchshinweise', [], 'admin'),
  341.                                 'description' => $this->translator->trans('Dieser Text wird unter dem Slider angezeigt', [], 'admin'),
  342.                                 'config' => [
  343.                                     'height' => 100
  344.                                 ],
  345.                                 'conditions' => [
  346.                                     'enabled' => [
  347.                                         'type' => 'editableRenderer',
  348.                                         'config' => [
  349.                                             'renderlet' => 'show_consumption_notice',
  350.                                             'operator' => '==',
  351.                                             'value' => true
  352.                                         ]
  353.                                     ]
  354.                                 ]
  355.                             ]
  356.                         ]
  357.                     ]
  358.                 ]
  359.             ]
  360.         ];
  361.         
  362.         // Create Tabs for all possible slides
  363.         for ($i 1$i <= $maxSlides$i++) {
  364.             $tabItems[] = [
  365.                 'type' => 'panel',
  366.                 'title' => $this->translator->trans('Slide ' $i, [], 'admin'),
  367.                 'layout' => 'fit',
  368.                 'autoScroll' => true,
  369.                 'bodyStyle' => 'padding: 20px',
  370.                 'conditions' => [
  371.                     'enabled' => [
  372.                         'type' => 'editableRenderer',
  373.                         'config' => [
  374.                             'renderlet' => 'slide_active_' $i,
  375.                             'operator' => '==',
  376.                             'value' => true
  377.                         ]
  378.                     ]
  379.                 ],
  380.                 'items' => [
  381.                     [
  382.                         'type' => 'fieldset',
  383.                         'title' => $this->translator->trans('Images', [], 'admin'),
  384.                         'items' => [
  385.                             [
  386.                                 'type' => 'image',
  387.                                 'name' => 'slide_image_' $i,
  388.                                 'label' => $this->translator->trans('Desktop Image:', [], 'admin'),
  389.                                 'description' => $this->translator->trans('Recommended size: 1920x1080px', [], 'admin'),
  390.                                 'required' => true
  391.                             ],
  392.                             [
  393.                                 'type' => 'image',
  394.                                 'name' => 'slide_mobile_image_' $i,
  395.                                 'label' => $this->translator->trans('Mobile Image:', [], 'admin'),
  396.                                 'description' => $this->translator->trans('Recommended size: 768x1024px', [], 'admin')
  397.                             ]
  398.                         ]
  399.                     ],
  400.                     [
  401.                         'type' => 'fieldset',
  402.                         'title' => $this->translator->trans('Content', [], 'admin'),
  403.                         'items' => [
  404.                             [
  405.                                 'type' => $brandStyles === 'Mini' 'wysiwyg' 'input',
  406.                                 'name' => 'content_headline_' $i,
  407.                                 'label' => $this->translator->trans('Headline', [], 'admin'),
  408.                                 'config' => $brandStyles === 'Mini' ? [
  409.                                     'enterMode' => 2,
  410.                                     'toolbarGroups' => [
  411.                                         [
  412.                                             'name' => 'basicstyles',
  413.                                             'groups' => ['basicstyles']
  414.                                         ]
  415.                                     ]
  416.                                 ] : []
  417.                             ],
  418.                             [
  419.                                 'type' => 'select',
  420.                                 'name' => 'content_headline_color_' $i,
  421.                                 'label' => $this->translator->trans('Headline Farbe', [], 'admin'),
  422.                                 'config' => [
  423.                                     'defaultValue' => 'text-white',
  424.                                     'store' => [
  425.                                         ['text-white'$this->translator->trans('Weiß (Standard)', [], 'admin')],
  426.                                         ['text-black'$this->translator->trans('Schwarz', [], 'admin')],
  427.                                         ['text-primary'$this->translator->trans('Primärfarbe', [], 'admin')],
  428.                                         ['text-secondary'$this->translator->trans('Sekundärfarbe', [], 'admin')]
  429.                                     ]
  430.                                 ]
  431.                             ],
  432.                             [
  433.                                 'type' => 'input',
  434.                                 'name' => 'content_text_' $i,
  435.                                 'label' => $this->translator->trans('Text', [], 'admin')
  436.                             ],
  437.                             [
  438.                                 'type' => 'select',
  439.                                 'name' => 'content_text_color_' $i,
  440.                                 'label' => $this->translator->trans('Text Farbe', [], 'admin'),
  441.                                 'config' => [
  442.                                     'defaultValue' => 'text-white',
  443.                                     'store' => [
  444.                                         ['text-white'$this->translator->trans('Weiß (Standard)', [], 'admin')],
  445.                                         ['text-black'$this->translator->trans('Schwarz', [], 'admin')],
  446.                                         ['text-primary'$this->translator->trans('Primärfarbe', [], 'admin')],
  447.                                         ['text-secondary'$this->translator->trans('Sekundärfarbe', [], 'admin')]
  448.                                     ]
  449.                                 ]
  450.                             ],
  451.                             [
  452.                                 'type' => 'select',
  453.                                 'name' => 'content_text_alignment_' $i,
  454.                                 'label' => $this->translator->trans('Content Ausrichtung', [], 'admin'),
  455.                                 'config' => [
  456.                                     'defaultValue' => 'inherit',
  457.                                     'store' => [
  458.                                         ['inherit'$this->translator->trans('Global Einstellung übernehmen', [], 'admin')],
  459.                                         ['text-start'$this->translator->trans('Linksbündig', [], 'admin')],
  460.                                         ['text-center'$this->translator->trans('Zentriert', [], 'admin')],
  461.                                         ['text-end'$this->translator->trans('Rechtsbündig', [], 'admin')]
  462.                                     ]
  463.                                 ]
  464.                             ]
  465.                         ]
  466.                     ],
  467.                     [
  468.                         'type' => 'fieldset',
  469.                         'title' => $this->translator->trans('Link Einstellungen', [], 'admin'),
  470.                         'items' => [
  471.                             [
  472.                                 'type' => 'checkbox',
  473.                                 'name' => 'slide_clickable_' $i,
  474.                                 'label' => $this->translator->trans('Gesamten Slide klickbar machen', [], 'admin'),
  475.                                 'description' => $this->translator->trans('Wenn aktiviert, ist der gesamte Slide klickbar', [], 'admin')
  476.                             ],
  477.                             [
  478.                                 'type' => 'checkbox',
  479.                                 'name' => 'split_view_' $i,
  480.                                 'label' => $this->translator->trans('Split-View aktivieren', [], 'admin'),
  481.                                 'description' => $this->translator->trans('Teilt den Slide in zwei klickbare Bereiche', [], 'admin')
  482.                             ],
  483.                             [
  484.                                 'type' => 'fieldset',
  485.                                 'title' => $this->translator->trans('Split-View Links', [], 'admin'),
  486.                                 'conditions' => [
  487.                                     'visible' => [
  488.                                         'type' => 'editableRenderer',
  489.                                         'config' => [
  490.                                             'renderlet' => 'split_view_' $i,
  491.                                             'operator' => '==',
  492.                                             'value' => true
  493.                                         ]
  494.                                     ]
  495.                                 ],
  496.                                 'items' => [
  497.                                     [
  498.                                         'type' => 'link',
  499.                                         'name' => 'split_left_link_' $i,
  500.                                         'label' => $this->translator->trans('Link linke Seite', [], 'admin'),
  501.                                         'description' => $this->translator->trans('Desktop: Links / Mobile: Oben', [], 'admin')
  502.                                     ],
  503.                                     [
  504.                                         'type' => 'link',
  505.                                         'name' => 'split_right_link_' $i,
  506.                                         'label' => $this->translator->trans('Link rechte Seite', [], 'admin'),
  507.                                         'description' => $this->translator->trans('Desktop: Rechts / Mobile: Unten', [], 'admin')
  508.                                     ],
  509.                                     [
  510.                                         'type' => 'select',
  511.                                         'name' => 'split_ratio_' $i,
  512.                                         'label' => $this->translator->trans('Aufteilung', [], 'admin'),
  513.                                         'description' => $this->translator->trans('Verhältnis der beiden Seiten', [], 'admin'),
  514.                                         'config' => [
  515.                                             'defaultValue' => '50-50',
  516.                                             'store' => [
  517.                                                 ['50-50''50:50'],
  518.                                                 ['40-60''40:60'],
  519.                                                 ['60-40''60:40']
  520.                                             ]
  521.                                         ]
  522.                                     ]
  523.                                 ]
  524.                             ],
  525.                             [
  526.                                 'type' => 'link',
  527.                                 'name' => 'slide_link_' $i,
  528.                                 'label' => $this->translator->trans('Slide Link', [], 'admin'),
  529.                                 'description' => $this->translator->trans('Link für den klickbaren Slide', [], 'admin'),
  530.                                 'conditions' => [
  531.                                     'visible' => [
  532.                                         'type' => 'editableRenderer',
  533.                                         'config' => [
  534.                                             'renderlet' => 'slide_clickable_' $i,
  535.                                             'operator' => '==',
  536.                                             'value' => true
  537.                                         ]
  538.                                     ]
  539.                                 ]
  540.                             ],
  541.                             [
  542.                                 'type' => 'checkbox',
  543.                                 'name' => 'show_button_' $i,
  544.                                 'label' => $this->translator->trans('Button anzeigen', [], 'admin'),
  545.                                 'description' => $this->translator->trans('Zeigt einen Button mit eigenem Link an', [], 'admin')
  546.                             ],
  547.                             [
  548.                                 'type' => 'link',
  549.                                 'name' => 'button_link_' $i,
  550.                                 'label' => $this->translator->trans('Button Link', [], 'admin'),
  551.                                 'description' => $this->translator->trans('Link für den Button', [], 'admin'),
  552.                                 'conditions' => [
  553.                                     'visible' => [
  554.                                         'type' => 'editableRenderer',
  555.                                         'config' => [
  556.                                             'renderlet' => 'show_button_' $i,
  557.                                             'operator' => '==',
  558.                                             'value' => true
  559.                                         ]
  560.                                     ]
  561.                                 ]
  562.                             ],
  563.                             [
  564.                                 'type' => 'select',
  565.                                 'name' => 'button_style_' $i,
  566.                                 'label' => $this->translator->trans('Button Style', [], 'admin'),
  567.                                 'config' => [
  568.                                     'defaultValue' => 'btn-secondary',
  569.                                     'store' => [
  570.                                         ['btn-primary'$this->translator->trans('Blauer Button', [], 'admin')],
  571.                                         ['btn-secondary'$this->translator->trans('Outline Button', [], 'admin')]
  572.                                     ]
  573.                                 ],
  574.                                 'conditions' => [
  575.                                     'visible' => [
  576.                                         'type' => 'editableRenderer',
  577.                                         'config' => [
  578.                                             'renderlet' => 'show_button_' $i,
  579.                                             'operator' => '==',
  580.                                             'value' => true
  581.                                         ]
  582.                                     ]
  583.                                 ]
  584.                             ]
  585.                         ]
  586.                     ],
  587.                     [
  588.                         'type' => 'fieldset',
  589.                         'title' => $this->translator->trans('Verbrauchshinweis', [], 'admin'),
  590.                         'items' => [
  591.                             [
  592.                                 'type' => 'checkbox',
  593.                                 'name' => 'consumption_notice_active_' $i,
  594.                                 'label' => $this->translator->trans('Verbrauchshinweis anzeigen', [], 'admin')
  595.                             ],
  596.                             [
  597.                                 'type' => 'input',
  598.                                 'name' => 'consumption_notice_text_' $i,
  599.                                 'label' => $this->translator->trans('Text', [], 'admin'),
  600.                                 'conditions' => [
  601.                                     'visible' => [
  602.                                         'type' => 'editableRenderer',
  603.                                         'config' => [
  604.                                             'renderlet' => 'consumption_notice_active_' $i,
  605.                                             'operator' => '==',
  606.                                             'value' => true
  607.                                         ]
  608.                                     ]
  609.                                 ]
  610.                             ],
  611.                             [
  612.                                 'type' => 'select',
  613.                                 'name' => 'consumption_notice_color_' $i,
  614.                                 'label' => $this->translator->trans('Textfarbe', [], 'admin'),
  615.                                 'config' => [
  616.                                     'defaultValue' => 'white',
  617.                                     'store' => [
  618.                                         ['value' => 'white''text' => $this->translator->trans('Weiß', [], 'admin')],
  619.                                         ['value' => 'black''text' => $this->translator->trans('Schwarz', [], 'admin')]
  620.                                     ]
  621.                                 ],
  622.                                 'conditions' => [
  623.                                     'visible' => [
  624.                                         'type' => 'editableRenderer',
  625.                                         'config' => [
  626.                                             'renderlet' => 'consumption_notice_active_' $i,
  627.                                             'operator' => '==',
  628.                                             'value' => true
  629.                                         ]
  630.                                     ]
  631.                                 ]
  632.                             ],
  633.                             [
  634.                                 'type' => 'select',
  635.                                 'name' => 'consumption_notice_alignment_' $i,
  636.                                 'label' => $this->translator->trans('Textausrichtung', [], 'admin'),
  637.                                 'config' => [
  638.                                     'defaultValue' => 'text-center',
  639.                                     'store' => [
  640.                                         ['text-center'$this->translator->trans('Zentriert', [], 'admin')],
  641.                                         ['text-start'$this->translator->trans('Linksbündig', [], 'admin')],
  642.                                         ['text-end'$this->translator->trans('Rechtsbündig', [], 'admin')]
  643.                                     ]
  644.                                 ],
  645.                                 'conditions' => [
  646.                                     'visible' => [
  647.                                         'type' => 'editableRenderer',
  648.                                         'config' => [
  649.                                             'renderlet' => 'consumption_notice_active_' $i,
  650.                                             'operator' => '==',
  651.                                             'value' => true
  652.                                         ]
  653.                                     ]
  654.                                 ]
  655.                             ],
  656.                             [
  657.                                 'type' => 'checkbox',
  658.                                 'name' => 'consumption_notice_transparent_' $i,
  659.                                 'label' => $this->translator->trans('Transparenter Hintergrund', [], 'admin'),
  660.                                 'conditions' => [
  661.                                     'visible' => [
  662.                                         'type' => 'editableRenderer',
  663.                                         'config' => [
  664.                                             'renderlet' => 'consumption_notice_active_' $i,
  665.                                             'operator' => '==',
  666.                                             'value' => true
  667.                                         ]
  668.                                     ]
  669.                                 ]
  670.                             ]
  671.                         ]
  672.                     ]
  673.                 ]
  674.             ];
  675.         }
  676.         
  677.         $config->setItems([
  678.             'type' => 'tabpanel',
  679.             'layout' => 'fit',
  680.             'id' => 'keyvisual-config-tabs',
  681.             'bodyStyle' => 'padding: 0',
  682.             'items' => $tabItems
  683.         ]);
  684.         
  685.         $config->setReloadOnClose(true);
  686.         
  687.         return $config;
  688.     }
  689.     public function getHtmlTagOpen(Info $info): string
  690.     {
  691.         return '';
  692.     }
  693.     public function getHtmlTagClose(Info $info): string
  694.     {
  695.         return '';
  696.     }
  697. }