aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/demo_plugin
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2016-10-12 13:58:35 +0200
committerArthurHoaro <arthur@hoa.ro>2016-10-12 13:58:35 +0200
commitbc22c9a0acb095970e9494cbe8954f0612e05dc0 (patch)
tree4e3a94b7469f5b2e3eaf946756235730429bf9d4 /plugins/demo_plugin
parent890afc32f744859d11b97eb26ed5c030af9b4145 (diff)
parentebd67c6e1b40aebdd3a52285ce9ff9412b2a3038 (diff)
downloadShaarli-bc22c9a0acb095970e9494cbe8954f0612e05dc0.tar.gz
Shaarli-bc22c9a0acb095970e9494cbe8954f0612e05dc0.tar.zst
Shaarli-bc22c9a0acb095970e9494cbe8954f0612e05dc0.zip
Merge tag 'v0.7.0' of github.com:shaarli/Shaarli into stable
Release v0.7.0
Diffstat (limited to 'plugins/demo_plugin')
-rw-r--r--plugins/demo_plugin/demo_plugin.php27
1 files changed, 26 insertions, 1 deletions
diff --git a/plugins/demo_plugin/demo_plugin.php b/plugins/demo_plugin/demo_plugin.php
index f5f028e0..18834e53 100644
--- a/plugins/demo_plugin/demo_plugin.php
+++ b/plugins/demo_plugin/demo_plugin.php
@@ -322,4 +322,29 @@ function hook_demo_plugin_delete_link($data)
322 if (strpos($data['url'], 'youtube.com') !== false) { 322 if (strpos($data['url'], 'youtube.com') !== false) {
323 exit('You can not delete a YouTube link. Don\'t ask.'); 323 exit('You can not delete a YouTube link. Don\'t ask.');
324 } 324 }
325} \ No newline at end of file 325}
326
327/**
328 * Execute render_feed hook.
329 * Called with ATOM and RSS feed.
330 *
331 * Special data keys:
332 * - _PAGE_: current page
333 * - _LOGGEDIN_: true/false
334 *
335 * @param array $data data passed to plugin
336 *
337 * @return array altered $data.
338 */
339function hook_demo_plugin_render_feed($data)
340{
341 foreach ($data['links'] as &$link) {
342 if ($data['_PAGE_'] == Router::$PAGE_FEED_ATOM) {
343 $link['description'] .= ' - ATOM Feed' ;
344 }
345 elseif ($data['_PAGE_'] == Router::$PAGE_FEED_RSS) {
346 $link['description'] .= ' - RSS Feed';
347 }
348 }
349 return $data;
350}