From 49361737a3dd6334863ff0795b14612674440721 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 13 Nov 2024 15:57:08 +0100 Subject: [PATCH] wip #7180 @2.5 --- src/Compiler/CompilerInterface.php | 2 ++ src/Compiler/DummyCompiler.php | 11 ++++++++--- src/Links/Link.php | 4 ++++ src/Links/SlideshowLink.php | 4 ++++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/Compiler/CompilerInterface.php b/src/Compiler/CompilerInterface.php index ae1d847..46eca63 100644 --- a/src/Compiler/CompilerInterface.php +++ b/src/Compiler/CompilerInterface.php @@ -72,4 +72,6 @@ interface CompilerInterface public function getQuality(): int; public function addIssue($type, $data = []); + + public function addPageBackgroundColor($page, $to); } diff --git a/src/Compiler/DummyCompiler.php b/src/Compiler/DummyCompiler.php index 712ccaf..7261581 100644 --- a/src/Compiler/DummyCompiler.php +++ b/src/Compiler/DummyCompiler.php @@ -28,7 +28,7 @@ class DummyCompiler implements CompilerInterface { // TODO: Implement addBookmarkGroup() method. } - public function getConfigZIP($d) { + public function getConfigZIP($d, $file = null, $uid = null, $page = null) { // TODO: Implement getConfigZIP() method. } @@ -64,11 +64,11 @@ class DummyCompiler implements CompilerInterface { // TODO: Implement page_path() method. } - public function getWidth() { + public function getWidth($page = 1) { // TODO: Implement getWidth() method. } - public function getHeight() { + public function getHeight($page = 1) { // TODO: Implement getHeight() method. } @@ -149,4 +149,9 @@ class DummyCompiler implements CompilerInterface { { // TODO: Implement addIssue() method. } + + public function addPageBackgroundColor($page, $to) + { + // TODO: Implement addPageBackgroundColor() method. + } } diff --git a/src/Links/Link.php b/src/Links/Link.php index 5504939..5e867a7 100644 --- a/src/Links/Link.php +++ b/src/Links/Link.php @@ -73,6 +73,7 @@ class Link const LOTTIE = 44; const COPY_TO_CLIPBOARD = 45; const SLIDESHOW_INLINE = 46; + const PAGE_BACKGROUND_COLOR = 47; protected static string|false|null $_linksKey = null; @@ -319,6 +320,9 @@ class Link return new PDFInlineLink($id, $init, $compiler); case static::COPY_TO_CLIPBOARD: return new CopyToClipboardLink($id, $init, $compiler); + case static::PAGE_BACKGROUND_COLOR: + $compiler->addPageBackgroundColor($init['page'], $init['to']); + break; default: return null; } diff --git a/src/Links/SlideshowLink.php b/src/Links/SlideshowLink.php index f9c3de5..c15ffa2 100644 --- a/src/Links/SlideshowLink.php +++ b/src/Links/SlideshowLink.php @@ -149,6 +149,10 @@ class SlideshowLink extends NormalLink $thumbnails = (count($slides) > 1); } + if ($context === 'inline') { + $thumbnails = false; + } + $options = ['openIndex' => $this->extra, 'thumbnails' => $thumbnails, 'thumbnail_height' => $this->thumbnail_height, -- 2.39.5