From e972a3b84871e8303497bfa07f70cb358387fdfe Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 5 Dec 2024 18:19:15 +0100 Subject: [PATCH] wip #7221 @1.5 --- src/Compiler/Compiler.php | 10 ++++++++++ src/Compiler/CompilerInterface.php | 2 ++ src/Compiler/DummyCompiler.php | 5 +++++ src/Links/Link.php | 12 ++++++++---- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/Compiler/Compiler.php b/src/Compiler/Compiler.php index b716407..17db5a1 100644 --- a/src/Compiler/Compiler.php +++ b/src/Compiler/Compiler.php @@ -393,4 +393,14 @@ class Compiler implements ShouldQueue, ShouldBeUnique, CompilerInterface { { // TODO: Implement addIssue() method. } + + public function addPageBackgroundColor($page, $color, $arrowsColor) + { + // TODO: Implement addPageBackgroundColor() method. + } + + public function getExternalMultimediaContents($to) + { + // TODO: Implement getExternalContents() method. + } } diff --git a/src/Compiler/CompilerInterface.php b/src/Compiler/CompilerInterface.php index 2cb83ab..322b3d1 100644 --- a/src/Compiler/CompilerInterface.php +++ b/src/Compiler/CompilerInterface.php @@ -74,4 +74,6 @@ interface CompilerInterface public function addIssue($type, $data = []); public function addPageBackgroundColor($page, $color,$arrowsColor); + + public function getExternalMultimediaContents($to); } diff --git a/src/Compiler/DummyCompiler.php b/src/Compiler/DummyCompiler.php index 3b48d5f..f512b20 100644 --- a/src/Compiler/DummyCompiler.php +++ b/src/Compiler/DummyCompiler.php @@ -154,4 +154,9 @@ class DummyCompiler implements CompilerInterface { { // TODO: Implement addPageBackgroundColor() method. } + + public function getExternalMultimediaContents($to) + { + // TODO: Implement getExternalContents() method. + } } diff --git a/src/Links/Link.php b/src/Links/Link.php index a2f624b..4d2e50d 100644 --- a/src/Links/Link.php +++ b/src/Links/Link.php @@ -74,6 +74,7 @@ class Link const COPY_TO_CLIPBOARD = 45; const SLIDESHOW_INLINE = 46; const PAGE_BACKGROUND_COLOR = 48; + const FLUIDBOOK_TOOLBOX_ELEARNING_CONTENT = 49; protected static string|false|null $_linksKey = null; @@ -190,7 +191,7 @@ class Link case static::INTERNAL: return new InternalLink($id, $init, $compiler); case static::VIDEO: - $init['inline'] = self::normalizeInlineIntegration($init['inline']??true); + $init['inline'] = self::normalizeInlineIntegration($init['inline'] ?? true); if ($init['inline'] === 'inline') { $init['inline'] = 'inline'; return new VideoLink($id, $init, $compiler); @@ -204,7 +205,7 @@ class Link case static::CUSTOM: return CustomLink::getCustomInstance($id, $init, $compiler); case static::WEBVIDEO: - $init['inline'] = self::normalizeInlineIntegration($init['inline']??true); + $init['inline'] = self::normalizeInlineIntegration($init['inline'] ?? true); $init['to'] = WebVideoLink::cleanID($init['to']); if ($init['inline'] === 'popup') { return new WebVideoPopupLink($id, $init, $compiler); @@ -228,7 +229,7 @@ class Link case static::FILE: return new FileLink($id, $init, $compiler); case static::AUDIO: - $init['inline'] = self::normalizeInlineIntegration($init['inline']??true); + $init['inline'] = self::normalizeInlineIntegration($init['inline'] ?? true); if ($init['inline'] === 'inline') { return new AudioLink($id, $init, $compiler); } @@ -242,6 +243,7 @@ class Link break; case static::HTML5MULTIMEDIA: case static::MULTIMEDIA: + case static::FLUIDBOOK_TOOLBOX_ELEARNING_CONTENT: return self::getMultimediaInstance($id, $init, $compiler); case static::LOTTIE: return new LottieLink($id, $init, $compiler); @@ -278,7 +280,7 @@ class Link return new HTMLMultimediaPopupImage($id, $init, $compiler); } case static::IFRAME: - $init['inline'] = self::normalizeInlineIntegration($init['inline']??true); + $init['inline'] = self::normalizeInlineIntegration($init['inline'] ?? true); if ($init['inline'] === 'inline') { return new IFrameLink($id, $init, $compiler); } @@ -439,6 +441,8 @@ class Link if ($init['to'] == '') { return null; } + + $init['to'] = $compiler->getExternalMultimediaContents($init['to']); $init['inline'] = self::normalizeInlineIntegration($init['inline']); $ext = mb_strtolower(Files::getExtension($init['to'])); -- 2.39.5