aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-10-16 13:06:06 +0200
committerArthurHoaro <arthur@hoa.ro>2020-10-16 13:06:06 +0200
commit3adbdc2a83e6b77a4ca62094c5d857524e39d211 (patch)
tree5e6dd92c7e47edeb4f2917f7718ad7ad7113e23f /plugins
parent7f5250421be4832b9679d8140bc4a71c8005dfa3 (diff)
downloadShaarli-3adbdc2a83e6b77a4ca62094c5d857524e39d211.tar.gz
Shaarli-3adbdc2a83e6b77a4ca62094c5d857524e39d211.tar.zst
Shaarli-3adbdc2a83e6b77a4ca62094c5d857524e39d211.zip
Inject ROOT_PATH in plugin instead of regenerating it everywhere
Diffstat (limited to 'plugins')
-rw-r--r--plugins/archiveorg/archiveorg.php3
-rw-r--r--plugins/isso/isso.php2
-rw-r--r--plugins/qrcode/qrcode.php3
-rw-r--r--plugins/wallabag/wallabag.php2
4 files changed, 4 insertions, 6 deletions
diff --git a/plugins/archiveorg/archiveorg.php b/plugins/archiveorg/archiveorg.php
index a7b595e1..ed271532 100644
--- a/plugins/archiveorg/archiveorg.php
+++ b/plugins/archiveorg/archiveorg.php
@@ -17,8 +17,7 @@ use Shaarli\Plugin\PluginManager;
17function hook_archiveorg_render_linklist($data) 17function hook_archiveorg_render_linklist($data)
18{ 18{
19 $archive_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/archiveorg/archiveorg.html'); 19 $archive_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/archiveorg/archiveorg.html');
20 $rootPath = preg_replace('#/index\.php$#', '', $data['_BASE_PATH_'] ?? ''); 20 $path = ($data['_ROOT_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH;
21 $path = $rootPath . '/' . PluginManager::$PLUGINS_PATH;
22 21
23 foreach ($data['links'] as &$value) { 22 foreach ($data['links'] as &$value) {
24 $isNote = startsWith($value['real_url'], '/shaare/'); 23 $isNote = startsWith($value['real_url'], '/shaare/');
diff --git a/plugins/isso/isso.php b/plugins/isso/isso.php
index 79e7380b..d4632163 100644
--- a/plugins/isso/isso.php
+++ b/plugins/isso/isso.php
@@ -54,7 +54,7 @@ function hook_isso_render_linklist($data, $conf)
54 if ($conf->get('resource.theme') === 'default') { 54 if ($conf->get('resource.theme') === 'default') {
55 $button .= '<i class="linklist-plugin-icon fa fa-comment"></i>'; 55 $button .= '<i class="linklist-plugin-icon fa fa-comment"></i>';
56 } else { 56 } else {
57 $button .= '<img class="linklist-plugin-icon" src="plugins/isso/comment.png" '; 57 $button .= '<img class="linklist-plugin-icon" src="'. $data['_ROOT_PATH_'].'/plugins/isso/comment.png" ';
58 $button .= 'title="Comment on this shaare" alt="Comments" />'; 58 $button .= 'title="Comment on this shaare" alt="Comments" />';
59 } 59 }
60 $button .= '</a></span>'; 60 $button .= '</a></span>';
diff --git a/plugins/qrcode/qrcode.php b/plugins/qrcode/qrcode.php
index 45712859..24fd18ba 100644
--- a/plugins/qrcode/qrcode.php
+++ b/plugins/qrcode/qrcode.php
@@ -19,8 +19,7 @@ function hook_qrcode_render_linklist($data)
19{ 19{
20 $qrcode_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.html'); 20 $qrcode_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.html');
21 21
22 $rootPath = preg_replace('#/index\.php$#', '', $data['_BASE_PATH_'] ?? ''); 22 $path = ($data['_ROOT_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH;
23 $path = $rootPath . '/' . PluginManager::$PLUGINS_PATH;
24 foreach ($data['links'] as &$value) { 23 foreach ($data['links'] as &$value) {
25 $qrcode = sprintf( 24 $qrcode = sprintf(
26 $qrcode_html, 25 $qrcode_html,
diff --git a/plugins/wallabag/wallabag.php b/plugins/wallabag/wallabag.php
index 805c1ad9..d0df3501 100644
--- a/plugins/wallabag/wallabag.php
+++ b/plugins/wallabag/wallabag.php
@@ -45,7 +45,7 @@ function hook_wallabag_render_linklist($data, $conf)
45 $wallabagHtml = file_get_contents(PluginManager::$PLUGINS_PATH . '/wallabag/wallabag.html'); 45 $wallabagHtml = file_get_contents(PluginManager::$PLUGINS_PATH . '/wallabag/wallabag.html');
46 46
47 $linkTitle = t('Save to wallabag'); 47 $linkTitle = t('Save to wallabag');
48 $path = ($data['_BASE_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH; 48 $path = ($data['_ROOT_PATH_'] ?? '') . '/' . PluginManager::$PLUGINS_PATH;
49 49
50 foreach ($data['links'] as &$value) { 50 foreach ($data['links'] as &$value) {
51 $wallabag = sprintf( 51 $wallabag = sprintf(