]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5468 @4
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 14 Nov 2022 17:15:21 +0000 (18:15 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 14 Nov 2022 17:15:21 +0000 (18:15 +0100)
26 files changed:
app/Fields/FluidbookLinkEditor/Action.php
app/SubForms/Link/Anchor.php [new file with mode: 0644]
app/SubForms/Link/Animated.php [new file with mode: 0644]
app/SubForms/Link/Article.php [new file with mode: 0644]
app/SubForms/Link/ArticleOpen.php [new file with mode: 0644]
app/SubForms/Link/Audiodescription.php
app/SubForms/Link/Base.php
app/SubForms/Link/BookmarkGroup.php [new file with mode: 0644]
app/SubForms/Link/Cart.php [new file with mode: 0644]
app/SubForms/Link/Color.php [new file with mode: 0644]
app/SubForms/Link/Custom.php [new file with mode: 0644]
app/SubForms/Link/DownloadPortion.php [new file with mode: 0644]
app/SubForms/Link/Email.php
app/SubForms/Link/EventOverlay.php [new file with mode: 0644]
app/SubForms/Link/Image.php [new file with mode: 0644]
app/SubForms/Link/Layer.php [new file with mode: 0644]
app/SubForms/Link/Like.php [new file with mode: 0644]
app/SubForms/Link/LockContents.php [new file with mode: 0644]
app/SubForms/Link/Meta.php
app/SubForms/Link/ShowLink.php [new file with mode: 0644]
app/SubForms/Link/StatsTag.php [new file with mode: 0644]
app/SubForms/Link/Text.php [new file with mode: 0644]
app/SubForms/Link/Tooltip.php [new file with mode: 0644]
app/SubForms/Link/TriggerLink.php [new file with mode: 0644]
app/SubForms/Link/ZoomArea.php [new file with mode: 0644]
app/SubForms/Link/ZoomHD.php [new file with mode: 0644]

index 599ec9788a89affcf1b1f32a25ffe19fed8e204f..f19a1b0713722e6be4d5e593138393fc822630d4 100644 (file)
@@ -12,7 +12,7 @@ class Action extends SelectFromArray
     {
 
         return [
-            'index' => __("Basculer entre la publication et l'index"),
+            'index' => __("Afficher l'index"),
             'chapters' => __('Afficher le sommaire'),
             'print' => __('Imprimer'),
             'share' => __('Partager par e-mail'),
diff --git a/app/SubForms/Link/Anchor.php b/app/SubForms/Link/Anchor.php
new file mode 100644 (file)
index 0000000..c1aff03
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+namespace App\SubForms\Link;
+
+class Anchor extends Meta
+{
+    public $type = self::ANCHOR;
+
+    protected $_extra = false;
+
+    public function addDestinationField()
+    {
+        $this->addField('to', \Cubist\Backpack\Magic\Fields\Text::class, __('Label de la page / Nom de l\'ancre'));
+    }
+}
diff --git a/app/SubForms/Link/Animated.php b/app/SubForms/Link/Animated.php
new file mode 100644 (file)
index 0000000..208659e
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+
+namespace App\SubForms\Link;
+
+use Cubist\Backpack\Magic\Fields\Textarea;
+
+class Animated extends Base
+{
+    protected $_addedContents = false;
+    protected $_tooltip = false;
+    protected $_extra = false;
+
+    public function addDestinationField()
+    {
+
+        $this->addField('image_rollover', Textarea::class, __('Animation'));
+    }
+}
diff --git a/app/SubForms/Link/Article.php b/app/SubForms/Link/Article.php
new file mode 100644 (file)
index 0000000..64838a5
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+
+namespace App\SubForms\Link;
+
+use Cubist\Backpack\Magic\Fields\FilesOrURL;
+use Cubist\Backpack\Magic\Fields\Textarea;
+
+class Article extends Meta
+{
+    public $type = self::ARTICLE;
+
+    public function addDestinationField()
+    {
+        $this->addField('to', \Cubist\Backpack\Magic\Fields\Text::class, __('Titre de l\'article'));
+        $this->addField('image', FilesOrURL::class, __('Image'), $this->getFilesOrURLEntry() + ['accept' => self::$_acceptImage]);
+        $this->addField('extra', Textarea::class, __('Contenu de l\'article'));
+    }
+}
diff --git a/app/SubForms/Link/ArticleOpen.php b/app/SubForms/Link/ArticleOpen.php
new file mode 100644 (file)
index 0000000..2d0e37d
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+namespace App\SubForms\Link;
+
+use Cubist\Backpack\Magic\Fields\FilesOrURL;
+
+class ArticleOpen extends Base
+{
+    public $type = self::ARTICLE_OPEN;
+
+    public function addDestinationField()
+    {
+        $this->addField('to', FilesOrURL::class, __('Identifiant de l\'article ou PDF'), $this->getFilesOrURLEntry() + ['accept' => self::$_acceptPDF]);
+    }
+}
index 57d36c1a7d0f70a9f7549b46e9683b6de2bbca0c..06e0bc5d979379575367620d9277bf8c9c1372aa 100644 (file)
@@ -6,6 +6,8 @@ use Cubist\Backpack\Magic\Fields\FilesOrURL;
 
 class Audiodescription extends Meta
 {
+    public $type = self::AUDIODESCRIPTION;
+
     public function addDestinationField()
     {
         $this->addField('to', FilesOrURL::class, __('Fichier audio ou texte'), $this->getFilesOrURLEntry() + ['accept' => self::$_acceptAudiodescription]);
index c871b59ab0fff9d39b3dd65feb393753365f617c..ea12795265d57602210726c580d36fce5918b88d 100644 (file)
@@ -12,6 +12,7 @@ use Cubist\Backpack\Magic\Fields\FieldGroupEnd;
 use Cubist\Backpack\Magic\Fields\FieldGroupStart;
 use Cubist\Backpack\Magic\Fields\FilesOrURL;
 use Cubist\Backpack\Magic\Fields\FormSection;
+use Cubist\Backpack\Magic\Fields\Hidden;
 use Cubist\Backpack\Magic\Fields\Number;
 use Cubist\Backpack\Magic\Fields\Text;
 use Cubist\Backpack\Magic\Fields\Textarea;
@@ -66,6 +67,11 @@ class Base extends Form
     const FLIPCARD = 41;
 
 
+    /**
+     * @var int
+     */
+    public $type = 0;
+
     /**
      * @var int
      */
@@ -76,6 +82,8 @@ class Base extends Form
     protected $_multimedia = false;
     protected $_addedContents = true;
     protected $_tooltip = true;
+    protected $_extra = true;
+    protected $_uid = true;
 
     protected static $_acceptImage = ['.jpg', '.jpeg', '.png', '.svg', '.gif'];
     protected static $_acceptImageAZip = ['.jpg', '.jpeg', '.png', '.svg', '.gif', '.zip'];
@@ -96,47 +104,45 @@ class Base extends Form
     public static function types()
     {
         $res = [
-            ['type' => self::WEB, 'label' => __('Lien web'), 'color' => '#3399cc', 'class' => Web::class, 'order' => 1],
+            ['type' => self::WEB, 'label' => __('Adresse Web (URL)'), 'color' => '#3399cc', 'class' => Web::class, 'order' => 1],
             ['type' => self::INTERNAL, 'label' => __('Lien vers une page'), 'color' => '#c7b405', 'class' => Internal::class, 'order' => 2],
             ['type' => self::EMAIL, 'label' => __('Adresse e-mail'), 'color' => '#6c6360', 'class' => Email::class, 'order' => 3],
-            ['type' => self::WEB_INFOS, 'label' => __('Lien web « plus d\'infos »'), 'color' => '#ff0000', 'class' => WebInfos::class],
-            ['type' => self::COLOR, 'label' => __('Couleur'), 'color' => '#8C5E24', 'class' => Web::class, 'order' => 4],
+            ['type' => self::WEB_INFOS, 'label' => __('Adresse web « plus d\'infos »'), 'color' => '#ff0000', 'class' => WebInfos::class],
+            ['type' => self::COLOR, 'label' => __('Couleur'), 'color' => '#8C5E24', 'class' => Color::class, 'order' => 4],
             ['type' => self::VIDEO, 'label' => __('Vidéo'), 'color' => '#33ff00', 'class' => Video::class],
             ['type' => self::MULTIMEDIA, 'label' => __('Multimédia'), 'color' => '#ff00ff', 'class' => Multimedia::class],
             ['type' => 'separator', 'order' => 5],
-            ['type' => self::CUSTOM, 'label' => __('Lien personnalisé'), 'color' => '#14511a', 'class' => Web::class],
+            ['type' => self::CUSTOM, 'label' => __('Personnalisé'), 'color' => '#14511a', 'class' => Custom::class],
             //['type' => self::PAGE_CORNER, 'label' => __('Coin de page'), 'color' => '#f19043', 'disabled' => true, 'class' => Web::class],
             //['type' => self::OBJECT3D, 'label' => __('Objet 3D'), 'color' => '#00ffff', 'disabled' => true, 'class' => Web::class],
             ['type' => self::WEBVIDEO, 'label' => __('Vidéo web'), 'color' => '#ffff00', 'class' => WebVideo::class],
-            ['type' => self::ACTION, 'label' => __('Action'), 'color' => '#880000', 'class' => Web::class],
-            ['type' => self::CART, 'label' => __('Panier'), 'color' => '#F2A4B7', 'class' => Web::class],
-            ['type' => self::ZOOM, 'label' => __('Zone de zoom'), 'color' => '#322280', 'class' => Web::class],
-            ['type' => self::IMAGE, 'label' => __('Image'), 'color' => '#BE418D', 'class' => Web::class],
+            //['type' => self::ACTION, 'label' => __('Action'), 'color' => '#880000', 'class' => Action::class],
+            ['type' => self::CART, 'label' => __('Panier'), 'color' => '#F2A4B7', 'class' => Cart::class],
+            ['type' => self::ZOOM, 'label' => __('Zone de zoom'), 'color' => '#322280', 'class' => ZoomArea::class],
+            ['type' => self::IMAGE, 'label' => __('Image'), 'color' => '#BE418D', 'class' => Image::class],
             ['type' => self::FILE, 'label' => __('Fichier'), 'color' => '#F19043', 'class' => File::class],
             ['type' => self::AUDIO, 'label' => __('Audio'), 'color' => '#0065AE', 'class' => Audio::class],
-            ['type' => self::TOOLTIP, 'label' => __('Texte / Infobulle'), 'color' => '#000000', 'class' => Web::class],
-            ['type' => self::CALL, 'label' => __('Appel'), 'color' => '#333333', 'class' => Web::class],
-            ['type' => self::BOOKMARKGROUP, 'label' => __('Groupe de marque-pages'), 'color' => '#d6520f', 'class' => Web::class],
+            ['type' => self::TOOLTIP, 'label' => __('Infobulle / Texte'), 'color' => '#20c45b', 'class' => Tooltip::class],
+            ['type' => self::BOOKMARKGROUP, 'label' => __('Groupe de marque-pages'), 'color' => '#d6520f', 'class' => BookmarkGroup::class],
             //['type' => self::HTML5MULTIMEDIA, 'label' => __('Lien Multimédia (HTML)'), 'color' => '#34A853', 'disabled' => true, 'class' => Web::class],
             //['type' => self::BOOKMARK_CORNER, 'label' => __('Lien marque-page sur coin de page'), 'color' => '#000000', 'disabled' => true, 'class' => Web::class],
-            ['type' => self::STATSTAG, 'label' => __('Tag statistique'), 'color' => '#000000', 'class' => Web::class],
-            ['type' => self::PHONE, 'label' => __('Téléphone'), 'color' => '#000000', 'class' => Phone::class],
+            ['type' => self::STATSTAG, 'label' => __('Tag statistique'), 'color' => '#dddddd', 'class' => StatsTag::class],
+            ['type' => self::PHONE, 'label' => __('Téléphone'), 'color' => '#333333', 'class' => Phone::class],
             ['type' => self::AUDIODESCRIPTION, 'label' => __('Audiodescription'), 'color' => '#00535b', 'class' => Audiodescription::class],
-            ['type' => self::PAGE_LABEL, 'label' => __('Label de page'), 'color' => '#00E6D7', 'class' => Web::class],
-            ['type' => self::EVENT_OVERLAY, 'label' => __('Capter les évenements'), 'color' => '#ffcc00', 'class' => Web::class],
-            ['type' => self::ARTICLE, 'label' => __('Article (définition)'), 'color' => '#ACC152', 'class' => Web::class],
-            ['type' => self::LIKE, 'label' => __('Like'), 'color' => '#4267B2', 'class' => Web::class],
+            ['type' => self::ANCHOR, 'label' => __('Ancre / Label de page'), 'color' => '#00E6D7', 'class' => Anchor::class],
+            ['type' => self::EVENT_OVERLAY, 'label' => __('Capter les évenements'), 'color' => '#ffcc00', 'class' => EventOverlay::class],
+            ['type' => self::ARTICLE, 'label' => __('Article (définition)'), 'color' => '#ACC152', 'class' => Article::class],
+            ['type' => self::LIKE, 'label' => __('Like'), 'color' => '#4267B2', 'class' => Like::class],
             ['type' => self::SLIDESHOW, 'label' => __('Diaporama'), 'color' => '#07b57a', 'class' => Slideshow::class],
             ['type' => self::IFRAME, 'label' => __('iFrame'), 'color' => '#fcae25', 'class' => IFrame::class],
-            ['type' => self::SHOWLINK, 'label' => __('Afficher un lien'), 'color' => '#125C70', 'class' => Web::class],
-            ['type' => self::ZOOMHD, 'label' => __('Zoom HD'), 'color' => '#E80C95', 'class' => Web::class],
-            ['type' => self::LOCK_CONTENTS, 'label' => __('Blocage des contenus'), 'color' => '#69D670', 'class' => Web::class],
-            ['type' => self::TEXT, 'label' => __('Texte'), 'color' => '#9090FF', 'class' => Web::class],
-            ['type' => self::ARTICLE_OPEN, 'label' => __('Afficher un article'), 'color' => '#ffcc00', 'class' => Web::class],
-            ['type' => self::DOWNLOAD_PORTION, 'label' => __('Télécharger un extrait'), 'color' => '#AAAAAA', 'class' => Web::class],
-            ['type' => self::TRIGGERSLINK, 'label' => __('Déclencher un lien'), 'color' => '#cc0000', 'class' => Web::class],
-            ['type' => self::LAYER, 'label' => __('Animation de calque'), 'color' => '#3D0254', 'class' => Web::class],
-            ['type' => self::ANCHOR, 'label' => __('Ancre'), 'color' => '#330000', 'class' => Web::class],
+            ['type' => self::SHOWLINK, 'label' => __('Afficher un lien'), 'color' => '#125C70', 'class' => ShowLink::class],
+            ['type' => self::ZOOMHD, 'label' => __('Zoom HD'), 'color' => '#E80C95', 'class' => ZoomHD::class],
+            ['type' => self::LOCK_CONTENTS, 'label' => __('Blocage des contenus'), 'color' => '#69D670', 'class' => LockContents::class],
+            ['type' => self::TEXT, 'label' => __('Texte'), 'color' => '#9090FF', 'class' => \App\SubForms\Link\Text::class],
+            ['type' => self::ARTICLE_OPEN, 'label' => __('Article (afficher)'), 'color' => '#ffcc00', 'class' => ArticleOpen::class],
+            ['type' => self::DOWNLOAD_PORTION, 'label' => __('Télécharger un extrait'), 'color' => '#AAAAAA', 'class' => DownloadPortion::class],
+            ['type' => self::TRIGGERSLINK, 'label' => __('Déclencher un lien'), 'color' => '#cc0000', 'class' => TriggerLink::class],
+            ['type' => self::LAYER, 'label' => __('Animation de calque'), 'color' => '#3D0254', 'class' => Layer::class],
             ['type' => self::FLIPCARD, 'label' => __('Flipcard'), 'color' => '#460e3f', 'class' => Flipcard::class],
         ];
 
@@ -181,7 +187,7 @@ class Base extends Form
         if (!$this->_tooltip) {
             return;
         }
-        $this->addField('header_tooltip', FormSection::class, __('Infobulles'));
+        $this->addField('header_tooltip', FormSection::class, __('Infobulle'));
         $this->addField('tooltip', Text::class, __('Texte de l\'infobulle'), ['hint' => __('Laisser vide pour conserver le texte par défaut')]);
         $this->addField('display_area', Checkbox::class, __('Afficher la zone de couleur au survol'), ['default' => true]);
     }
@@ -198,7 +204,7 @@ class Base extends Form
 
     public function addUIDField()
     {
-        $this->addField('uid', Text::class, __('Identifiant unique'));
+        $this->addField('uid', $this->_uid ? Text::class : Hidden::class, __('Identifiant unique'));
     }
 
     public function addSettingsFields()
@@ -270,7 +276,7 @@ class Base extends Form
 
     public function addExtraFields()
     {
-        if ($this->hasField('extra')) {
+        if ($this->hasField('extra') || !$this->_extra) {
             return;
         }
         $this->addField('header_extra', FormSection::class, __('Autres paramètres'));
diff --git a/app/SubForms/Link/BookmarkGroup.php b/app/SubForms/Link/BookmarkGroup.php
new file mode 100644 (file)
index 0000000..1609b93
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+
+namespace App\SubForms\Link;
+
+use Cubist\Backpack\Magic\Fields\Integer;
+
+class BookmarkGroup extends Meta
+{
+    public $type = self::BOOKMARKGROUP;
+
+    public function addDestinationField()
+    {
+        $this->addField('to', Integer::class, __('Nombre de pages du groupe'));
+        $this->addField('extra', \Cubist\Backpack\Magic\Fields\Text::class, __('Nom du groupe'));
+    }
+}
diff --git a/app/SubForms/Link/Cart.php b/app/SubForms/Link/Cart.php
new file mode 100644 (file)
index 0000000..9b6873b
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+namespace App\SubForms\Link;
+
+use Cubist\Backpack\Magic\Fields\Text;
+
+class Cart extends Base
+{
+    public $type = self::CART;
+
+    public function addDestinationField()
+    {
+        $this->addField('to', Text::class, __('Référence produit'));
+    }
+}
diff --git a/app/SubForms/Link/Color.php b/app/SubForms/Link/Color.php
new file mode 100644 (file)
index 0000000..06913b8
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+namespace App\SubForms\Link;
+
+
+class Color extends Animated
+{
+    public $type = self::COLOR;
+
+    public function addDestinationField()
+    {
+        $this->addField('to', \Cubist\Backpack\Magic\Fields\Color::class, __('Couleur'));
+        parent::addDestinationField();
+    }
+}
diff --git a/app/SubForms/Link/Custom.php b/app/SubForms/Link/Custom.php
new file mode 100644 (file)
index 0000000..9eec1d4
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+namespace App\SubForms\Link;
+
+use Cubist\Backpack\Magic\Fields\FilesOrURL;
+
+class Custom extends Base
+{
+    public $type = self::CUSTOM;
+
+    public function addDestinationField()
+    {
+        $this->addField('to', FilesOrURL::class, __(' Contenu'), $this->getFilesOrURLEntry());
+    }
+}
diff --git a/app/SubForms/Link/DownloadPortion.php b/app/SubForms/Link/DownloadPortion.php
new file mode 100644 (file)
index 0000000..6390cb9
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+namespace App\SubForms\Link;
+
+use Cubist\Backpack\Magic\Fields\Text;
+
+class DownloadPortion extends Base
+{
+    public $type = self::DOWNLOAD_PORTION;
+
+    public function addDestinationField()
+    {
+        $this->addField('to', Text::class, __('Nom du fichier téléchargé'));
+    }
+}
index 04b6cda96a4b9dcf9f22bd32b0ea7440bcff5106..3c47e4aee62527d419e5d2c4510639bb3ab6b69c 100644 (file)
@@ -2,7 +2,6 @@
 
 namespace App\SubForms\Link;
 
-use Cubist\Backpack\Magic\Fields\URL;
 
 class Email extends Web
 {
diff --git a/app/SubForms/Link/EventOverlay.php b/app/SubForms/Link/EventOverlay.php
new file mode 100644 (file)
index 0000000..6d9a613
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+
+namespace App\SubForms\Link;
+
+class EventOverlay extends Meta
+{
+    public $type = self::EVENT_OVERLAY;
+}
diff --git a/app/SubForms/Link/Image.php b/app/SubForms/Link/Image.php
new file mode 100644 (file)
index 0000000..1cbdc86
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+
+namespace App\SubForms\Link;
+
+use Cubist\Backpack\Magic\Fields\FilesOrURL;
+
+class Image extends Animated
+{
+    public $type = self::IMAGE;
+
+    public function addDestinationField()
+    {
+        $this->addField('to', FilesOrURL::class, __('Image'), $this->getFilesOrURLEntry() + ['accept' => self::$_acceptImage]);
+        parent::addDestinationField();
+    }
+}
diff --git a/app/SubForms/Link/Layer.php b/app/SubForms/Link/Layer.php
new file mode 100644 (file)
index 0000000..82aeba3
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+
+namespace App\SubForms\Link;
+
+use Cubist\Backpack\Magic\Fields\Hidden;
+
+class Layer extends Animated
+{
+    public $type = self::LAYER;
+
+    public function addDestinationField()
+    {
+        $this->addField("to", Hidden::class, __('Animer le(s) calque(s)'));
+        parent::addDestinationField();
+    }
+}
diff --git a/app/SubForms/Link/Like.php b/app/SubForms/Link/Like.php
new file mode 100644 (file)
index 0000000..7289b7a
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+
+namespace App\SubForms\Link;
+
+use Cubist\Backpack\Magic\Fields\URL;
+
+class Like extends Base
+{
+    public $type = self::LIKE;
+
+    protected $_extra = false;
+    protected $_addedContents = false;
+
+    public function addDestinationField()
+    {
+        $this->addField('to', URL::class, __('URL à liker'));
+    }
+}
diff --git a/app/SubForms/Link/LockContents.php b/app/SubForms/Link/LockContents.php
new file mode 100644 (file)
index 0000000..1c495a5
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+namespace App\SubForms\Link;
+
+use Cubist\Backpack\Magic\Fields\Textarea;
+
+class LockContents extends Meta
+{
+    public $type = self::LOCK_CONTENTS;
+
+    public function addDestinationField()
+    {
+        $this->addField('to', Textarea::class, __('Conditions de déblocage'));
+    }
+}
index d7c4395679839261c06190f1ed1aabc3ee17c02a..7e280dbf7bd568611aec58211bbdffcc076cad0b 100644 (file)
@@ -7,4 +7,6 @@ class Meta extends Base
     protected $_displayedOnFluidbook = false;
     protected $_addedContents = false;
     protected $_tooltip = false;
+    protected $_extra = false;
+    protected $_uid = false;
 }
diff --git a/app/SubForms/Link/ShowLink.php b/app/SubForms/Link/ShowLink.php
new file mode 100644 (file)
index 0000000..c0ce785
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+
+namespace App\SubForms\Link;
+
+use App\Fields\FluidbookLinkEditor\ShowLinkCloseMode;
+use App\Fields\FluidbookLinkEditor\ShowLinkMode;
+use Cubist\Backpack\Magic\Fields\Text;
+
+class ShowLink extends Base
+{
+    public $type = self::SHOWLINK;
+
+    public function addDestinationField()
+    {
+        $this->addField('to', Text::class, __('Identifiant du lien à afficher'));
+        $this->addField('target', ShowLinkMode::class, __('Mode'));
+        $this->addField('video_service', ShowLinkCloseMode::class, __('Placer un bouton de fermeture'));
+    }
+}
diff --git a/app/SubForms/Link/StatsTag.php b/app/SubForms/Link/StatsTag.php
new file mode 100644 (file)
index 0000000..3f10d9c
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+
+namespace App\SubForms\Link;
+
+class StatsTag extends Base
+{
+    protected $_tooltip = false;
+    protected $_addedContents = false;
+    protected $_extra=false;
+
+    public $type = self::STATSTAG;
+
+    public function addDestinationField()
+    {
+        $this->addField('to', \Cubist\Backpack\Magic\Fields\Text::class, __('Tag'));
+    }
+}
diff --git a/app/SubForms/Link/Text.php b/app/SubForms/Link/Text.php
new file mode 100644 (file)
index 0000000..cddccac
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+
+namespace App\SubForms\Link;
+
+use Cubist\Backpack\Magic\Fields\FilesOrURL;
+
+class Text extends Animated
+{
+    public $type = self::TEXT;
+
+    public function addDestinationField()
+    {
+        $this->addField('to', \Cubist\Backpack\Magic\Fields\Text::class, __('Texte'));
+        $this->addField('extra', \Cubist\Backpack\Magic\Fields\Color::class, __('Couleur du texte'));
+        $this->addField('image', FilesOrURL::class, __('Police'), $this->getFilesOrURLEntry() + ['accept' => self::$_acceptFont]);
+        parent::addDestinationField();
+    }
+}
diff --git a/app/SubForms/Link/Tooltip.php b/app/SubForms/Link/Tooltip.php
new file mode 100644 (file)
index 0000000..ebc00e7
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+
+namespace App\SubForms\Link;
+
+use Cubist\Backpack\Magic\Fields\Checkbox;
+use Cubist\Backpack\Magic\Fields\FormSection;
+use Cubist\Backpack\Magic\Fields\Textarea;
+
+class Tooltip extends Base
+{
+    public function initForm()
+    {
+        $this->addTypeField();
+        $this->addTooltipFields();
+        $this->addPositionFields();
+        $this->addExtraFields();
+    }
+
+    public function addTooltipFields()
+    {
+        if (!$this->_tooltip) {
+            return;
+        }
+        $this->addField('header_tooltip', FormSection::class, __('Paramètres'));
+        $this->addField('tooltip', Textarea::class, __('Texte de l\'infobulle'));
+        $this->addField('display_area', Checkbox::class, __('Afficher la zone de couleur au survol'), ['default' => true]);
+        $this->addUIDField();
+    }
+}
diff --git a/app/SubForms/Link/TriggerLink.php b/app/SubForms/Link/TriggerLink.php
new file mode 100644 (file)
index 0000000..52583c7
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+
+namespace App\SubForms\Link;
+
+use App\Fields\FluidbookLinkEditor\TriggerLinkEvent;
+use Cubist\Backpack\Magic\Fields\Text;
+
+class TriggerLink extends Base
+{
+    public $type = self::TRIGGERSLINK;
+
+    public function addDestinationField()
+    {
+        $this->addField('to', Text::class, __('Identifiant du lien à déclencher'));
+        $this->addField('target', TriggerLinkEvent::class, __('Événement déclencheur'));
+    }
+}
diff --git a/app/SubForms/Link/ZoomArea.php b/app/SubForms/Link/ZoomArea.php
new file mode 100644 (file)
index 0000000..f525ee4
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+
+namespace App\SubForms\Link;
+
+use Cubist\Backpack\Magic\Fields\Number;
+
+class ZoomArea extends Base
+{
+    public $type = self::ZOOM;
+
+    public function addDestinationField()
+    {
+        $this->addField('group', \Cubist\Backpack\Magic\Fields\Text::class, __('Groupe'));
+        $this->addField('to', Number::class, __('Niveau de zoom maximal'));
+    }
+}
diff --git a/app/SubForms/Link/ZoomHD.php b/app/SubForms/Link/ZoomHD.php
new file mode 100644 (file)
index 0000000..a0e0754
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+
+namespace App\SubForms\Link;
+
+use Cubist\Backpack\Magic\Fields\FilesOrURL;
+
+class ZoomHD extends Base
+{
+    public $type = self::ZOOMHD;
+
+    public function addDestinationField()
+    {
+        $this->addField('to', FilesOrURL::class, __('Image HD'), $this->getFilesOrURLEntry() + ['accept' => self::$_acceptImage]);
+    }
+}