]> _ Git - fluidbook-toolbox.git/commitdiff
wait #5112 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 30 May 2022 13:38:39 +0000 (15:38 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 30 May 2022 13:38:39 +0000 (15:38 +0200)
app/Jobs/LegacyBookSettingsGenerate.php
app/Models/Traits/PublicationSettings.php

index 37f1b78e84281e8b48fb8bcac66f2939316b76de..2878e290cf50f04e06d36b77d465bee14795efa3 100644 (file)
@@ -4,8 +4,10 @@ namespace App\Jobs;
 
 use App\Models\Traits\PublicationSettings;
 use Cubist\Backpack\Magic\BunchOfFields;
+use Cubist\Backpack\Magic\Fields\FormBigSection;
 use Cubist\Backpack\Magic\Fields\FormSection;
 use Cubist\Backpack\Magic\Fields\FormSeparator;
+use Cubist\Backpack\Magic\Fields\FormSuperSection;
 use Cubist\Util\PHP;
 
 class LegacyBookSettingsGenerate extends Base
@@ -22,6 +24,9 @@ class LegacyBookSettingsGenerate extends Base
         $currentForm = null;
 
         foreach ($this->getFields() as $field) {
+            if($field instanceof FormSuperSection){
+                continue;
+            }
             if ($field instanceof FormSection) {
                 if (null !== $currentForm) {
                     $key = $currentForm['key'];
@@ -48,6 +53,10 @@ class LegacyBookSettingsGenerate extends Base
                     $f['datas'] = array_flip($field->getAttribute('options'));
                 }
             }
+            $map = ['label' => 'label', 'default' => 'default'];
+            foreach ($map as $k => $v) {
+                $f[$k] = $field->getAttribute($v);
+            }
             $fields[$field->getName()] = $f;
         }
         $forms[] = $currentForm;
index 659615fc8e00033f29366504262a7e392d3b2bb8..27ad4f8d39ca45c55c59905c1a1fbbe939289a55 100644 (file)
@@ -1457,6 +1457,13 @@ trait PublicationSettings
             'store_in' => 'settings',
             'translatable' => false,
         ]);
+        $this->addField('tagcommander_event_page', Textarea::class, __('Nom de l\'évenement de vue de page'), [
+            'v2' => '{"type":"text","default":"page","editable":true,"grade":3}',
+            'default' => 'page',
+            'fake' => true,
+            'store_in' => 'settings',
+            'translatable' => false,
+        ]);
         $this->addField('tagcommander_default_vars', Textarea::class, 'Variables par défaut', [
             'v2' => '{"type":"textarea","default":"","editable":true,"label":"Variables par d\\u00e9faut","grade":3}',
             'default' => '',