From: Vincent Vanwaelscappel Date: Mon, 3 Jul 2023 14:50:01 +0000 (+0200) Subject: wip #6100 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=ba6472fbf4bca1737154034555e29398aff70825;p=fluidbook_tools.git wip #6100 @0.5 --- diff --git a/src/Links/HTMLMultimediaPopupImage.php b/src/Links/HTMLMultimediaPopupImage.php index c3860d6..f23ff45 100644 --- a/src/Links/HTMLMultimediaPopupImage.php +++ b/src/Links/HTMLMultimediaPopupImage.php @@ -22,8 +22,8 @@ class HTMLMultimediaPopupImage extends NormalLink { $path = $this->compiler->working_path($this->to); try { $dim = Image::getimagesize($path); - }catch (\Exception $e){ - throw new \Exception('Invalid image on link ' . $this->uid . ' (page ' . $this->page . ') : '.$e->getMessage()); + } catch (\Exception $e) { + throw new \Exception('Invalid image on link ' . $this->uid . ' (page ' . $this->page . ') : ' . $e->getMessage()); } if (is_array($dim) && ($this->video_width || $this->video_height)) { @@ -37,7 +37,10 @@ class HTMLMultimediaPopupImage extends NormalLink { if ($this->read_mode) { $read = ' data-readmode="1"'; } - return $res . ' ' . $read . ' data-multimedia="' . rawurlencode($markup) . '" '; + + $statsName = str_replace('.pdf.svg', '.pdf', $this->to); + + return $res . ' ' . $read . ' data-stats-type="popup_image" data-stats-name="' . $statsName . '" data-multimedia="' . rawurlencode($markup) . '" '; } public function keep() { diff --git a/src/Links/HTMLMultimediaPopupLink.php b/src/Links/HTMLMultimediaPopupLink.php index ab030e8..ce371da 100644 --- a/src/Links/HTMLMultimediaPopupLink.php +++ b/src/Links/HTMLMultimediaPopupLink.php @@ -2,11 +2,9 @@ namespace Fluidbook\Tools\Links; -class HTMLMultimediaPopupLink extends htmlMultimediaPopupImage -{ +class HTMLMultimediaPopupLink extends htmlMultimediaPopupImage { - public function getAdditionnalContent() - { + public function getAdditionnalContent() { $i = $this->_init; $i['inline'] = true; $i['in_popup'] = true; @@ -15,6 +13,6 @@ class HTMLMultimediaPopupLink extends htmlMultimediaPopupImage $l = self::getMultimediaInstance($this->id . '_content', $i, $this->compiler); $markup = $l->getHTMLContainer(); - return ' data-multimedia="' . rawurlencode($markup) . '" '; + return ' data-stats-type="popup_multimedia" data-stats-name="' . $this->to . '" data-multimedia="' . rawurlencode($markup) . '" '; } }