diff options
author | ArthurHoaro <arthur@hoa.ro> | 2016-06-09 20:04:32 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-06-11 09:30:56 +0200 |
commit | 51def0d84955c7a951bd091eb5eeb3fce9deabd4 (patch) | |
tree | 466c24f215ee4d25bdcce67100b11e2fd3b0c78b /plugins/wallabag/wallabag.php | |
parent | 278d9ee2836df7d805845077f26f8cecd16f0f4f (diff) | |
download | Shaarli-51def0d84955c7a951bd091eb5eeb3fce9deabd4.tar.gz Shaarli-51def0d84955c7a951bd091eb5eeb3fce9deabd4.tar.zst Shaarli-51def0d84955c7a951bd091eb5eeb3fce9deabd4.zip |
PluginManager no longer uses singleton pattern
Diffstat (limited to 'plugins/wallabag/wallabag.php')
-rw-r--r-- | plugins/wallabag/wallabag.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/plugins/wallabag/wallabag.php b/plugins/wallabag/wallabag.php index 4726d936..ec09c8a1 100644 --- a/plugins/wallabag/wallabag.php +++ b/plugins/wallabag/wallabag.php | |||
@@ -6,24 +6,22 @@ | |||
6 | 6 | ||
7 | require_once 'WallabagInstance.php'; | 7 | require_once 'WallabagInstance.php'; |
8 | 8 | ||
9 | $conf = ConfigManager::getInstance(); | ||
10 | $wallabagUrl = $conf->get('plugins.WALLABAG_URL'); | 9 | $wallabagUrl = $conf->get('plugins.WALLABAG_URL'); |
11 | if (empty($wallabagUrl)) { | 10 | if (empty($wallabagUrl)) { |
12 | $GLOBALS['plugin_errors'][] = 'Wallabag plugin error: '. | 11 | $GLOBALS['plugin_errors'][] = 'Wallabag plugin error: '. |
13 | 'Please define "$GLOBALS[\'plugins\'][\'WALLABAG_URL\']" '. | 12 | 'Please define the "WALLABAG_URL" setting in the plugin administration page.'; |
14 | 'in "plugins/wallabag/config.php" or in your Shaarli config.php file.'; | ||
15 | } | 13 | } |
16 | 14 | ||
17 | /** | 15 | /** |
18 | * Add wallabag icon to link_plugin when rendering linklist. | 16 | * Add wallabag icon to link_plugin when rendering linklist. |
19 | * | 17 | * |
20 | * @param mixed $data - linklist data. | 18 | * @param mixed $data Linklist data. |
19 | * @param ConfigManager $conf Configuration Manager instance. | ||
21 | * | 20 | * |
22 | * @return mixed - linklist data with wallabag plugin. | 21 | * @return mixed - linklist data with wallabag plugin. |
23 | */ | 22 | */ |
24 | function hook_wallabag_render_linklist($data) | 23 | function hook_wallabag_render_linklist($data, $conf) |
25 | { | 24 | { |
26 | $conf = ConfigManager::getInstance(); | ||
27 | $wallabagUrl = $conf->get('plugins.WALLABAG_URL'); | 25 | $wallabagUrl = $conf->get('plugins.WALLABAG_URL'); |
28 | if (empty($wallabagUrl)) { | 26 | if (empty($wallabagUrl)) { |
29 | return $data; | 27 | return $data; |