From 60732b20b3395798275b0e29fffcf21e32404605 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Tue, 9 Jun 2015 12:30:06 +0000 Subject: [PATCH] Action links for sharing --- inc/ws/Util/html5/class.ws.html5.links.php | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/inc/ws/Util/html5/class.ws.html5.links.php b/inc/ws/Util/html5/class.ws.html5.links.php index 240266b9c..3037ff893 100644 --- a/inc/ws/Util/html5/class.ws.html5.links.php +++ b/inc/ws/Util/html5/class.ws.html5.links.php @@ -535,11 +535,36 @@ class webVideoLink extends videoLink { } class actionLink extends internalLink { + protected $_share = array('facebook', 'twitter', 'googleplus', 'linkedin', 'viadeo'); public function getURL() { + if (in_array($this->to, $this->_share)) { + return '#'; + } return '#/' . $this->to; } + public function getClasses() { + if (in_array($this->to, $this->_share)) { + return array_merge(array('share'), parent::getClasses()); + } else { + return parent::getClasses(); + } + } + + public function getAdditionnalContent() { + if (in_array($this->to, $this->_share)) { + return parent::getAdditionnalContent() . ' data-service="' . $this->to . '" '; + } else { + return parent::getClasses(); + } + } + + public function getDefaultTooltip() { + return ''; + } + + } class basketLink extends contentLink { -- 2.39.5