aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-07-06 08:04:35 +0200
committerArthurHoaro <arthur@hoa.ro>2020-07-23 21:19:21 +0200
commit1a8ac737e52cb25a5c346232ee398f5908cee7d7 (patch)
tree31954c4e106b5743e2005d72c2d548a0be8d6dce /plugins
parent6132d64748dfc6806ed25f71d2e078a5ed29d071 (diff)
downloadShaarli-1a8ac737e52cb25a5c346232ee398f5908cee7d7.tar.gz
Shaarli-1a8ac737e52cb25a5c346232ee398f5908cee7d7.tar.zst
Shaarli-1a8ac737e52cb25a5c346232ee398f5908cee7d7.zip
Process main page (linklist) through Slim controller
Including a bunch of improvements on the container, and helper used across new controllers.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/addlink_toolbar/addlink_toolbar.php4
-rw-r--r--plugins/demo_plugin/demo_plugin.php8
-rw-r--r--plugins/isso/isso.php4
-rw-r--r--plugins/playvideos/playvideos.php6
-rw-r--r--plugins/pubsubhubbub/pubsubhubbub.php4
-rw-r--r--plugins/qrcode/qrcode.php6
6 files changed, 16 insertions, 16 deletions
diff --git a/plugins/addlink_toolbar/addlink_toolbar.php b/plugins/addlink_toolbar/addlink_toolbar.php
index 8bf4ed46..c3e7abaf 100644
--- a/plugins/addlink_toolbar/addlink_toolbar.php
+++ b/plugins/addlink_toolbar/addlink_toolbar.php
@@ -5,7 +5,7 @@
5 * Adds the addlink input on the linklist page. 5 * Adds the addlink input on the linklist page.
6 */ 6 */
7 7
8use Shaarli\Router; 8use Shaarli\Render\TemplatePage;
9 9
10/** 10/**
11 * When linklist is displayed, add play videos to header's toolbar. 11 * When linklist is displayed, add play videos to header's toolbar.
@@ -16,7 +16,7 @@ use Shaarli\Router;
16 */ 16 */
17function hook_addlink_toolbar_render_header($data) 17function hook_addlink_toolbar_render_header($data)
18{ 18{
19 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) { 19 if ($data['_PAGE_'] == TemplatePage::LINKLIST && $data['_LOGGEDIN_'] === true) {
20 $form = array( 20 $form = array(
21 'attr' => array( 21 'attr' => array(
22 'method' => 'GET', 22 'method' => 'GET',
diff --git a/plugins/demo_plugin/demo_plugin.php b/plugins/demo_plugin/demo_plugin.php
index 8ae1b479..dd73d6a2 100644
--- a/plugins/demo_plugin/demo_plugin.php
+++ b/plugins/demo_plugin/demo_plugin.php
@@ -16,7 +16,7 @@
16 16
17use Shaarli\Config\ConfigManager; 17use Shaarli\Config\ConfigManager;
18use Shaarli\Plugin\PluginManager; 18use Shaarli\Plugin\PluginManager;
19use Shaarli\Router; 19use Shaarli\Render\TemplatePage;
20 20
21/** 21/**
22 * In the footer hook, there is a working example of a translation extension for Shaarli. 22 * In the footer hook, there is a working example of a translation extension for Shaarli.
@@ -74,7 +74,7 @@ function demo_plugin_init($conf)
74function hook_demo_plugin_render_header($data) 74function hook_demo_plugin_render_header($data)
75{ 75{
76 // Only execute when linklist is rendered. 76 // Only execute when linklist is rendered.
77 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) { 77 if ($data['_PAGE_'] == TemplatePage::LINKLIST) {
78 // If loggedin 78 // If loggedin
79 if ($data['_LOGGEDIN_'] === true) { 79 if ($data['_LOGGEDIN_'] === true) {
80 /* 80 /*
@@ -441,9 +441,9 @@ function hook_demo_plugin_delete_link($data)
441function hook_demo_plugin_render_feed($data) 441function hook_demo_plugin_render_feed($data)
442{ 442{
443 foreach ($data['links'] as &$link) { 443 foreach ($data['links'] as &$link) {
444 if ($data['_PAGE_'] == Router::$PAGE_FEED_ATOM) { 444 if ($data['_PAGE_'] == TemplatePage::FEED_ATOM) {
445 $link['description'] .= ' - ATOM Feed' ; 445 $link['description'] .= ' - ATOM Feed' ;
446 } elseif ($data['_PAGE_'] == Router::$PAGE_FEED_RSS) { 446 } elseif ($data['_PAGE_'] == TemplatePage::FEED_RSS) {
447 $link['description'] .= ' - RSS Feed'; 447 $link['description'] .= ' - RSS Feed';
448 } 448 }
449 } 449 }
diff --git a/plugins/isso/isso.php b/plugins/isso/isso.php
index dab75dd5..16edd9a6 100644
--- a/plugins/isso/isso.php
+++ b/plugins/isso/isso.php
@@ -6,7 +6,7 @@
6 6
7use Shaarli\Config\ConfigManager; 7use Shaarli\Config\ConfigManager;
8use Shaarli\Plugin\PluginManager; 8use Shaarli\Plugin\PluginManager;
9use Shaarli\Router; 9use Shaarli\Render\TemplatePage;
10 10
11/** 11/**
12 * Display an error everywhere if the plugin is enabled without configuration. 12 * Display an error everywhere if the plugin is enabled without configuration.
@@ -76,7 +76,7 @@ function hook_isso_render_linklist($data, $conf)
76 */ 76 */
77function hook_isso_render_includes($data) 77function hook_isso_render_includes($data)
78{ 78{
79 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) { 79 if ($data['_PAGE_'] == TemplatePage::LINKLIST) {
80 $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/isso/isso.css'; 80 $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/isso/isso.css';
81 } 81 }
82 82
diff --git a/plugins/playvideos/playvideos.php b/plugins/playvideos/playvideos.php
index 0341ed59..91a9c1e5 100644
--- a/plugins/playvideos/playvideos.php
+++ b/plugins/playvideos/playvideos.php
@@ -7,7 +7,7 @@
7 */ 7 */
8 8
9use Shaarli\Plugin\PluginManager; 9use Shaarli\Plugin\PluginManager;
10use Shaarli\Router; 10use Shaarli\Render\TemplatePage;
11 11
12/** 12/**
13 * When linklist is displayed, add play videos to header's toolbar. 13 * When linklist is displayed, add play videos to header's toolbar.
@@ -18,7 +18,7 @@ use Shaarli\Router;
18 */ 18 */
19function hook_playvideos_render_header($data) 19function hook_playvideos_render_header($data)
20{ 20{
21 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) { 21 if ($data['_PAGE_'] == TemplatePage::LINKLIST) {
22 $playvideo = array( 22 $playvideo = array(
23 'attr' => array( 23 'attr' => array(
24 'href' => '#', 24 'href' => '#',
@@ -42,7 +42,7 @@ function hook_playvideos_render_header($data)
42 */ 42 */
43function hook_playvideos_render_footer($data) 43function hook_playvideos_render_footer($data)
44{ 44{
45 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) { 45 if ($data['_PAGE_'] == TemplatePage::LINKLIST) {
46 $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/playvideos/jquery-1.11.2.min.js'; 46 $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/playvideos/jquery-1.11.2.min.js';
47 $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/playvideos/youtube_playlist.js'; 47 $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/playvideos/youtube_playlist.js';
48 } 48 }
diff --git a/plugins/pubsubhubbub/pubsubhubbub.php b/plugins/pubsubhubbub/pubsubhubbub.php
index 170f3494..8fe6799c 100644
--- a/plugins/pubsubhubbub/pubsubhubbub.php
+++ b/plugins/pubsubhubbub/pubsubhubbub.php
@@ -13,7 +13,7 @@ use pubsubhubbub\publisher\Publisher;
13use Shaarli\Config\ConfigManager; 13use Shaarli\Config\ConfigManager;
14use Shaarli\Feed\FeedBuilder; 14use Shaarli\Feed\FeedBuilder;
15use Shaarli\Plugin\PluginManager; 15use Shaarli\Plugin\PluginManager;
16use Shaarli\Router; 16use Shaarli\Render\TemplatePage;
17 17
18/** 18/**
19 * Plugin init function - set the hub to the default appspot one. 19 * Plugin init function - set the hub to the default appspot one.
@@ -41,7 +41,7 @@ function pubsubhubbub_init($conf)
41 */ 41 */
42function hook_pubsubhubbub_render_feed($data, $conf) 42function hook_pubsubhubbub_render_feed($data, $conf)
43{ 43{
44 $feedType = $data['_PAGE_'] == Router::$PAGE_FEED_RSS ? FeedBuilder::$FEED_RSS : FeedBuilder::$FEED_ATOM; 44 $feedType = $data['_PAGE_'] == TemplatePage::FEED_RSS ? FeedBuilder::$FEED_RSS : FeedBuilder::$FEED_ATOM;
45 $template = file_get_contents(PluginManager::$PLUGINS_PATH . '/pubsubhubbub/hub.'. $feedType .'.xml'); 45 $template = file_get_contents(PluginManager::$PLUGINS_PATH . '/pubsubhubbub/hub.'. $feedType .'.xml');
46 $data['feed_plugins_header'][] = sprintf($template, $conf->get('plugins.PUBSUBHUB_URL')); 46 $data['feed_plugins_header'][] = sprintf($template, $conf->get('plugins.PUBSUBHUB_URL'));
47 47
diff --git a/plugins/qrcode/qrcode.php b/plugins/qrcode/qrcode.php
index c1d237d5..2ec0cb65 100644
--- a/plugins/qrcode/qrcode.php
+++ b/plugins/qrcode/qrcode.php
@@ -6,7 +6,7 @@
6 */ 6 */
7 7
8use Shaarli\Plugin\PluginManager; 8use Shaarli\Plugin\PluginManager;
9use Shaarli\Router; 9use Shaarli\Render\TemplatePage;
10 10
11/** 11/**
12 * Add qrcode icon to link_plugin when rendering linklist. 12 * Add qrcode icon to link_plugin when rendering linklist.
@@ -40,7 +40,7 @@ function hook_qrcode_render_linklist($data)
40 */ 40 */
41function hook_qrcode_render_footer($data) 41function hook_qrcode_render_footer($data)
42{ 42{
43 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) { 43 if ($data['_PAGE_'] == TemplatePage::LINKLIST) {
44 $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/qrcode/shaarli-qrcode.js'; 44 $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/qrcode/shaarli-qrcode.js';
45 } 45 }
46 46
@@ -56,7 +56,7 @@ function hook_qrcode_render_footer($data)
56 */ 56 */
57function hook_qrcode_render_includes($data) 57function hook_qrcode_render_includes($data)
58{ 58{
59 if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) { 59 if ($data['_PAGE_'] == TemplatePage::LINKLIST) {
60 $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.css'; 60 $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.css';
61 } 61 }
62 62