From: Vincent Vanwaelscappel Date: Fri, 7 Feb 2025 14:46:12 +0000 (+0100) Subject: wip #7302 @3 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=140e6daaf7c75aca00b827d5c78e85242464f46e;p=fluidbook-toolbox.git wip #7302 @3 --- diff --git a/app/SubForms/Link/Animated.php b/app/SubForms/Link/Animated.php index e20462946..e626bfad4 100644 --- a/app/SubForms/Link/Animated.php +++ b/app/SubForms/Link/Animated.php @@ -10,6 +10,7 @@ class Animated extends Base protected $_addedContents = false; protected $_tooltip = false; protected $_extra = false; + protected $_stats = false; public function addDestinationField() { diff --git a/app/SubForms/Link/Base.php b/app/SubForms/Link/Base.php index 78a2c1817..c60a5bba4 100644 --- a/app/SubForms/Link/Base.php +++ b/app/SubForms/Link/Base.php @@ -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 */ diff --git a/app/SubForms/Link/Meta.php b/app/SubForms/Link/Meta.php index f9a3a15ba..692c818d3 100644 --- a/app/SubForms/Link/Meta.php +++ b/app/SubForms/Link/Meta.php @@ -8,5 +8,6 @@ class Meta extends Base protected $_addedContents = false; protected $_tooltip = false; protected $_extra = false; + protected $_stats = false; protected $_uid = false; }