diff options
author | ArthurHoaro <arthur@hoa.ro> | 2019-07-27 12:34:30 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2019-07-27 12:34:30 +0200 |
commit | 38672ba0d1c722e5d6d33a58255ceb55e9410e46 (patch) | |
tree | dae4c7c47532380eac3ae641db99122fc77c93dc /plugins/isso | |
parent | 83faedadff76c5bdca036f39f13943f63b27e164 (diff) | |
parent | 1e77e0448bbd25675d8c0fe4a73206ad9048904b (diff) | |
download | Shaarli-38672ba0d1c722e5d6d33a58255ceb55e9410e46.tar.gz Shaarli-38672ba0d1c722e5d6d33a58255ceb55e9410e46.tar.zst Shaarli-38672ba0d1c722e5d6d33a58255ceb55e9410e46.zip |
Merge tag 'v0.10.4' into stable
Release v0.10.4
Diffstat (limited to 'plugins/isso')
-rw-r--r-- | plugins/isso/comment.png | bin | 0 -> 277 bytes | |||
-rw-r--r-- | plugins/isso/isso.php | 31 | ||||
-rw-r--r-- | plugins/isso/isso_button.html | 5 |
3 files changed, 34 insertions, 2 deletions
diff --git a/plugins/isso/comment.png b/plugins/isso/comment.png new file mode 100644 index 00000000..0158c03b --- /dev/null +++ b/plugins/isso/comment.png | |||
Binary files differ | |||
diff --git a/plugins/isso/isso.php b/plugins/isso/isso.php index 5bc1cce2..378c11af 100644 --- a/plugins/isso/isso.php +++ b/plugins/isso/isso.php | |||
@@ -46,9 +46,36 @@ function hook_isso_render_linklist($data, $conf) | |||
46 | 46 | ||
47 | $isso = sprintf($issoHtml, $issoUrl, $issoUrl, $link['id'], $link['id']); | 47 | $isso = sprintf($issoHtml, $issoUrl, $issoUrl, $link['id'], $link['id']); |
48 | $data['plugin_end_zone'][] = $isso; | 48 | $data['plugin_end_zone'][] = $isso; |
49 | } else { | ||
50 | $button = '<span><a href="?%s#isso-thread">'; | ||
51 | // For the default theme we use a FontAwesome icon which is better than an image | ||
52 | if ($conf->get('resource.theme') === 'default') { | ||
53 | $button .= '<i class="linklist-plugin-icon fa fa-comment"></i>'; | ||
54 | } else { | ||
55 | $button .= '<img class="linklist-plugin-icon" src="plugins/isso/comment.png" '; | ||
56 | $button .= 'title="Comment on this shaare" alt="Comments" />'; | ||
57 | } | ||
58 | $button .= '</a></span>'; | ||
59 | foreach ($data['links'] as &$value) { | ||
60 | $commentLink = sprintf($button, $value['shorturl']); | ||
61 | $value['link_plugin'][] = $commentLink; | ||
62 | } | ||
63 | } | ||
49 | 64 | ||
50 | // Hackish way to include this CSS file only when necessary. | 65 | return $data; |
51 | $data['plugins_includes']['css_files'][] = PluginManager::$PLUGINS_PATH . '/isso/isso.css'; | 66 | } |
67 | |||
68 | /** | ||
69 | * When linklist is displayed, include isso CSS file. | ||
70 | * | ||
71 | * @param array $data - header data. | ||
72 | * | ||
73 | * @return mixed - header data with isso CSS file added. | ||
74 | */ | ||
75 | function hook_isso_render_includes($data) | ||
76 | { | ||
77 | if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) { | ||
78 | $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/isso/isso.css'; | ||
52 | } | 79 | } |
53 | 80 | ||
54 | return $data; | 81 | return $data; |
diff --git a/plugins/isso/isso_button.html b/plugins/isso/isso_button.html new file mode 100644 index 00000000..3f828480 --- /dev/null +++ b/plugins/isso/isso_button.html | |||
@@ -0,0 +1,5 @@ | |||
1 | <span> | ||
2 | <a href="?%s#isso-thread"> | ||
3 | <img class="linklist-plugin-icon" src="plugins/archiveorg/internetarchive.png" title="%s" alt="archive.org" /> | ||
4 | </a> | ||
5 | </span> | ||