From: Vincent Vanwaelscappel Date: Thu, 16 Feb 2023 17:10:35 +0000 (+0100) Subject: wait #5741 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=26f9e7641cfe36e82c142802ad54b406e5ecd6c1;p=fluidbook_tools.git wait #5741 @0.5 --- diff --git a/src/Links/Link.php b/src/Links/Link.php index ba1d2a6..acb5f1e 100644 --- a/src/Links/Link.php +++ b/src/Links/Link.php @@ -36,6 +36,7 @@ class Link { public $video_height; public $video_width; public $video_service; + public $close_button; public $hidelinksonplay; public $rollover; public $inline; diff --git a/src/Links/ShowLinkLink.php b/src/Links/ShowLinkLink.php index 800859e..7472fe2 100644 --- a/src/Links/ShowLinkLink.php +++ b/src/Links/ShowLinkLink.php @@ -2,27 +2,26 @@ namespace Fluidbook\Tools\Links; -class ShowLinkLink extends NormalLink -{ - public function getURL() - { +class ShowLinkLink extends NormalLink { + + public function init() { + $this->close_button = $this->close_button ?: $this->video_service; + } + + public function getURL() { return '#'; } - public function getClasses() - { + public function getClasses() { $res = parent::getClasses(); $res[] = 'showlink'; return $res; } - public function getAdditionnalContent() - { + public function getAdditionnalContent() { $res = parent::getAdditionnalContent(); - if (!$this->video_service) { - $this->video_service = 'none'; - } - $res .= ' data-showmode="' . $this->target . '" data-showclose="' . $this->video_service . '" data-showid="' . $this->to . '"'; + $this->close_button = $this->close_button ?: 'none'; + $res .= ' data-showmode="' . $this->target . '" data-showclose="' . $this->close_button . '" data-showid="' . $this->to . '"'; return $res; } }