aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/readityourself/readityourself.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2016-05-29 14:41:30 +0200
committerArthurHoaro <arthur@hoa.ro>2016-06-11 09:30:56 +0200
commiteeea1c3daa87f133c57c96fa17ed26b02c392636 (patch)
tree40a54d6ab27cf30bbfccbd524f02f401551e761c /plugins/readityourself/readityourself.php
parentd93d51b213bd3bda9bfa67d23c31dcce5a8b7fc0 (diff)
downloadShaarli-eeea1c3daa87f133c57c96fa17ed26b02c392636.tar.gz
Shaarli-eeea1c3daa87f133c57c96fa17ed26b02c392636.tar.zst
Shaarli-eeea1c3daa87f133c57c96fa17ed26b02c392636.zip
Use the configuration manager for wallabag and readityourself plugin
Diffstat (limited to 'plugins/readityourself/readityourself.php')
-rw-r--r--plugins/readityourself/readityourself.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/plugins/readityourself/readityourself.php b/plugins/readityourself/readityourself.php
index c8df4c4f..9ca73e01 100644
--- a/plugins/readityourself/readityourself.php
+++ b/plugins/readityourself/readityourself.php
@@ -8,12 +8,9 @@
8// it seems kinda dead. 8// it seems kinda dead.
9// Not tested. 9// Not tested.
10 10
11// don't raise unnecessary warnings 11$conf = ConfigManager::getInstance();
12if (is_file(PluginManager::$PLUGINS_PATH . '/readityourself/config.php')) { 12$riyUrl = $conf->get('plugins.READITYOUSELF_URL');
13 include PluginManager::$PLUGINS_PATH . '/readityourself/config.php'; 13if (empty($riyUrl)) {
14}
15
16if (empty($GLOBALS['plugins']['READITYOUSELF_URL'])) {
17 $GLOBALS['plugin_errors'][] = 'Readityourself plugin error: '. 14 $GLOBALS['plugin_errors'][] = 'Readityourself plugin error: '.
18 'Please define "$GLOBALS[\'plugins\'][\'READITYOUSELF_URL\']" '. 15 'Please define "$GLOBALS[\'plugins\'][\'READITYOUSELF_URL\']" '.
19 'in "plugins/readityourself/config.php" or in your Shaarli config.php file.'; 16 'in "plugins/readityourself/config.php" or in your Shaarli config.php file.';
@@ -28,14 +25,16 @@ if (empty($GLOBALS['plugins']['READITYOUSELF_URL'])) {
28 */ 25 */
29function hook_readityourself_render_linklist($data) 26function hook_readityourself_render_linklist($data)
30{ 27{
31 if (!isset($GLOBALS['plugins']['READITYOUSELF_URL'])) { 28 $conf = ConfigManager::getInstance();
29 $riyUrl = $conf->get('plugins.READITYOUSELF_URL');
30 if (empty($riyUrl)) {
32 return $data; 31 return $data;
33 } 32 }
34 33
35 $readityourself_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/readityourself/readityourself.html'); 34 $readityourself_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/readityourself/readityourself.html');
36 35
37 foreach ($data['links'] as &$value) { 36 foreach ($data['links'] as &$value) {
38 $readityourself = sprintf($readityourself_html, $GLOBALS['plugins']['READITYOUSELF_URL'], $value['url'], PluginManager::$PLUGINS_PATH); 37 $readityourself = sprintf($readityourself_html, $riyUrl, $value['url'], PluginManager::$PLUGINS_PATH);
39 $value['link_plugin'][] = $readityourself; 38 $value['link_plugin'][] = $readityourself;
40 } 39 }
41 40