]> _ Git - fluidbook-toolbox.git/commitdiff
wip #7302 @3
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 7 Feb 2025 14:46:12 +0000 (15:46 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 7 Feb 2025 14:46:12 +0000 (15:46 +0100)
app/SubForms/Link/Animated.php
app/SubForms/Link/Base.php
app/SubForms/Link/Meta.php

index e204629464e906c9a47e0f650c535b0c8f483b94..e626bfad422deee7177ba3335d91b66c3091d4a0 100644 (file)
@@ -10,6 +10,7 @@ class Animated extends Base
     protected $_addedContents = false;
     protected $_tooltip = false;
     protected $_extra = false;
+    protected $_stats = false;
 
     public function addDestinationField()
     {
index 78a2c18172b767df9cd21e05eb50bd6309b5cc05..c60a5bba478055f1b07a914d18aa8940f30e62fd 100644 (file)
@@ -44,6 +44,7 @@ class Base extends Form
     protected $_addedContents = true;
     protected $_tooltip = true;
     protected $_extra = true;
+    protected $_stats = true;
     protected $_uid = true;
 
     protected $_canContainLinks = false;
@@ -173,6 +174,7 @@ class Base extends Form
         $this->addTooltipFields();
         $this->addPositionFields();
         $this->addExtraFields();
+        $this->addStatsFields();
     }
 
     public function addTooltipFields()
@@ -210,9 +212,9 @@ class Base extends Form
 
     public function addBasicSettingsFields()
     {
-        if ($this->_integration==='multimedia') {
+        if ($this->_integration === 'multimedia') {
             $this->addField('inline', MultimediaIntegration::class, __('Intégration'));
-        }else if($this->_integration==='webvideo'){
+        } else if ($this->_integration === 'webvideo') {
             $this->addField('inline', WebvideoIntegration::class, __('Intégration'));
         }
 
@@ -287,6 +289,15 @@ class Base extends Form
         }
     }
 
+    public function addStatsFields()
+    {
+        if ($this->hasField('stats') || !$this->_stats) {
+            return;
+        }
+        $this->addField('header_stats', FormSection::class, __('Statistiques'));
+        $this->addField('stats', Textarea::class, '');
+    }
+
     protected function _getHTMLAttributes()
     {
         return ['class'];
@@ -356,7 +367,7 @@ class Base extends Form
         }
 
         $id = 1;
-        $base = ['top' => 1, 'left' => 1, 'width' => 1, 'height' => 1, 'to' => '', 'inline' => 'inline', 'page' => 2, 'target' => '_blank', 'extra' => '', 'interactive' => false,'video_service'=>'youtube'];
+        $base = ['top' => 1, 'left' => 1, 'width' => 1, 'height' => 1, 'to' => '', 'inline' => 'inline', 'page' => 2, 'target' => '_blank', 'extra' => '', 'interactive' => false, 'video_service' => 'youtube', 'stats' => ''];
         $compiler = new Compiler($fluidbook);
 
         /** @var Link $instances */
index f9a3a15ba2cd72b0fb768da134ae9fe55ca9bd6c..692c818d38ea823125deda6b46b53eb926b5ce47 100644 (file)
@@ -8,5 +8,6 @@ class Meta extends Base
     protected $_addedContents = false;
     protected $_tooltip = false;
     protected $_extra = false;
+    protected $_stats = false;
     protected $_uid = false;
 }