From: Vincent Vanwaelscappel Date: Fri, 28 Feb 2025 16:32:27 +0000 (+0100) Subject: wip #7347 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=4847a6faf6184e235b290babce1d1c72ad54ff22;p=fluidbook_tools.git wip #7347 @2 --- diff --git a/src/Compiler/Compiler.php b/src/Compiler/Compiler.php index 17db5a1..3da2c89 100644 --- a/src/Compiler/Compiler.php +++ b/src/Compiler/Compiler.php @@ -394,13 +394,18 @@ class Compiler implements ShouldQueue, ShouldBeUnique, CompilerInterface { // TODO: Implement addIssue() method. } - public function addPageBackgroundColor($page, $color, $arrowsColor) + public function getExternalMultimediaContents($to) { - // TODO: Implement addPageBackgroundColor() method. + // TODO: Implement getExternalContents() method. } - public function getExternalMultimediaContents($to) + public function add3DViewer() { - // TODO: Implement getExternalContents() method. + // TODO: Implement add3DViewer() method. + } + + public function addPageBackground($page, $color, $arrowsColor, $image) + { + // TODO: Implement addPageBackground() method. } } diff --git a/src/Compiler/CompilerInterface.php b/src/Compiler/CompilerInterface.php index 5fe9378..7f69ab0 100644 --- a/src/Compiler/CompilerInterface.php +++ b/src/Compiler/CompilerInterface.php @@ -65,6 +65,8 @@ interface CompilerInterface public function addPDFJS($force = false); + public function add3DViewer(); + public function addSEOArticle($page, $title, $intro, $image, $id = null, $url = null, $content = ''); public function getPageNumber(): int; diff --git a/src/Compiler/DummyCompiler.php b/src/Compiler/DummyCompiler.php index 644e7c3..3f70533 100644 --- a/src/Compiler/DummyCompiler.php +++ b/src/Compiler/DummyCompiler.php @@ -159,4 +159,9 @@ class DummyCompiler implements CompilerInterface { { // TODO: Implement getExternalContents() method. } + + public function add3DViewer() + { + // TODO: Implement add3DViewer() method. + } } diff --git a/src/Links/Link.php b/src/Links/Link.php index 83568fe..6fb169b 100644 --- a/src/Links/Link.php +++ b/src/Links/Link.php @@ -218,6 +218,13 @@ class Link return new WebLink($id, $init, $compiler); } return new WebVideoLink($id, $init, $compiler); + case static::OBJECT3D: + $init['inline'] = self::normalizeInlineIntegration($init['inline'] ?? ''); + if ($init['inline'] === 'popup') { + return new Object3DPopupLink($id, $init, $compiler); + }else{ + return new Object3DLink($id, $init, $compiler); + } case static::ACTION: return new ActionLink($id, $init, $compiler); case static::CART: // Basket / Cart links diff --git a/src/Links/Object3DLink.php b/src/Links/Object3DLink.php new file mode 100644 index 0000000..b303440 --- /dev/null +++ b/src/Links/Object3DLink.php @@ -0,0 +1,12 @@ +compiler->add3DViewer(); + } +} diff --git a/src/Links/Object3DPopupLink.php b/src/Links/Object3DPopupLink.php new file mode 100644 index 0000000..26acf58 --- /dev/null +++ b/src/Links/Object3DPopupLink.php @@ -0,0 +1,28 @@ +compiler->add3DViewer(); + $this->copyExternalFile($this->to); + return '#/o3d/' . md5($this->to . '/' . $this->extra . '/' . $this->id); + } + + public function getAdditionnalContent() + { + return ' data-stats-type="popup_o3d" data-stats-name="' . $this->to . '" data-model="' . $this->to . '" '; + } + + public function getDefaultTooltip() + { + return 'click to view the 3D object'; + } +}