|
@@ -36,13 +36,8 @@ class syntax_plugin_lsb_button extends DokuWiki_Syntax_Plugin {
|
|
|
*/
|
|
|
public function connectTo($mode) {
|
|
|
$this->Lexer->addSpecialPattern('~~LSB\b.*?~~',$mode,'plugin_lsb_button');
|
|
|
-
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
* Handle matches of the lsb syntax
|
|
|
*
|
|
@@ -77,7 +72,7 @@ class syntax_plugin_lsb_button extends DokuWiki_Syntax_Plugin {
|
|
|
$renderer->doc .= '<ul class="lsb">';
|
|
|
|
|
|
|
|
|
- $protected = array('twitter', 'facebook', 'google+', 'linkedin', 'pinterest', 'tumblr', 'reddit');
|
|
|
+ $protected = array('twitter', 'facebook', 'googleplus', 'linkedin', 'pinterest', 'tumblr', 'reddit');
|
|
|
|
|
|
|
|
|
foreach ($data as $network) {
|
|
@@ -91,10 +86,10 @@ class syntax_plugin_lsb_button extends DokuWiki_Syntax_Plugin {
|
|
|
}
|
|
|
|
|
|
|
|
|
- * Render xhtml output for facebook share button
|
|
|
+ * Render xhtml output for share buttons
|
|
|
*
|
|
|
- * @param string $network The social network to render the button to
|
|
|
- * @return string Xhtml code for button.
|
|
|
+ * @param string $network The social network to render the button to
|
|
|
+ * @return string Xhtml code for button.
|
|
|
*/
|
|
|
protected function lsb_button ($network) {
|
|
|
global $ID;
|
|
@@ -109,29 +104,29 @@ class syntax_plugin_lsb_button extends DokuWiki_Syntax_Plugin {
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
switch ($network) {
|
|
|
case 'twitter':
|
|
|
- $href = 'https://twitter.com/intent/tweet?url=' . $url . '&text='. $title .'&via=TWITTER-HANDLE';
|
|
|
+ $href = 'https://twitter.com/intent/tweet?url=' . $url . '&text='. $title;
|
|
|
break;
|
|
|
case 'facebook':
|
|
|
$href = 'http://www.facebook.com/sharer.php?u='. $url;
|
|
|
break;
|
|
|
- case 'google+':
|
|
|
+ case 'googleplus':
|
|
|
$href = 'https://plus.google.com/share?url='. $url;
|
|
|
break;
|
|
|
case 'linkedin':
|
|
|
- $href = 'href="https://www.linkedin.com/shareArticle?url='. $url .'&title=' . $title . '&summary=' . $abstract . '&mini=true&source=' . $url;
|
|
|
+ $href = 'https://www.linkedin.com/shareArticle?url='. $url .'&title=' . $title . '&summary=' . $abstract . '&mini=true&source=' . $url;
|
|
|
break;
|
|
|
case 'pinterest':
|
|
|
- $href = 'https://pinterest.com/pin/create/button/?url='. $url .'&description=' . $abstract . '&media=YOUR-IMAGE-SRC';
|
|
|
+ $href = 'https://pinterest.com/pin/create/button/?url='. $url .'&description=' . $abstract;
|
|
|
break;
|
|
|
case 'tumblr':
|
|
|
$href = 'http://www.tumblr.com/share/link?url='. $url .'&description=' . $abstract;
|
|
@@ -148,15 +143,20 @@ class syntax_plugin_lsb_button extends DokuWiki_Syntax_Plugin {
|
|
|
return $xhtml;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+ * Returns the thext to display in share button
|
|
|
+ *
|
|
|
+ * @param string $network The social network to get the text to
|
|
|
+ * @return string text for button or empty string to show just the icon.
|
|
|
+ */
|
|
|
protected function lsb_getText($network) {
|
|
|
|
|
|
$display = $this->getConf('display');
|
|
|
- if ($display == 'name') {
|
|
|
- return $network;
|
|
|
- } elseif ($display == 'text') {
|
|
|
- return $this->getLang($network.'_text');
|
|
|
+
|
|
|
+ if ($display == 'text') {
|
|
|
+ return $this->getLang($network . '_text');
|
|
|
} else {
|
|
|
+
|
|
|
return '';
|
|
|
}
|
|
|
}
|