From 8fd1c1750b314447a11b40746cabcc2c1ee42e92 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 19 Sep 2022 15:29:53 +0200 Subject: [PATCH] wip #5468 @1 --- app/SubForms/Link/Base.php | 96 +++++++++++++++++++--------------- app/SubForms/Link/Email.php | 15 ++++++ app/SubForms/Link/Video.php | 21 ++++++++ app/SubForms/Link/Web.php | 15 ++++++ app/SubForms/Link/WebInfos.php | 8 +++ app/SubForms/Link/WebLink.php | 8 --- 6 files changed, 113 insertions(+), 50 deletions(-) create mode 100644 app/SubForms/Link/Email.php create mode 100644 app/SubForms/Link/Video.php create mode 100644 app/SubForms/Link/Web.php create mode 100644 app/SubForms/Link/WebInfos.php delete mode 100644 app/SubForms/Link/WebLink.php diff --git a/app/SubForms/Link/Base.php b/app/SubForms/Link/Base.php index dd26cee89..c58051f45 100644 --- a/app/SubForms/Link/Base.php +++ b/app/SubForms/Link/Base.php @@ -4,6 +4,7 @@ namespace App\SubForms\Link; use App\Fields\FluidbookLinkEditor\Depth; use App\Fields\FluidbookLinkEditor\LinkType; +use App\Fields\FluidbookLinkEditor\MultimediaIntegration; use Cubist\Backpack\Magic\Fields\FormSection; use Cubist\Backpack\Magic\Fields\Number; use Cubist\Backpack\Magic\Fields\Text; @@ -58,6 +59,8 @@ class Base extends SubForm const FLIPCARD = 41; protected $_displayedOnFluidbook = true; + protected $_integration = false; + protected $_multimedia = false; /** * @return array[] @@ -65,48 +68,47 @@ class Base extends SubForm public static function types() { return [ - ['type' => self::WEB_INFOS, 'label' => __('Lien web « plus d\'infos »'), 'color' => '#ff0000'], - ['type' => self::WEB, 'label' => __('Lien web'), 'color' => '#3399cc'], - ['type' => self::EMAIL, 'label' => __('Adresse e-mail'), 'color' => '#6c6360'], - ['type' => self::VIDEO, 'label' => __('Vidéo'), 'color' => '#33ff00'], - ['type' => self::INTERNAL, 'label' => __('Lien vers une page'), 'color' => '#c7b405'], - ['type' => self::MULTIMEDIA, 'label' => __('Multimédia'), 'color' => '#ff00ff'], - ['type' => self::CUSTOM, 'label' => __('Lien personnalisé'), 'color' => '#14511a'], - ['type' => self::PAGE_CORNER, 'label' => __('Coin de page'), 'color' => '#f19043', 'disabled' => true], - ['type' => self::OBJECT3D, 'label' => __('Objet 3D'), 'color' => '#00ffff', 'disabled' => true], - ['type' => self::WEBVIDEO, 'label' => __('Vidéo web'), 'color' => '#ffff00'], - ['type' => self::ACTION, 'label' => __('Action'), 'color' => '#880000'], - ['type' => self::CART, 'label' => __('Panier'), 'color' => '#F2A4B7'], - ['type' => self::ZOOM, 'label' => __('Zone de zoom'), 'color' => '#322280'], - ['type' => self::COLOR, 'label' => __('Couleurs'), 'color' => '#8C5E24'], - ['type' => self::IMAGE, 'label' => __('Image'), 'color' => '#BE418D'], - ['type' => self::FILE, 'label' => __('Fichier'), 'color' => '#F19043'], - ['type' => self::AUDIO, 'label' => __('Audio'), 'color' => '#0065AE'], - ['type' => self::TOOLTIP, 'label' => __('Texte / Infobulle'), 'color' => '#000000'], - ['type' => self::CALL, 'label' => __('Appel'), 'color' => '#333333'], - ['type' => self::BOOKMARKGROUP, 'label' => __('Groupe de marque-pages'), 'color' => '#d6520f'], - ['type' => self::HTML5MULTIMEDIA, 'label' => __('Lien Multimédia (HTML)'), 'color' => '#34A853', 'disabled' => true], - ['type' => self::BOOKMARK_CORNER, 'label' => __('Lien marque-page sur coin de page'), 'color' => '#000000', 'disabled' => true], - ['type' => self::STATSTAG, 'label' => __('Tag statistique'), 'color' => '#000000'], - ['type' => self::PHONE, 'label' => __('Téléphone'), 'color' => '#000000'], - ['type' => self::AUDIODESCRIPTION, 'label' => __('Audiodescription'), 'color' => '#00535b'], - ['type' => self::PAGE_LABEL, 'label' => __('Label de page'), 'color' => '#00E6D7'], - ['type' => self::EVENT_OVERLAY, 'label' => __('Capter les évenements'), 'color' => '#ffcc00'], - ['type' => self::ARTICLE, 'label' => __('Article (définition)'), 'color' => '#ACC152'], - ['type' => self::LIKE, 'label' => __('Like'), 'color' => '#4267B2'], - ['type' => self::SLIDESHOW, 'label' => __('Diaporama'), 'color' => '#07b57a'], - ['type' => self::IFRAME, 'label' => __('iFrame'), 'color' => '#fcae25'], - ['type' => self::SHOWLINK, 'label' => __('Afficher un lien'), 'color' => '#125C70'], - ['type' => self::ZOOMHD, 'label' => __('Zoom HD'), 'color' => '#E80C95'], - ['type' => self::LOCK_CONTENTS, 'label' => __('Blocage des contenus'), 'color' => '#69D670'], - ['type' => self::TEXT, 'label' => __('Texte'), 'color' => '#9090FF'], - ['type' => self::ARTICLE_OPEN, 'label' => __('Afficher un article'), 'color' => '#ffcc00'], - ['type' => self::DOWNLOAD_PORTION, 'label' => __('Télécharger un extrait'), 'color' => '#AAAAAA'], - ['type' => self::TRIGGERSLINK, 'label' => __('Déclencher un lien'), 'color' => '#cc0000'], - ['type' => self::LAYER, 'label' => __('Animation de calque'), 'color' => '#3D0254'], - ['type' => self::ANCHOR, 'label' => __('Ancre'), 'color' => '#330000'], - ['type' => self::FLIPCARD, 'label' => __('Flipcard'), 'color' => '#460e3f'], - + ['type' => self::WEB_INFOS, 'label' => __('Lien web « plus d\'infos »'), 'color' => '#ff0000', 'class' => WebInfos::class, 'class' => Web::class], + ['type' => self::WEB, 'label' => __('Lien web'), 'color' => '#3399cc', 'class' => Web::class, 'class' => Web::class], + ['type' => self::EMAIL, 'label' => __('Adresse e-mail'), 'color' => '#6c6360', 'class' => Web::class], + ['type' => self::VIDEO, 'label' => __('Vidéo'), 'color' => '#33ff00', 'class' => Web::class], + ['type' => self::INTERNAL, 'label' => __('Lien vers une page'), 'color' => '#c7b405', 'class' => Web::class], + ['type' => self::MULTIMEDIA, 'label' => __('Multimédia'), 'color' => '#ff00ff', 'class' => Web::class], + ['type' => self::CUSTOM, 'label' => __('Lien personnalisé'), 'color' => '#14511a', 'class' => Web::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' => Web::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::COLOR, 'label' => __('Couleurs'), 'color' => '#8C5E24', 'class' => Web::class], + ['type' => self::IMAGE, 'label' => __('Image'), 'color' => '#BE418D', 'class' => Web::class], + ['type' => self::FILE, 'label' => __('Fichier'), 'color' => '#F19043', 'class' => Web::class], + ['type' => self::AUDIO, 'label' => __('Audio'), 'color' => '#0065AE', 'class' => Web::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::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' => Web::class], + ['type' => self::AUDIODESCRIPTION, 'label' => __('Audiodescription'), 'color' => '#00535b', 'class' => Web::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::SLIDESHOW, 'label' => __('Diaporama'), 'color' => '#07b57a', 'class' => Web::class], + ['type' => self::IFRAME, 'label' => __('iFrame'), 'color' => '#fcae25', 'class' => Web::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::FLIPCARD, 'label' => __('Flipcard'), 'color' => '#460e3f', 'class' => Web::class], ]; } @@ -146,7 +148,17 @@ class Base extends SubForm public function addBasicSettingsFields() { + if ($this->_integration) { + $this->addField('inline', MultimediaIntegration::class, __('Intégration'), ['default' => 'inline']); + } + if ($this->_multimedia) { + $this->addMultimediaFields(); + } + } + public function addMultimediaFields() + { + $this->addField('header_video', FormSection::class, __('Paramètres multimedia')); } public function addAppearanceFields() diff --git a/app/SubForms/Link/Email.php b/app/SubForms/Link/Email.php new file mode 100644 index 000000000..04b6cda96 --- /dev/null +++ b/app/SubForms/Link/Email.php @@ -0,0 +1,15 @@ +addField('to', \Cubist\Backpack\Magic\Fields\Email::class, __('Adresse e-mail')); + } +} diff --git a/app/SubForms/Link/Video.php b/app/SubForms/Link/Video.php new file mode 100644 index 000000000..8f39e4f26 --- /dev/null +++ b/app/SubForms/Link/Video.php @@ -0,0 +1,21 @@ +addField('video_auto_start', Checkbox::class, __('Jouer la vidéo automatiquement'), ['default' => true]); + $this->addField('video_controls', Checkbox::class, __('Afficher les contrôles de la vidéo'), ['default' => true]); + $this->addField('video_sound_on', Checkbox::class, __('Activer le son de la vidéo'), ['default' => true]); + $this->addField('video_loop', Checkbox::class, __('Jouer la vidéo en boucle'), ['default' => false]); + } +} diff --git a/app/SubForms/Link/Web.php b/app/SubForms/Link/Web.php new file mode 100644 index 000000000..034f40661 --- /dev/null +++ b/app/SubForms/Link/Web.php @@ -0,0 +1,15 @@ +addField('to', URL::class, __('Adresse')); + } +} diff --git a/app/SubForms/Link/WebInfos.php b/app/SubForms/Link/WebInfos.php new file mode 100644 index 000000000..7f4eeffb1 --- /dev/null +++ b/app/SubForms/Link/WebInfos.php @@ -0,0 +1,8 @@ +