aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/readityourself
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2016-06-09 20:04:32 +0200
committerArthurHoaro <arthur@hoa.ro>2016-06-11 09:30:56 +0200
commit51def0d84955c7a951bd091eb5eeb3fce9deabd4 (patch)
tree466c24f215ee4d25bdcce67100b11e2fd3b0c78b /plugins/readityourself
parent278d9ee2836df7d805845077f26f8cecd16f0f4f (diff)
downloadShaarli-51def0d84955c7a951bd091eb5eeb3fce9deabd4.tar.gz
Shaarli-51def0d84955c7a951bd091eb5eeb3fce9deabd4.tar.zst
Shaarli-51def0d84955c7a951bd091eb5eeb3fce9deabd4.zip
PluginManager no longer uses singleton pattern
Diffstat (limited to 'plugins/readityourself')
-rw-r--r--plugins/readityourself/config.php.dist3
-rw-r--r--plugins/readityourself/readityourself.php10
2 files changed, 4 insertions, 9 deletions
diff --git a/plugins/readityourself/config.php.dist b/plugins/readityourself/config.php.dist
deleted file mode 100644
index d6b5cb85..00000000
--- a/plugins/readityourself/config.php.dist
+++ /dev/null
@@ -1,3 +0,0 @@
1<?php
2
3$GLOBALS['plugins']['READITYOUSELF_URL'] = 'http://someurl.com'; \ No newline at end of file
diff --git a/plugins/readityourself/readityourself.php b/plugins/readityourself/readityourself.php
index 9ca73e01..4bfcf501 100644
--- a/plugins/readityourself/readityourself.php
+++ b/plugins/readityourself/readityourself.php
@@ -8,24 +8,22 @@
8// it seems kinda dead. 8// it seems kinda dead.
9// Not tested. 9// Not tested.
10 10
11$conf = ConfigManager::getInstance();
12$riyUrl = $conf->get('plugins.READITYOUSELF_URL'); 11$riyUrl = $conf->get('plugins.READITYOUSELF_URL');
13if (empty($riyUrl)) { 12if (empty($riyUrl)) {
14 $GLOBALS['plugin_errors'][] = 'Readityourself plugin error: '. 13 $GLOBALS['plugin_errors'][] = 'Readityourself plugin error: '.
15 'Please define "$GLOBALS[\'plugins\'][\'READITYOUSELF_URL\']" '. 14 'Please define the "READITYOUSELF_URL" setting in the plugin administration page.';
16 'in "plugins/readityourself/config.php" or in your Shaarli config.php file.';
17} 15}
18 16
19/** 17/**
20 * Add readityourself icon to link_plugin when rendering linklist. 18 * Add readityourself icon to link_plugin when rendering linklist.
21 * 19 *
22 * @param mixed $data - linklist data. 20 * @param mixed $data Linklist data.
21 * @param ConfigManager $conf Configuration Manager instance.
23 * 22 *
24 * @return mixed - linklist data with readityourself plugin. 23 * @return mixed - linklist data with readityourself plugin.
25 */ 24 */
26function hook_readityourself_render_linklist($data) 25function hook_readityourself_render_linklist($data, $conf)
27{ 26{
28 $conf = ConfigManager::getInstance();
29 $riyUrl = $conf->get('plugins.READITYOUSELF_URL'); 27 $riyUrl = $conf->get('plugins.READITYOUSELF_URL');
30 if (empty($riyUrl)) { 28 if (empty($riyUrl)) {
31 return $data; 29 return $data;