7 use Shaarli\Config\ConfigManager
;
10 * Display an error everywhere if the plugin is enabled without configuration.
12 * @param $conf ConfigManager instance
14 * @return mixed - linklist data with Isso plugin.
16 function isso_init($conf)
18 $issoUrl = $conf->get('plugins.ISSO_SERVER');
19 if (empty($issoUrl)) {
20 $error = t('Isso plugin error: '.
21 'Please define the "ISSO_SERVER" setting in the plugin administration page.');
27 * Render linklist hook.
28 * Will only display Isso comments on permalinks.
30 * @param $data array List of links
31 * @param $conf ConfigManager instance
33 * @return mixed - linklist data with Isso plugin.
35 function hook_isso_render_linklist($data, $conf)
37 $issoUrl = $conf->get('plugins.ISSO_SERVER');
38 if (empty($issoUrl)) {
42 // Only display comments for permalinks.
43 if (count($data['links']) == 1 && empty($data['search_tags']) && empty($data['search_term'])) {
44 $link = reset($data['links']);
45 $issoHtml = file_get_contents(PluginManager
::$PLUGINS_PATH . '/isso/isso.html');
47 $isso = sprintf($issoHtml, $issoUrl, $issoUrl, $link['id'], $link['id']);
48 $data['plugin_end_zone'][] = $isso;
50 // Hackish way to include this CSS file only when necessary.
51 $data['plugins_includes']['css_files'][] = PluginManager
::$PLUGINS_PATH . '/isso/isso.css';
58 * This function is never called, but contains translation calls for GNU gettext extraction.
60 function isso_dummy_translation()
63 t('Let visitor comment your shaares on permalinks with Isso.');
64 t('Isso server URL (without \'http://\')');