From: Vincent Vanwaelscappel Date: Thu, 4 Apr 2024 06:41:53 +0000 (+0200) Subject: wip #6838 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=ab47465ea8b2ae919e4dfb8bb2fa7eebabce0c11;p=fluidbook_tools.git wip #6838 @0.5 --- 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;