]> _ Git - fluidbook_tools.git/commitdiff
wait #5741 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 16 Feb 2023 17:10:35 +0000 (18:10 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 16 Feb 2023 17:10:35 +0000 (18:10 +0100)
src/Links/Link.php
src/Links/ShowLinkLink.php

index ba1d2a6d135ae632510a782d408941723db87136..acb5f1e89f0760b69a7a93b54dfa6810166fd59e 100644 (file)
@@ -36,6 +36,7 @@ class Link {
     public $video_height;
     public $video_width;
     public $video_service;
+    public $close_button;
     public $hidelinksonplay;
     public $rollover;
     public $inline;
index 800859e874e92c2deebcc922b285e9b11d51bc84..7472fe2133f28cacdd56233b1e3c202957a865cf 100644 (file)
@@ -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;
     }
 }