From: Vincent Vanwaelscappel Date: Tue, 14 Feb 2023 16:32:32 +0000 (+0100) Subject: wip #5731 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=50790263fc1fc1d9311afe0f5e3d4d04ca6f65fc;p=fluidbook_tools.git wip #5731 --- diff --git a/src/Links/AnchorLink.php b/src/Links/AnchorLink.php index 1f73627..ffc375e 100644 --- a/src/Links/AnchorLink.php +++ b/src/Links/AnchorLink.php @@ -8,7 +8,7 @@ class AnchorLink extends Link { protected $role = ''; - public function getHTMLContainer() + protected function _getHTMLContainer() { $this->to = self::normalizeAnchor($this->to); $this->compiler->addPageLabel($this->page, $this->to); diff --git a/src/Links/AudioLink.php b/src/Links/AudioLink.php index 121ee9a..f2d0d59 100644 --- a/src/Links/AudioLink.php +++ b/src/Links/AudioLink.php @@ -17,9 +17,9 @@ class AudioLink extends Link return self::makeAudioTag($this, $w, $h, $this->compiler); } - public function getCSSContainer() + protected function _getCSSContainer() { - $css = parent::getCSSContainer(); + $css = parent::_getCSSContainer(); $css .= '#l_' . $this->id . ' audio{'; $css .= 'width:' . round($this->width * $this->getCssScale()) . 'px;'; $css .= 'height:' . round($this->height * $this->getCssScale()) . 'px;'; diff --git a/src/Links/HTMLMultimediaLink.php b/src/Links/HTMLMultimediaLink.php index 35483a3..f15f925 100644 --- a/src/Links/HTMLMultimediaLink.php +++ b/src/Links/HTMLMultimediaLink.php @@ -138,7 +138,7 @@ class HTMLMultimediaLink extends Link } } - public function getCSSContainer() + protected function _getCSSContainer() { if ($this->moveOnEvenPage()) { $this->page--; diff --git a/src/Links/Link.php b/src/Links/Link.php index f76c93a..ba1d2a6 100644 --- a/src/Links/Link.php +++ b/src/Links/Link.php @@ -68,6 +68,9 @@ class Link { protected $_init; + protected $_cssContainer = null; + protected $_htmlContainer = null; + /** * * @var CompilerInterface @@ -428,7 +431,15 @@ class Link { return $this->infobulle; } + public function getHTMLContainer() { + if (null === $this->_htmlContainer) { + $this->_htmlContainer = $this->_getHTMLContainer(); + } + return $this->_htmlContainer; + } + + protected function _getHTMLContainer() { $addContent = $this->getAdditionnalContent(); return '
' . $this->getHTMLContent() . '
'; } @@ -515,6 +526,13 @@ class Link { } public function getCSSContainer() { + if (null === $this->_cssContainer) { + $this->_cssContainer = $this->_getCSSContainer(); + } + return $this->_cssContainer; + } + + protected function _getCSSContainer() { if ($this->moveOnEvenPage()) { $this->page--; $this->left += $this->compiler->getWidth();