1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 19:05:55 +00:00

pluginhost: rework run_hooks() to be shorter, add callback variant; implement exception handling for both

This commit is contained in:
Andrew Dolgov
2021-02-08 14:24:45 +03:00
parent 20b56b5b23
commit 1eb1629d9e
11 changed files with 115 additions and 91 deletions

View File

@@ -559,8 +559,7 @@ class Pref_Prefs extends Handler_Protected {
print "</div>"; # tab container
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION,
"hook_prefs_tab_section", "prefPrefsAuth");
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION, "prefPrefsAuth");
print "</div>"; #pane
@@ -814,8 +813,7 @@ class Pref_Prefs extends Handler_Protected {
print_hidden("boolean_prefs", "$listed_boolean_prefs");
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION,
"hook_prefs_tab_section", "prefPrefsPrefsInside");
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION, "prefPrefsPrefsInside");
print '</div>'; # inside pane
print '<div dojoType="dijit.layout.ContentPane" region="bottom">';
@@ -840,8 +838,7 @@ class Pref_Prefs extends Handler_Protected {
print "&nbsp;";
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION,
"hook_prefs_tab_section", "prefPrefsPrefsOutside");
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION, "prefPrefsPrefsOutside");
print "</form>";
print '</div>'; # inner pane
@@ -1005,8 +1002,7 @@ class Pref_Prefs extends Handler_Protected {
print "</form>";
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB,
"hook_prefs_tab", "prefPrefs");
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB, "prefPrefs");
print "</div>"; #container