diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-07-06 08:04:35 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-07-23 21:19:21 +0200 |
commit | 1a8ac737e52cb25a5c346232ee398f5908cee7d7 (patch) | |
tree | 31954c4e106b5743e2005d72c2d548a0be8d6dce /plugins | |
parent | 6132d64748dfc6806ed25f71d2e078a5ed29d071 (diff) | |
download | Shaarli-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.php | 4 | ||||
-rw-r--r-- | plugins/demo_plugin/demo_plugin.php | 8 | ||||
-rw-r--r-- | plugins/isso/isso.php | 4 | ||||
-rw-r--r-- | plugins/playvideos/playvideos.php | 6 | ||||
-rw-r--r-- | plugins/pubsubhubbub/pubsubhubbub.php | 4 | ||||
-rw-r--r-- | plugins/qrcode/qrcode.php | 6 |
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 | ||
8 | use Shaarli\Router; | 8 | use 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 | */ |
17 | function hook_addlink_toolbar_render_header($data) | 17 | function 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 | ||
17 | use Shaarli\Config\ConfigManager; | 17 | use Shaarli\Config\ConfigManager; |
18 | use Shaarli\Plugin\PluginManager; | 18 | use Shaarli\Plugin\PluginManager; |
19 | use Shaarli\Router; | 19 | use 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) | |||
74 | function hook_demo_plugin_render_header($data) | 74 | function 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) | |||
441 | function hook_demo_plugin_render_feed($data) | 441 | function 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 | ||
7 | use Shaarli\Config\ConfigManager; | 7 | use Shaarli\Config\ConfigManager; |
8 | use Shaarli\Plugin\PluginManager; | 8 | use Shaarli\Plugin\PluginManager; |
9 | use Shaarli\Router; | 9 | use 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 | */ |
77 | function hook_isso_render_includes($data) | 77 | function 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 | ||
9 | use Shaarli\Plugin\PluginManager; | 9 | use Shaarli\Plugin\PluginManager; |
10 | use Shaarli\Router; | 10 | use 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 | */ |
19 | function hook_playvideos_render_header($data) | 19 | function 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 | */ |
43 | function hook_playvideos_render_footer($data) | 43 | function 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; | |||
13 | use Shaarli\Config\ConfigManager; | 13 | use Shaarli\Config\ConfigManager; |
14 | use Shaarli\Feed\FeedBuilder; | 14 | use Shaarli\Feed\FeedBuilder; |
15 | use Shaarli\Plugin\PluginManager; | 15 | use Shaarli\Plugin\PluginManager; |
16 | use Shaarli\Router; | 16 | use 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 | */ |
42 | function hook_pubsubhubbub_render_feed($data, $conf) | 42 | function 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 | ||
8 | use Shaarli\Plugin\PluginManager; | 8 | use Shaarli\Plugin\PluginManager; |
9 | use Shaarli\Router; | 9 | use 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 | */ |
41 | function hook_qrcode_render_footer($data) | 41 | function 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 | */ |
57 | function hook_qrcode_render_includes($data) | 57 | function 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 | ||