From: Vincent Vanwaelscappel Date: Mon, 29 Aug 2022 13:17:31 +0000 (+0200) Subject: wait #5420 @0:10 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=85a2d6b49d391c9f32c9c693cadae68e51c06d24;p=fluidbook_tools.git wait #5420 @0:10 --- diff --git a/src/Links/ImageLink.php b/src/Links/ImageLink.php index 37378fc..d50c0b7 100644 --- a/src/Links/ImageLink.php +++ b/src/Links/ImageLink.php @@ -14,34 +14,9 @@ class ImageLink extends ContentLink { $res = parent::getCSS(); $this->copyExternalFile($this->to); - $res .= 'background-image:url(' . $this->getImageUrl() . ');background-size:' . $this->getBackgroundSize() . ';background-position:' . $this->getBackgroundPosition() . ';background-repeat:no-repeat;'; return $res; } - public function getBackgroundPosition() - { - $animations = self::parseAnimations($this->image_rollover); - foreach ($animations as $animation) { - if (($animation['type'] === 'zoomout' || $animation['type'] === 'zoomin') && isset($animation['transformorigin'])) { - return $animation['transformorigin']; - } - } - return '50% 50%'; - } - - public function getBackgroundSize() - { - - $size = '100%'; - $animations = self::parseAnimations($this->image_rollover); - foreach ($animations as $animation) { - if ($animation['type'] === 'zoomout') { - $size = round($animation['scale'] * 100) . '%'; - } - } - return $size . ' ' . $size; - } - public function getAdditionnalContent() { $res = parent::getAdditionnalContent(); @@ -50,4 +25,13 @@ class ImageLink extends ContentLink return $res; } + public function getHTMLContent() + { + if (stristr($this->rollover, 'type=zoom')) { + return '
'; + } else { + return ''; + } + } + }