From 3b52cea8110541e1e5d8cb06198c11a2ed074b1c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 8 Feb 2021 16:14:48 +0300 Subject: move some old-style handlers to new callback ones --- index.php | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index c10b21e5c..6834891ee 100644 --- a/index.php +++ b/index.php @@ -153,9 +153,9 @@ get_hooks(PluginHost::HOOK_FEED_TREE) as $p) { - echo $p->hook_feed_tree(); - } + PluginHost::getInstance()->run_hooks_callback(PluginHost::HOOK_FEED_TREE, function ($result) { + echo $result; + }); ?>
@@ -174,9 +174,10 @@ title="">new_releases get_hooks(PluginHost::HOOK_MAIN_TOOLBAR_BUTTON) as $p) { - echo $p->hook_main_toolbar_button(); - } + + PluginHost::getInstance()->run_hooks_callback(PluginHost::HOOK_MAIN_TOOLBAR_BUTTON, function ($result) { + echo $result; + }); ?>
@@ -206,13 +207,13 @@ - get_hooks(PluginHost::HOOK_HEADLINES_CUSTOM_SORT_MAP) as $p) { - $sort_map = $p->hook_headlines_custom_sort_map(); - - foreach ($sort_map as $sort_value => $sort_title) { - print ""; - } - } ?> + run_hooks_callback(PluginHost::HOOK_HEADLINES_CUSTOM_SORT_MAP, function ($result) { + foreach ($result as $sort_value => $sort_title) { + print ""; + } + }); + ?>
@@ -235,9 +236,9 @@
get_hooks(PluginHost::HOOK_TOOLBAR_BUTTON) as $p) { - echo $p->hook_toolbar_button(); - } + PluginHost::getInstance()->run_hooks_callback(PluginHost::HOOK_TOOLBAR_BUTTON, function ($result) { + echo $result; + }); ?>
@@ -257,9 +258,9 @@
get_hooks(PluginHost::HOOK_ACTION_ITEM) as $p) { - echo $p->hook_action_item(); - } + PluginHost::getInstance()->run_hooks_callback(PluginHost::HOOK_ACTION_ITEM, function ($result) { + echo $result; + }); ?> -- cgit v1.2.3