-function hook_wallabag_render_linklist($data) {
- $wallabag_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/wallabag/wallabag.html');
+function hook_wallabag_render_linklist($data)
+{
+ if (!isset($GLOBALS['plugins']['WALLABAG_URL'])) {
+ return $data;
+ }
+
+ $version = isset($GLOBALS['plugins']['WALLABAG_VERSION'])
+ ? $GLOBALS['plugins']['WALLABAG_VERSION']
+ : '';
+ $wallabagInstance = new WallabagInstance($GLOBALS['plugins']['WALLABAG_URL'], $version);
+
+ $wallabagHtml = file_get_contents(PluginManager::$PLUGINS_PATH . '/wallabag/wallabag.html');