aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/isso/isso.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/isso/isso.php')
-rw-r--r--plugins/isso/isso.php33
1 files changed, 31 insertions, 2 deletions
diff --git a/plugins/isso/isso.php b/plugins/isso/isso.php
index 5bc1cce2..dab75dd5 100644
--- a/plugins/isso/isso.php
+++ b/plugins/isso/isso.php
@@ -5,6 +5,8 @@
5 */ 5 */
6 6
7use Shaarli\Config\ConfigManager; 7use Shaarli\Config\ConfigManager;
8use Shaarli\Plugin\PluginManager;
9use Shaarli\Router;
8 10
9/** 11/**
10 * Display an error everywhere if the plugin is enabled without configuration. 12 * Display an error everywhere if the plugin is enabled without configuration.
@@ -46,9 +48,36 @@ function hook_isso_render_linklist($data, $conf)
46 48
47 $isso = sprintf($issoHtml, $issoUrl, $issoUrl, $link['id'], $link['id']); 49 $isso = sprintf($issoHtml, $issoUrl, $issoUrl, $link['id'], $link['id']);
48 $data['plugin_end_zone'][] = $isso; 50 $data['plugin_end_zone'][] = $isso;
51 } else {
52 $button = '<span><a href="?%s#isso-thread">';
53 // For the default theme we use a FontAwesome icon which is better than an image
54 if ($conf->get('resource.theme') === 'default') {
55 $button .= '<i class="linklist-plugin-icon fa fa-comment"></i>';
56 } else {
57 $button .= '<img class="linklist-plugin-icon" src="plugins/isso/comment.png" ';
58 $button .= 'title="Comment on this shaare" alt="Comments" />';
59 }
60 $button .= '</a></span>';
61 foreach ($data['links'] as &$value) {
62 $commentLink = sprintf($button, $value['shorturl']);
63 $value['link_plugin'][] = $commentLink;
64 }
65 }
49 66
50 // Hackish way to include this CSS file only when necessary. 67 return $data;
51 $data['plugins_includes']['css_files'][] = PluginManager::$PLUGINS_PATH . '/isso/isso.css'; 68}
69
70/**
71 * When linklist is displayed, include isso CSS file.
72 *
73 * @param array $data - header data.
74 *
75 * @return mixed - header data with isso CSS file added.
76 */
77function hook_isso_render_includes($data)
78{
79 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) {
80 $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/isso/isso.css';
52 } 81 }
53 82
54 return $data; 83 return $data;