aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/readityourself/readityourself.php
diff options
context:
space:
mode:
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