]> _ Git - cubeextranet.git/commitdiff
Action links for sharing
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 9 Jun 2015 12:30:06 +0000 (12:30 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 9 Jun 2015 12:30:06 +0000 (12:30 +0000)
inc/ws/Util/html5/class.ws.html5.links.php

index 240266b9cf79f064dfbc7657c673bb05a8222f35..3037ff8932ee0023c3a23656684b64e82b35abce 100644 (file)
@@ -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 {