From ab47465ea8b2ae919e4dfb8bb2fa7eebabce0c11 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 4 Apr 2024 08:41:53 +0200 Subject: [PATCH] wip #6838 @0.5 --- src/Links/ZoomProductLink.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Links/ZoomProductLink.php b/src/Links/ZoomProductLink.php index 9e80f57..d4d1c17 100644 --- a/src/Links/ZoomProductLink.php +++ b/src/Links/ZoomProductLink.php @@ -2,8 +2,12 @@ namespace Fluidbook\Tools\Links; +use Cubist\Util\Data; + class ZoomProductLink extends ZoomLink { + protected static $_refs = null; + public function __construct($id, $init, &$compiler) { $init['group'] = $init['to']; @@ -12,7 +16,13 @@ class ZoomProductLink extends ZoomLink public function getZoomAttributes() { - $url = $this->compiler->getSetting('product_zoom_references.' . $this->to, ''); + if (null === self::$_refs) { + /** @var Data $c */ + $c = $this->compiler->config; + self::$_refs = $c->get('product_zoom_references'); + } + + $url = self::$_refs[$this->to] ?? ''; $res = parent::getZoomAttributes(); $res['maxzoom'] = $this->maxzoom_default; -- 2.39.5