aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/wallabag/wallabag.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/wallabag/wallabag.php')
-rw-r--r--plugins/wallabag/wallabag.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/plugins/wallabag/wallabag.php b/plugins/wallabag/wallabag.php
index 37969c97..e3c399a9 100644
--- a/plugins/wallabag/wallabag.php
+++ b/plugins/wallabag/wallabag.php
@@ -4,6 +4,8 @@
4 * Plugin Wallabag. 4 * Plugin Wallabag.
5 */ 5 */
6 6
7require_once 'WallabagInstance.php';
8
7// don't raise unnecessary warnings 9// don't raise unnecessary warnings
8if (is_file(PluginManager::$PLUGINS_PATH . '/wallabag/config.php')) { 10if (is_file(PluginManager::$PLUGINS_PATH . '/wallabag/config.php')) {
9 include PluginManager::$PLUGINS_PATH . '/wallabag/config.php'; 11 include PluginManager::$PLUGINS_PATH . '/wallabag/config.php';
@@ -28,12 +30,23 @@ function hook_wallabag_render_linklist($data)
28 return $data; 30 return $data;
29 } 31 }
30 32
31 $wallabag_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/wallabag/wallabag.html'); 33 $version = isset($GLOBALS['plugins']['WALLABAG_VERSION'])
34 ? $GLOBALS['plugins']['WALLABAG_VERSION']
35 : '';
36 $wallabagInstance = new WallabagInstance($GLOBALS['plugins']['WALLABAG_URL'], $version);
37
38 $wallabagHtml = file_get_contents(PluginManager::$PLUGINS_PATH . '/wallabag/wallabag.html');
32 39
33 foreach ($data['links'] as &$value) { 40 foreach ($data['links'] as &$value) {
34 $wallabag = sprintf($wallabag_html, $GLOBALS['plugins']['WALLABAG_URL'], $value['url'], PluginManager::$PLUGINS_PATH); 41 $wallabag = sprintf(
42 $wallabagHtml,
43 $wallabagInstance->getWallabagUrl(),
44 urlencode($value['url']),
45 PluginManager::$PLUGINS_PATH
46 );
35 $value['link_plugin'][] = $wallabag; 47 $value['link_plugin'][] = $wallabag;
36 } 48 }
37 49
38 return $data; 50 return $data;
39} 51}
52