diff options
author | VirtualTam <virtualtam@flibidi.net> | 2016-01-02 20:09:29 +0100 |
---|---|---|
committer | VirtualTam <virtualtam@flibidi.net> | 2016-01-02 20:09:29 +0100 |
commit | defc8a3f033a44602c598c2028a9ee3ee2a86d1d (patch) | |
tree | efb09f1c0d7b16e2c2dcb0313157d93ece6775b4 /plugins/wallabag/wallabag.php | |
parent | 66d86ea521d737b1bc92b16b9c9b4126f545916c (diff) | |
parent | 938d9cce77ed5098dd69643795cb4014f3688b35 (diff) | |
download | Shaarli-defc8a3f033a44602c598c2028a9ee3ee2a86d1d.tar.gz Shaarli-defc8a3f033a44602c598c2028a9ee3ee2a86d1d.tar.zst Shaarli-defc8a3f033a44602c598c2028a9ee3ee2a86d1d.zip |
Merge pull request #417 from ArthurHoaro/wallabag-improve
Wallabag plugin improvement
Diffstat (limited to 'plugins/wallabag/wallabag.php')
-rw-r--r-- | plugins/wallabag/wallabag.php | 17 |
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 | ||
7 | require_once 'WallabagInstance.php'; | ||
8 | |||
7 | // don't raise unnecessary warnings | 9 | // don't raise unnecessary warnings |
8 | if (is_file(PluginManager::$PLUGINS_PATH . '/wallabag/config.php')) { | 10 | if (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 | |||