]>
git.immae.eu Git - github/shaarli/Shaarli.git/blob - plugins/isso/isso.php
8 * Display an error everywhere if the plugin is enabled without configuration.
10 * @param $data array List of links
11 * @param $conf ConfigManager instance
13 * @return mixed - linklist data with Isso plugin.
15 function isso_init($conf)
17 $issoUrl = $conf->get('plugins.ISSO_SERVER');
18 if (empty($issoUrl)) {
19 $error = 'Isso plugin error: '.
20 'Please define the "ISSO_SERVER" setting in the plugin administration page.';
26 * Render linklist hook.
27 * Will only display Isso comments on permalinks.
29 * @param $data array List of links
30 * @param $conf ConfigManager instance
32 * @return mixed - linklist data with Isso plugin.
34 function hook_isso_render_linklist($data, $conf)
36 $issoUrl = $conf->get('plugins.ISSO_SERVER');
37 if (empty($issoUrl)) {
41 // Only display comments for permalinks.
42 if (count($data['links']) == 1 && empty($data['search_tags']) && empty($data['search_term'])) {
43 $link = reset($data['links']);
44 $isso_html = file_get_contents(PluginManager
::$PLUGINS_PATH . '/isso/isso.html');
46 $isso = sprintf($isso_html, $issoUrl, $issoUrl, $link['linkdate'], $link['linkdate']);
47 $data['plugin_end_zone'][] = $isso;
49 // Hackish way to include this CSS file only when necessary.
50 $data['plugins_includes']['css_files'][] = PluginManager
::$PLUGINS_PATH . '/isso/isso.css';