Browse Source

Update Addon functions and calls

Update function names and calls for Addon class.
pull/4288/head
Adam Magness 3 years ago
parent
commit
11cf36105c
73 changed files with 544 additions and 464 deletions
  1. +4
    -4
      boot.php
  2. +90
    -90
      doc/Plugins.md
  3. +89
    -89
      doc/de/Plugins.md
  4. +10
    -9
      include/acl_selectors.php
  5. +4
    -3
      include/api.php
  6. +2
    -1
      include/bb2diaspora.php
  7. +2
    -1
      include/bbcode.php
  8. +7
    -6
      include/conversation.php
  9. +5
    -4
      include/enotify.php
  10. +3
    -2
      include/event.php
  11. +2
    -1
      include/friendica_smarty.php
  12. +2
    -1
      include/html2bbcode.php
  13. +7
    -6
      include/items.php
  14. +2
    -1
      include/like.php
  15. +2
    -1
      include/network.php
  16. +2
    -1
      include/security.php
  17. +6
    -5
      include/text.php
  18. +13
    -12
      index.php
  19. +6
    -5
      mod/admin.php
  20. +3
    -2
      mod/contacts.php
  21. +2
    -1
      mod/directory.php
  22. +3
    -2
      mod/editpost.php
  23. +2
    -1
      mod/friendica.php
  24. +3
    -2
      mod/home.php
  25. +4
    -3
      mod/item.php
  26. +2
    -1
      mod/lockview.php
  27. +2
    -1
      mod/manage.php
  28. +3
    -2
      mod/network.php
  29. +21
    -22
      mod/nodeinfo.php
  30. +2
    -1
      mod/parse_url.php
  31. +9
    -8
      mod/photos.php
  32. +2
    -1
      mod/ping.php
  33. +2
    -1
      mod/poke.php
  34. +2
    -1
      mod/profile.php
  35. +3
    -2
      mod/profiles.php
  36. +3
    -2
      mod/register.php
  37. +9
    -8
      mod/settings.php
  38. +14
    -13
      mod/statistics_json.php
  39. +2
    -1
      mod/subthread.php
  40. +2
    -1
      mod/tagger.php
  41. +2
    -1
      mod/uexport.php
  42. +2
    -1
      mod/xrd.php
  43. +2
    -1
      scripts/worker.php
  44. +5
    -4
      src/Content/ContactSelector.php
  45. +3
    -2
      src/Content/Feature.php
  46. +3
    -2
      src/Content/Nav.php
  47. +2
    -1
      src/Content/OEmbed.php
  48. +2
    -1
      src/Content/Smilies.php
  49. +7
    -6
      src/Content/Widget.php
  50. +76
    -62
      src/Core/Addon.php
  51. +2
    -1
      src/Core/Worker.php
  52. +3
    -2
      src/Model/Contact.php
  53. +5
    -4
      src/Model/Profile.php
  54. +3
    -2
      src/Model/User.php
  55. +3
    -2
      src/Module/Login.php
  56. +2
    -2
      src/Module/Logout.php
  57. +2
    -1
      src/Network/FKOAuth1.php
  58. +3
    -2
      src/Object/Post.php
  59. +4
    -3
      src/Protocol/DFRN.php
  60. +3
    -2
      src/Util/Emailer.php
  61. +4
    -2
      src/Util/Map.php
  62. +2
    -1
      src/Util/ParseUrl.php
  63. +2
    -1
      src/Worker/Cron.php
  64. +2
    -1
      src/Worker/CronHooks.php
  65. +2
    -1
      src/Worker/Directory.php
  66. +3
    -2
      src/Worker/Expire.php
  67. +3
    -2
      src/Worker/Notifier.php
  68. +3
    -2
      src/Worker/Queue.php
  69. +3
    -2
      update.php
  70. +1
    -1
      view/theme/frio/php/schema.php
  71. +13
    -12
      view/theme/frio/theme.php
  72. +3
    -2
      view/theme/frost/theme.php
  73. +16
    -15
      view/theme/vier/theme.php

+ 4
- 4
boot.php View File

@ -21,6 +21,7 @@
require_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Core\Cache;
use Friendica\Core\Config;
@ -32,7 +33,6 @@ use Friendica\Database\DBStructure;
use Friendica\Module\Login;
require_once 'include/network.php';
require_once 'include/plugin.php';
require_once 'include/text.php';
require_once 'include/datetime.php';
require_once 'include/pgettext.php';
@ -833,7 +833,7 @@ function check_plugins(App $a)
if (count($installed)) {
foreach ($installed as $i) {
if (!in_array($i['name'], $plugins_arr)) {
uninstall_plugin($i['name']);
Addon::uninstall($i['name']);
} else {
$installed_arr[] = $i['name'];
}
@ -843,12 +843,12 @@ function check_plugins(App $a)
if (count($plugins_arr)) {
foreach ($plugins_arr as $p) {
if (!in_array($p, $installed_arr)) {
install_plugin($p);
Addon::install($p);
}
}
}
load_hooks();
Addon::loadHooks();
return;
}


+ 90
- 90
doc/Plugins.md View File

@ -27,7 +27,7 @@ Plugins should contain a comment block with the four following parameters:
Register your plugin hooks during installation.
register_hook($hookname, $file, $function);
Addon::registerHook($hookname, $file, $function);
$hookname is a string and corresponds to a known Friendica hook.
@ -296,182 +296,182 @@ Complete list of hook callbacks
Here is a complete list of all hook callbacks with file locations (as of 14-Feb-2012). Please see the source for details of any hooks not documented above.
boot.php: call_hooks('login_hook',$o);
boot.php: Addon::callHooks('login_hook',$o);
boot.php: call_hooks('profile_sidebar_enter', $profile);
boot.php: Addon::callHooks('profile_sidebar_enter', $profile);
boot.php: call_hooks('profile_sidebar', $arr);
boot.php: Addon::callHooks('profile_sidebar', $arr);
boot.php: call_hooks("proc_run", $arr);
boot.php: Addon::callHooks("proc_run", $arr);
include/contact_selectors.php: call_hooks('network_to_name', $nets);
include/contact_selectors.php: Addon::callHooks('network_to_name', $nets);
include/api.php: call_hooks('logged_in', $a->user);
include/api.php: Addon::callHooks('logged_in', $a->user);
include/api.php: call_hooks('logged_in', $a->user);
include/api.php: Addon::callHooks('logged_in', $a->user);
include/queue.php: call_hooks('queue_predeliver', $a, $r);
include/queue.php: Addon::callHooks('queue_predeliver', $a, $r);
include/queue.php: call_hooks('queue_deliver', $a, $params);
include/queue.php: Addon::callHooks('queue_deliver', $a, $params);
include/text.php: call_hooks('contact_block_end', $arr);
include/text.php: Addon::callHooks('contact_block_end', $arr);
include/text.php: call_hooks('smilie', $s);
include/text.php: Addon::callHooks('smilie', $s);
include/text.php: call_hooks('prepare_body_init', $item);
include/text.php: Addon::callHooks('prepare_body_init', $item);
include/text.php: call_hooks('prepare_body', $prep_arr);
include/text.php: Addon::callHooks('prepare_body', $prep_arr);
include/text.php: call_hooks('prepare_body_final', $prep_arr);
include/text.php: Addon::callHooks('prepare_body_final', $prep_arr);
include/nav.php: call_hooks('page_header', $a->page['nav']);
include/nav.php: Addon::callHooks('page_header', $a->page['nav']);
include/auth.php: call_hooks('authenticate', $addon_auth);
include/auth.php: Addon::callHooks('authenticate', $addon_auth);
include/bbcode.php: call_hooks('bbcode',$Text);
include/bbcode.php: Addon::callHooks('bbcode',$Text);
include/oauth.php: call_hooks('logged_in', $a->user);
include/oauth.php: Addon::callHooks('logged_in', $a->user);
include/acl_selectors.php: call_hooks($a->module . '_pre_' . $selname, $arr);
include/acl_selectors.php: Addon::callHooks($a->module . '_pre_' . $selname, $arr);
include/acl_selectors.php: call_hooks($a->module . '_post_' . $selname, $o);
include/acl_selectors.php: Addon::callHooks($a->module . '_post_' . $selname, $o);
include/acl_selectors.php: call_hooks('contact_select_options', $x);
include/acl_selectors.php: Addon::callHooks('contact_select_options', $x);
include/acl_selectors.php: call_hooks($a->module . '_pre_' . $selname, $arr);
include/acl_selectors.php: Addon::callHooks($a->module . '_pre_' . $selname, $arr);
include/acl_selectors.php: call_hooks($a->module . '_post_' . $selname, $o);
include/acl_selectors.php: Addon::callHooks($a->module . '_post_' . $selname, $o);
include/acl_selectors.php: call_hooks($a->module . '_pre_' . $selname, $arr);
include/acl_selectors.php: Addon::callHooks($a->module . '_pre_' . $selname, $arr);
include/acl_selectors.php: call_hooks($a->module . '_post_' . $selname, $o);
include/acl_selectors.php: Addon::callHooks($a->module . '_post_' . $selname, $o);
include/acl_selectors.php call_hooks('acl_lookup_end', $results);
include/acl_selectors.php Addon::callHooks('acl_lookup_end', $results);
include/notifier.php: call_hooks('notifier_normal',$target_item);
include/notifier.php: Addon::callHooks('notifier_normal',$target_item);
include/notifier.php: call_hooks('notifier_end',$target_item);
include/notifier.php: Addon::callHooks('notifier_end',$target_item);
include/items.php: call_hooks('atom_feed', $atom);
include/items.php: Addon::callHooks('atom_feed', $atom);
include/items.php: call_hooks('atom_feed_end', $atom);
include/items.php: Addon::callHooks('atom_feed_end', $atom);
include/items.php: call_hooks('atom_feed_end', $atom);
include/items.php: Addon::callHooks('atom_feed_end', $atom);
include/items.php: call_hooks('parse_atom', $arr);
include/items.php: Addon::callHooks('parse_atom', $arr);
include/items.php: call_hooks('post_remote',$arr);
include/items.php: Addon::callHooks('post_remote',$arr);
include/items.php: call_hooks('atom_author', $o);
include/items.php: Addon::callHooks('atom_author', $o);
include/items.php: call_hooks('atom_entry', $o);
include/items.php: Addon::callHooks('atom_entry', $o);
include/bb2diaspora.php: call_hooks('bb2diaspora',$Text);
include/bb2diaspora.php: Addon::callHooks('bb2diaspora',$Text);
include/cronhooks.php: call_hooks('cron', $d);
include/cronhooks.php: Addon::callHooks('cron', $d);
include/security.php: call_hooks('logged_in', $a->user);
include/security.php: Addon::callHooks('logged_in', $a->user);
include/html2bbcode.php: call_hooks('html2bbcode', $text);
include/html2bbcode.php: Addon::callHooks('html2bbcode', $text);
include/Contact.php: call_hooks('remove_user',$r[0]);
include/Contact.php: Addon::callHooks('remove_user',$r[0]);
include/Contact.php: call_hooks('contact_photo_menu', $args);
include/Contact.php: Addon::callHooks('contact_photo_menu', $args);
include/conversation.php: call_hooks('conversation_start',$cb);
include/conversation.php: Addon::callHooks('conversation_start',$cb);
include/conversation.php: call_hooks('render_location',$locate);
include/conversation.php: Addon::callHooks('render_location',$locate);
include/conversation.php: call_hooks('display_item', $arr);
include/conversation.php: Addon::callHooks('display_item', $arr);
include/conversation.php: call_hooks('render_location',$locate);
include/conversation.php: Addon::callHooks('render_location',$locate);
include/conversation.php: call_hooks('display_item', $arr);
include/conversation.php: Addon::callHooks('display_item', $arr);
include/conversation.php: call_hooks('item_photo_menu', $args);
include/conversation.php: Addon::callHooks('item_photo_menu', $args);
include/conversation.php: call_hooks('jot_tool', $jotplugins);
include/conversation.php: Addon::callHooks('jot_tool', $jotplugins);
include/conversation.php: call_hooks('jot_networks', $jotnets);
include/conversation.php: Addon::callHooks('jot_networks', $jotnets);
include/plugin.php:if(! function_exists('call_hooks')) {
include/plugin.php:function call_hooks($name, &$data = null) {
include/plugin.php:function Addon::callHooks($name, &$data = null) {
index.php: call_hooks('init_1');
index.php: Addon::callHooks('init_1');
index.php:call_hooks('app_menu', $arr);
index.php:Addon::callHooks('app_menu', $arr);
index.php:call_hooks('page_end', $a->page['content']);
index.php:Addon::callHooks('page_end', $a->page['content']);
mod/photos.php: call_hooks('photo_post_init', $_POST);
mod/photos.php: Addon::callHooks('photo_post_init', $_POST);
mod/photos.php: call_hooks('photo_post_file',$ret);
mod/photos.php: Addon::callHooks('photo_post_file',$ret);
mod/photos.php: call_hooks('photo_post_end',$foo);
mod/photos.php: Addon::callHooks('photo_post_end',$foo);
mod/photos.php: call_hooks('photo_post_end',$foo);
mod/photos.php: Addon::callHooks('photo_post_end',$foo);
mod/photos.php: call_hooks('photo_post_end',$foo);
mod/photos.php: Addon::callHooks('photo_post_end',$foo);
mod/photos.php: call_hooks('photo_post_end',intval($item_id));
mod/photos.php: Addon::callHooks('photo_post_end',intval($item_id));
mod/photos.php: call_hooks('photo_upload_form',$ret);
mod/photos.php: Addon::callHooks('photo_upload_form',$ret);
mod/friendica.php: call_hooks('about_hook', $o);
mod/friendica.php: Addon::callHooks('about_hook', $o);
mod/editpost.php: call_hooks('jot_tool', $jotplugins);
mod/editpost.php: Addon::callHooks('jot_tool', $jotplugins);
mod/editpost.php: call_hooks('jot_networks', $jotnets);
mod/editpost.php: Addon::callHooks('jot_networks', $jotnets);
mod/parse_url.php: call_hooks('parse_link', $arr);
mod/parse_url.php: Addon::callHooks('parse_link', $arr);
mod/home.php: call_hooks('home_init',$ret);
mod/home.php: Addon::callHooks('home_init',$ret);
mod/home.php: call_hooks("home_content",$o);
mod/home.php: Addon::callHooks("home_content",$o);
mod/contacts.php: call_hooks('contact_edit_post', $_POST);
mod/contacts.php: Addon::callHooks('contact_edit_post', $_POST);
mod/contacts.php: call_hooks('contact_edit', $arr);
mod/contacts.php: Addon::callHooks('contact_edit', $arr);
mod/settings.php: call_hooks('plugin_settings_post', $_POST);
mod/settings.php: Addon::callHooks('plugin_settings_post', $_POST);
mod/settings.php: call_hooks('connector_settings_post', $_POST);
mod/settings.php: Addon::callHooks('connector_settings_post', $_POST);
mod/settings.php: call_hooks('settings_post', $_POST);
mod/settings.php: Addon::callHooks('settings_post', $_POST);
mod/settings.php: call_hooks('plugin_settings', $settings_addons);
mod/settings.php: Addon::callHooks('plugin_settings', $settings_addons);
mod/settings.php: call_hooks('connector_settings', $settings_connectors);
mod/settings.php: Addon::callHooks('connector_settings', $settings_connectors);
mod/settings.php: call_hooks('settings_form',$o);
mod/settings.php: Addon::callHooks('settings_form',$o);
mod/register.php: call_hooks('register_account', $newuid);
mod/register.php: Addon::callHooks('register_account', $newuid);
mod/like.php: call_hooks('post_local_end', $arr);
mod/like.php: Addon::callHooks('post_local_end', $arr);
mod/xrd.php: call_hooks('personal_xrd', $arr);
mod/xrd.php: Addon::callHooks('personal_xrd', $arr);
mod/item.php: call_hooks('post_local_start', $_REQUEST);
mod/item.php: Addon::callHooks('post_local_start', $_REQUEST);
mod/item.php: call_hooks('post_local',$datarray);
mod/item.php: Addon::callHooks('post_local',$datarray);
mod/item.php: call_hooks('post_local_end', $datarray);
mod/item.php: Addon::callHooks('post_local_end', $datarray);
mod/profile.php: call_hooks('profile_advanced',$o);
mod/profile.php: Addon::callHooks('profile_advanced',$o);
mod/profiles.php: call_hooks('profile_post', $_POST);
mod/profiles.php: Addon::callHooks('profile_post', $_POST);
mod/profiles.php: call_hooks('profile_edit', $arr);
mod/profiles.php: Addon::callHooks('profile_edit', $arr);
mod/tagger.php: call_hooks('post_local_end', $arr);
mod/tagger.php: Addon::callHooks('post_local_end', $arr);
mod/cb.php: call_hooks('cb_init');
mod/cb.php: Addon::callHooks('cb_init');
mod/cb.php: call_hooks('cb_post', $_POST);
mod/cb.php: Addon::callHooks('cb_post', $_POST);
mod/cb.php: call_hooks('cb_afterpost');
mod/cb.php: Addon::callHooks('cb_afterpost');
mod/cb.php: call_hooks('cb_content', $o);
mod/cb.php: Addon::callHooks('cb_content', $o);
mod/directory.php: call_hooks('directory_item', $arr);
mod/directory.php: Addon::callHooks('directory_item', $arr);

+ 89
- 89
doc/de/Plugins.md View File

@ -26,7 +26,7 @@ Plugins sollten einen Kommentarblock mit den folgenden vier Parametern enthalten
Registriere deine Plugin-Hooks während der Installation.
register_hook($hookname, $file, $function);
Addon::registerHook($hookname, $file, $function);
$hookname ist ein String und entspricht einem bekannten Friendica-Hook.
@ -191,180 +191,180 @@ Komplette Liste der Hook-Callbacks
Eine komplette Liste aller Hook-Callbacks mit den zugehörigen Dateien (am 14-Feb-2012 generiert): Bitte schau in die Quellcodes für Details zu Hooks, die oben nicht dokumentiert sind.
boot.php: call_hooks('login_hook',$o);
boot.php: Addon::callHooks('login_hook',$o);
boot.php: call_hooks('profile_sidebar_enter', $profile);
boot.php: Addon::callHooks('profile_sidebar_enter', $profile);
boot.php: call_hooks('profile_sidebar', $arr);
boot.php: Addon::callHooks('profile_sidebar', $arr);
boot.php: call_hooks("proc_run", $arr);
boot.php: Addon::callHooks("proc_run", $arr);
include/contact_selectors.php: call_hooks('network_to_name', $nets);
include/contact_selectors.php: Addon::callHooks('network_to_name', $nets);
include/api.php: call_hooks('logged_in', $a->user);
include/api.php: Addon::callHooks('logged_in', $a->user);
include/api.php: call_hooks('logged_in', $a->user);
include/api.php: Addon::callHooks('logged_in', $a->user);
include/queue.php: call_hooks('queue_predeliver', $a, $r);
include/queue.php: Addon::callHooks('queue_predeliver', $a, $r);
include/queue.php: call_hooks('queue_deliver', $a, $params);
include/queue.php: Addon::callHooks('queue_deliver', $a, $params);
include/text.php: call_hooks('contact_block_end', $arr);
include/text.php: Addon::callHooks('contact_block_end', $arr);
include/text.php: call_hooks('smilie', $s);
include/text.php: Addon::callHooks('smilie', $s);
include/text.php: call_hooks('prepare_body_init', $item);
include/text.php: Addon::callHooks('prepare_body_init', $item);
include/text.php: call_hooks('prepare_body', $prep_arr);
include/text.php: Addon::callHooks('prepare_body', $prep_arr);
include/text.php: call_hooks('prepare_body_final', $prep_arr);
include/text.php: Addon::callHooks('prepare_body_final', $prep_arr);
include/nav.php: call_hooks('page_header', $a->page['nav']);
include/nav.php: Addon::callHooks('page_header', $a->page['nav']);
include/auth.php: call_hooks('authenticate', $addon_auth);
include/auth.php: Addon::callHooks('authenticate', $addon_auth);
include/bbcode.php: call_hooks('bbcode',$Text);
include/bbcode.php: Addon::callHooks('bbcode',$Text);
include/oauth.php: call_hooks('logged_in', $a->user);
include/oauth.php: Addon::callHooks('logged_in', $a->user);
include/acl_selectors.php: call_hooks($a->module . '_pre_' . $selname, $arr);
include/acl_selectors.php: Addon::callHooks($a->module . '_pre_' . $selname, $arr);
include/acl_selectors.php: call_hooks($a->module . '_post_' . $selname, $o);
include/acl_selectors.php: Addon::callHooks($a->module . '_post_' . $selname, $o);
include/acl_selectors.php: call_hooks('contact_select_options', $x);
include/acl_selectors.php: Addon::callHooks('contact_select_options', $x);
include/acl_selectors.php: call_hooks($a->module . '_pre_' . $selname, $arr);
include/acl_selectors.php: Addon::callHooks($a->module . '_pre_' . $selname, $arr);
include/acl_selectors.php: call_hooks($a->module . '_post_' . $selname, $o);
include/acl_selectors.php: Addon::callHooks($a->module . '_post_' . $selname, $o);
include/acl_selectors.php: call_hooks($a->module . '_pre_' . $selname, $arr);
include/acl_selectors.php: Addon::callHooks($a->module . '_pre_' . $selname, $arr);
include/acl_selectors.php: call_hooks($a->module . '_post_' . $selname, $o);
include/acl_selectors.php: Addon::callHooks($a->module . '_post_' . $selname, $o);
include/notifier.php: call_hooks('notifier_normal',$target_item);
include/notifier.php: Addon::callHooks('notifier_normal',$target_item);
include/notifier.php: call_hooks('notifier_end',$target_item);
include/notifier.php: Addon::callHooks('notifier_end',$target_item);
include/items.php: call_hooks('atom_feed', $atom);
include/items.php: Addon::callHooks('atom_feed', $atom);
include/items.php: call_hooks('atom_feed_end', $atom);
include/items.php: Addon::callHooks('atom_feed_end', $atom);
include/items.php: call_hooks('atom_feed_end', $atom);
include/items.php: Addon::callHooks('atom_feed_end', $atom);
include/items.php: call_hooks('parse_atom', $arr);
include/items.php: Addon::callHooks('parse_atom', $arr);
include/items.php: call_hooks('post_remote',$arr);
include/items.php: Addon::callHooks('post_remote',$arr);
include/items.php: call_hooks('atom_author', $o);
include/items.php: Addon::callHooks('atom_author', $o);
include/items.php: call_hooks('atom_entry', $o);
include/items.php: Addon::callHooks('atom_entry', $o);
include/bb2diaspora.php: call_hooks('bb2diaspora',$Text);
include/bb2diaspora.php: Addon::callHooks('bb2diaspora',$Text);
include/cronhooks.php: call_hooks('cron', $d);
include/cronhooks.php: Addon::callHooks('cron', $d);
include/security.php: call_hooks('logged_in', $a->user);
include/security.php: Addon::callHooks('logged_in', $a->user);
include/html2bbcode.php: call_hooks('html2bbcode', $text);
include/html2bbcode.php: Addon::callHooks('html2bbcode', $text);
include/Contact.php: call_hooks('remove_user',$r[0]);
include/Contact.php: Addon::callHooks('remove_user',$r[0]);
include/Contact.php: call_hooks('contact_photo_menu', $args);
include/Contact.php: Addon::callHooks('contact_photo_menu', $args);
include/conversation.php: call_hooks('conversation_start',$cb);
include/conversation.php: Addon::callHooks('conversation_start',$cb);
include/conversation.php: call_hooks('render_location',$locate);
include/conversation.php: Addon::callHooks('render_location',$locate);
include/conversation.php: call_hooks('display_item', $arr);
include/conversation.php: Addon::callHooks('display_item', $arr);
include/conversation.php: call_hooks('render_location',$locate);
include/conversation.php: Addon::callHooks('render_location',$locate);
include/conversation.php: call_hooks('display_item', $arr);
include/conversation.php: Addon::callHooks('display_item', $arr);
include/conversation.php: call_hooks('item_photo_menu', $args);
include/conversation.php: Addon::callHooks('item_photo_menu', $args);
include/conversation.php: call_hooks('jot_tool', $jotplugins);
include/conversation.php: Addon::callHooks('jot_tool', $jotplugins);
include/conversation.php: call_hooks('jot_networks', $jotnets);
include/conversation.php: Addon::callHooks('jot_networks', $jotnets);
include/plugin.php: if(! function_exists('call_hooks')) {
include/plugin.php:function call_hooks($name, &$data = null) {
include/plugin.php:function Addon::callHooks($name, &$data = null) {
index.php: call_hooks('init_1');
index.php: Addon::callHooks('init_1');
index.php: call_hooks('app_menu', $arr);
index.php: Addon::callHooks('app_menu', $arr);
index.php: call_hooks('page_end', $a->page['content']);
index.php: Addon::callHooks('page_end', $a->page['content']);
mod/photos.php: call_hooks('photo_post_init', $_POST);
mod/photos.php: Addon::callHooks('photo_post_init', $_POST);
mod/photos.php: call_hooks('photo_post_file',$ret);
mod/photos.php: Addon::callHooks('photo_post_file',$ret);
mod/photos.php: call_hooks('photo_post_end',$foo);
mod/photos.php: Addon::callHooks('photo_post_end',$foo);
mod/photos.php: call_hooks('photo_post_end',$foo);
mod/photos.php: Addon::callHooks('photo_post_end',$foo);
mod/photos.php: call_hooks('photo_post_end',$foo);
mod/photos.php: Addon::callHooks('photo_post_end',$foo);
mod/photos.php: call_hooks('photo_post_end',intval($item_id));
mod/photos.php: Addon::callHooks('photo_post_end',intval($item_id));
mod/photos.php: call_hooks('photo_upload_form',$ret);
mod/photos.php: Addon::callHooks('photo_upload_form',$ret);
mod/friendica.php: call_hooks('about_hook', $o);
mod/friendica.php: Addon::callHooks('about_hook', $o);
mod/editpost.php: call_hooks('jot_tool', $jotplugins);
mod/editpost.php: Addon::callHooks('jot_tool', $jotplugins);
mod/editpost.php: call_hooks('jot_networks', $jotnets);
mod/editpost.php: Addon::callHooks('jot_networks', $jotnets);
mod/parse_url.php: call_hooks('parse_link', $arr);
mod/parse_url.php: Addon::callHooks('parse_link', $arr);
mod/home.php: call_hooks('home_init',$ret);
mod/home.php: Addon::callHooks('home_init',$ret);
mod/home.php: call_hooks("home_content",$o);
mod/home.php: Addon::callHooks("home_content",$o);
mod/contacts.php: call_hooks('contact_edit_post', $_POST);
mod/contacts.php: Addon::callHooks('contact_edit_post', $_POST);
mod/contacts.php: call_hooks('contact_edit', $arr);
mod/contacts.php: Addon::callHooks('contact_edit', $arr);
mod/settings.php: call_hooks('plugin_settings_post', $_POST);
mod/settings.php: Addon::callHooks('plugin_settings_post', $_POST);
mod/settings.php: call_hooks('connector_settings_post', $_POST);
mod/settings.php: Addon::callHooks('connector_settings_post', $_POST);
mod/settings.php: call_hooks('settings_post', $_POST);
mod/settings.php: Addon::callHooks('settings_post', $_POST);
mod/settings.php: call_hooks('plugin_settings', $settings_addons);
mod/settings.php: Addon::callHooks('plugin_settings', $settings_addons);
mod/settings.php: call_hooks('connector_settings', $settings_connectors);
mod/settings.php: Addon::callHooks('connector_settings', $settings_connectors);
mod/settings.php: call_hooks('settings_form',$o);
mod/settings.php: Addon::callHooks('settings_form',$o);
mod/register.php: call_hooks('register_account', $newuid);
mod/register.php: Addon::callHooks('register_account', $newuid);
mod/like.php: call_hooks('post_local_end', $arr);
mod/like.php: Addon::callHooks('post_local_end', $arr);
mod/xrd.php: call_hooks('personal_xrd', $arr);
mod/xrd.php: Addon::callHooks('personal_xrd', $arr);
mod/item.php: call_hooks('post_local_start', $_REQUEST);
mod/item.php: Addon::callHooks('post_local_start', $_REQUEST);
mod/item.php: call_hooks('post_local',$datarray);
mod/item.php: Addon::callHooks('post_local',$datarray);
mod/item.php: call_hooks('post_local_end', $datarray);
mod/item.php: Addon::callHooks('post_local_end', $datarray);
mod/profile.php: call_hooks('profile_advanced',$o);
mod/profile.php: Addon::callHooks('profile_advanced',$o);
mod/profiles.php: call_hooks('profile_post', $_POST);
mod/profiles.php: Addon::callHooks('profile_post', $_POST);
mod/profiles.php: call_hooks('profile_edit', $arr);
mod/profiles.php: Addon::callHooks('profile_edit', $arr);
mod/tagger.php: call_hooks('post_local_end', $arr);
mod/tagger.php: Addon::callHooks('post_local_end', $arr);
mod/cb.php: call_hooks('cb_init');
mod/cb.php: Addon::callHooks('cb_init');
mod/cb.php: call_hooks('cb_post', $_POST);
mod/cb.php: Addon::callHooks('cb_post', $_POST);
mod/cb.php: call_hooks('cb_afterpost');
mod/cb.php: Addon::callHooks('cb_afterpost');
mod/cb.php: call_hooks('cb_content', $o);
mod/cb.php: Addon::callHooks('cb_content', $o);
mod/directory.php: call_hooks('directory_item', $arr);
mod/directory.php: Addon::callHooks('directory_item', $arr);

+ 10
- 9
include/acl_selectors.php View File

@ -5,6 +5,7 @@
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Content\Widget;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
@ -32,7 +33,7 @@ function group_select($selname,$selclass,$preselected = false,$size = 4) {
// e.g. 'network_pre_group_deny', 'profile_pre_group_allow'
call_hooks($a->module . '_pre_' . $selname, $arr);
Addon::callHooks($a->module . '_pre_' . $selname, $arr);
if (DBM::is_result($r)) {
foreach ($r as $rr) {
@ -50,7 +51,7 @@ function group_select($selname,$selclass,$preselected = false,$size = 4) {
}
$o .= "</select>\r\n";
call_hooks($a->module . '_post_' . $selname, $o);
Addon::callHooks($a->module . '_post_' . $selname, $o);
return $o;
@ -111,7 +112,7 @@ function contact_selector($selname, $selclass, $options, $preselected = false)
$x = ['options' => $options, 'size' => $size, 'single' => $single, 'mutual' => $mutual, 'exclude' => $exclude, 'networks' => $networks];
call_hooks('contact_select_options', $x);
Addon::callHooks('contact_select_options', $x);
$o = '';
@ -154,7 +155,7 @@ function contact_selector($selname, $selclass, $options, $preselected = false)
// e.g. 'network_pre_contact_deny', 'profile_pre_contact_allow'
call_hooks($a->module . '_pre_' . $selname, $arr);
Addon::callHooks($a->module . '_pre_' . $selname, $arr);
if (DBM::is_result($r)) {
foreach ($r as $rr) {
@ -173,7 +174,7 @@ function contact_selector($selname, $selclass, $options, $preselected = false)
$o .= "</select>\r\n";
call_hooks($a->module . '_post_' . $selname, $o);
Addon::callHooks($a->module . '_post_' . $selname, $o);
return $o;
}
@ -232,7 +233,7 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
// e.g. 'network_pre_contact_deny', 'profile_pre_contact_allow'
call_hooks($a->module . '_pre_' . $selname, $arr);
Addon::callHooks($a->module . '_pre_' . $selname, $arr);
$receiverlist = [];
@ -263,7 +264,7 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
$o .= implode(", ", $receiverlist);
}
call_hooks($a->module . '_post_' . $selname, $o);
Addon::callHooks($a->module . '_post_' . $selname, $o);
return $o;
}
@ -353,7 +354,7 @@ function populate_acl($user = null, $show_jotnets = false) {
$jotnets .= '<div class="profile-jot-net"><input type="checkbox" name="pubmail_enable"' . $selected . ' value="1" /> ' . t("Post to Email") . '</div>';
}
call_hooks('jot_networks', $jotnets);
Addon::callHooks('jot_networks', $jotnets);
} else {
$jotnets .= sprintf(t('Connectors disabled, since "%s" is enabled.'),
t('Hide your profile details from unknown viewers?'));
@ -671,7 +672,7 @@ function acl_lookup(App $a, $out_type = 'json')
'search' => $search,
];
call_hooks('acl_lookup_end', $results);
Addon::callHooks('acl_lookup_end', $results);
if ($out_type === 'html') {
$o = [


+ 4
- 3
include/api.php View File

@ -8,6 +8,7 @@
use Friendica\App;
use Friendica\Content\ContactSelector;
use Friendica\Content\Feature;
use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Core\NotificationsManager;
@ -166,7 +167,7 @@ function api_login(App $a)
list($consumer, $token) = $oauth1->verify_request(OAuthRequest::from_request());
if (!is_null($token)) {
$oauth1->loginUser($token->uid);
call_hooks('logged_in', $a->user);
Addon::callHooks('logged_in', $a->user);
return;
}
echo __FILE__.__LINE__.__FUNCTION__ . "<pre>";
@ -216,7 +217,7 @@ function api_login(App $a)
* Plugins should never set 'authenticated' except to indicate success - as hooks may be chained
* and later plugins should not interfere with an earlier one that succeeded.
*/
call_hooks('authenticate', $addon_auth);
Addon::callHooks('authenticate', $addon_auth);
if ($addon_auth['authenticated'] && count($addon_auth['user_record'])) {
$record = $addon_auth['user_record'];
@ -239,7 +240,7 @@ function api_login(App $a)
$_SESSION["allow_api"] = true;
call_hooks('logged_in', $a->user);
Addon::callHooks('logged_in', $a->user);
}
/**


+ 2
- 1
include/bb2diaspora.php View File

@ -1,6 +1,7 @@
<?php
use Friendica\Content\Text\Markdown;
use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Model\Contact;
use Friendica\Network\Probe;
@ -218,7 +219,7 @@ function bb2diaspora($Text, $preserve_nl = false, $fordiaspora = true) {
}
, $Text);
call_hooks('bb2diaspora',$Text);
Addon::callHooks('bb2diaspora',$Text);
return $Text;
}


+ 2
- 1
include/bbcode.php View File

@ -3,6 +3,7 @@
use Friendica\App;
use Friendica\Content\Smilies;
use Friendica\Content\OEmbed;
use Friendica\Core\Addon;
use Friendica\Core\Cache;
use Friendica\Core\System;
use Friendica\Core\Config;
@ -1401,7 +1402,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
//$Text = str_replace('<br /><li>', '<li>', $Text);
//$Text = str_replace('<br /><ul', '<ul ', $Text);
call_hooks('bbcode', $Text);
Addon::callHooks('bbcode', $Text);
return trim($Text);
}


+ 7
- 6
include/conversation.php View File

@ -5,6 +5,7 @@
use Friendica\App;
use Friendica\Content\ContactSelector;
use Friendica\Content\Feature;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
@ -595,7 +596,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
}
$cb = ['items' => $items, 'mode' => $mode, 'update' => $update, 'preview' => $preview];
call_hooks('conversation_start',$cb);
Addon::callHooks('conversation_start',$cb);
$items = $cb['items'];
@ -731,7 +732,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
}
$locate = ['location' => $item['location'], 'coord' => $item['coord'], 'html' => ''];
call_hooks('render_location',$locate);
Addon::callHooks('render_location',$locate);
$location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate));
@ -820,7 +821,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
];
$arr = ['item' => $item, 'output' => $tmp_item];
call_hooks('display_item', $arr);
Addon::callHooks('display_item', $arr);
$threads[$threadsid]['id'] = $item['item_id'];
$threads[$threadsid]['network'] = $item['item_network'];
@ -864,7 +865,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
continue;
}
call_hooks('display_item', $arr);
Addon::callHooks('display_item', $arr);
$item['pagedrop'] = $page_dropping;
@ -1075,7 +1076,7 @@ function item_photo_menu($item) {
$args = ['item' => $item, 'menu' => $menu];
call_hooks('item_photo_menu', $args);
Addon::callHooks('item_photo_menu', $args);
$menu = $args['menu'];
@ -1297,7 +1298,7 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
]);
$jotplugins = '';
call_hooks('jot_tool', $jotplugins);
Addon::callHooks('jot_tool', $jotplugins);
// Private/public post links for the non-JS ACL form
$private_post = 1;


+ 5
- 4
include/enotify.php View File

@ -3,6 +3,7 @@
* @file include/enotify.php
*/
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Database\DBM;
@ -398,7 +399,7 @@ function notification($params)
'itemlink' => $itemlink
];
call_hooks('enotify', $h);
Addon::callHooks('enotify', $h);
$subject = $h['subject'];
@ -440,7 +441,7 @@ function notification($params)
$datarray['otype'] = $params['otype'];
$datarray['abort'] = false;
call_hooks('enotify_store', $datarray);
Addon::callHooks('enotify_store', $datarray);
if ($datarray['abort']) {
pop_lang();
@ -576,7 +577,7 @@ function notification($params)
$datarray['subject'] = $subject;
$datarray['headers'] = $additional_mail_header;
call_hooks('enotify_mail', $datarray);
Addon::callHooks('enotify_mail', $datarray);
// check whether sending post content in email notifications is allowed
// always true for SYSTEM_EMAIL
@ -667,7 +668,7 @@ function check_user_notification($itemid) {
*/
function check_item_notification($itemid, $uid, $defaulttype = "") {
$notification_data = ["uid" => $uid, "profiles" => []];
call_hooks('check_item_notification', $notification_data);
Addon::callHooks('check_item_notification', $notification_data);
$profiles = $notification_data["profiles"];


+ 3
- 2
include/event.php View File

@ -6,6 +6,7 @@
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Core\Addon;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
@ -328,7 +329,7 @@ function event_store($arr) {
$item_id = 0;
}
call_hooks("event_updated", $arr['id']);
Addon::callHooks("event_updated", $arr['id']);
return $item_id;
} else {
@ -406,7 +407,7 @@ function event_store($arr) {
);
}
call_hooks("event_created", $event['id']);
Addon::callHooks("event_created", $event['id']);
return $item_id;
}


+ 2
- 1
include/friendica_smarty.php View File

@ -1,5 +1,6 @@
<?php
use Friendica\Core\Addon;
use Friendica\Render\ITemplateEngine;
require_once "include/plugin.php";
@ -74,7 +75,7 @@ class FriendicaSmartyEngine implements ITemplateEngine
"template" => basename($s->filename),
"vars" => $r
];
call_hooks("template_vars", $arr);
Addon::callHooks("template_vars", $arr);
$r = $arr['vars'];
foreach ($r as $key => $value) {


+ 2
- 1
include/html2bbcode.php View File

@ -8,6 +8,7 @@
* https://github.com/annando/Syncom
*/
use Friendica\Core\Addon;
use Friendica\Util\XML;
function node2bbcode(&$doc, $oldnode, $attributes, $startbb, $endbb)
@ -261,7 +262,7 @@ function html2bbcode($message, $basepath = '')
$message = preg_replace('=\r *\r=i', "\n", $message);
$message = str_replace("\r", "\n", $message);
call_hooks('html2bbcode', $message);
Addon::callHooks('html2bbcode', $message);
$message = strip_tags($message);


+ 7
- 6
include/items.php View File

@ -4,6 +4,7 @@
*/
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\Worker;
@ -157,7 +158,7 @@ function title_is_body($title, $body) {
}
function add_page_info_data($data) {
call_hooks('page_info_data', $data);
Addon::callHooks('page_info_data', $data);
// It maybe is a rich content, but if it does have everything that a link has,
// then treat it that way
@ -943,9 +944,9 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
put_item_in_cache($arr);
if ($notify) {
call_hooks('post_local', $arr);
Addon::callHooks('post_local', $arr);
} else {
call_hooks('post_remote', $arr);
Addon::callHooks('post_remote', $arr);
}
// This array field is used to trigger some automatic reactions
@ -1086,9 +1087,9 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
$r = q('SELECT * FROM `item` WHERE `id` = %d', intval($current_post));
if ((DBM::is_result($r)) && (count($r) == 1)) {
if ($notify) {
call_hooks('post_local_end', $r[0]);
Addon::callHooks('post_local_end', $r[0]);
} else {
call_hooks('post_remote_end', $r[0]);
Addon::callHooks('post_remote_end', $r[0]);
}
} else {
logger('item_store: new item not found in DB, id ' . $current_post);
@ -1364,7 +1365,7 @@ function tag_deliver($uid, $item_id)
$arr = ['item' => $item, 'user' => $u[0], 'contact' => $r[0]];
call_hooks('tagged', $arr);
Addon::callHooks('tagged', $arr);
if ((! $community_page) && (! $prvgroup)) {
return;


+ 2
- 1
include/like.php View File

@ -1,6 +1,7 @@
<?php
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
@ -254,7 +255,7 @@ EOT;
$new_item['id'] = $new_item_id;
call_hooks('post_local_end', $new_item);
Addon::callHooks('post_local_end', $new_item);
Worker::add(PRIORITY_HIGH, "Notifier", "like", $new_item_id);


+ 2
- 1
include/network.php View File

@ -3,6 +3,7 @@
* @file include/network.php
*/
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Network\Probe;
@ -653,7 +654,7 @@ function avatar_img($email)
$avatar['url'] = '';
$avatar['success'] = false;
call_hooks('avatar_lookup', $avatar);
Addon::callHooks('avatar_lookup', $avatar);
if (! $avatar['success']) {
$avatar['url'] = System::baseUrl() . '/images/person-175.jpg';


+ 2
- 1
include/security.php View File

@ -1,6 +1,7 @@
<?php
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
@ -157,7 +158,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive
}
if ($login_initial) {
call_hooks('logged_in', $a->user);
Addon::callHooks('logged_in', $a->user);
if (($a->module !== 'home') && isset($_SESSION['return_url'])) {
goaway(System::baseUrl() . '/' . $_SESSION['return_url']);


+ 6
- 5
include/text.php View File

@ -6,6 +6,7 @@ use Friendica\App;
use Friendica\Content\ContactSelector;
use Friendica\Content\Feature;
use Friendica\Content\Smilies;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
@ -969,7 +970,7 @@ function contact_block() {
$arr = ['contacts' => $r, 'output' => $o];
call_hooks('contact_block_end', $arr);
Addon::callHooks('contact_block_end', $arr);
return $o;
}
@ -1123,7 +1124,7 @@ function get_poke_verbs() {
'finger' => ['fingered', t('finger'), t('fingered')],
'rebuff' => ['rebuffed', t('rebuff'), t('rebuffed')],
];
call_hooks('poke_verbs', $arr);
Addon::callHooks('poke_verbs', $arr);
return $arr;
}
@ -1255,7 +1256,7 @@ function put_item_in_cache(&$item, $update = false)
function prepare_body(&$item, $attach = false, $preview = false) {
$a = get_app();
call_hooks('prepare_body_init', $item);
Addon::callHooks('prepare_body_init', $item);
$searchpath = System::baseUrl() . "/search?tag=";
@ -1314,7 +1315,7 @@ function prepare_body(&$item, $attach = false, $preview = false) {
$s = $item["rendered-html"];
$prep_arr = ['item' => $item, 'html' => $s, 'preview' => $preview];
call_hooks('prepare_body', $prep_arr);
Addon::callHooks('prepare_body', $prep_arr);
$s = $prep_arr['html'];
if (! $attach) {
@ -1432,7 +1433,7 @@ function prepare_body(&$item, $attach = false, $preview = false) {
}
$prep_arr = ['item' => $item, 'html' => $s];
call_hooks('prepare_body_final', $prep_arr);
Addon::callHooks('prepare_body_final', $prep_arr);
return $prep_arr['html'];
}


+ 13
- 12
index.php View File

@ -11,6 +11,7 @@
use Friendica\App;
use Friendica\BaseObject;
use Friendica\Content\Nav;
use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Core\Worker;
@ -75,8 +76,8 @@ if (!$install) {
}
require_once 'include/session.php';
load_hooks();
call_hooks('init_1');
Addon::loadHooks();
Addon::callHooks('init_1');
$maintenance = Config::get('system', 'maintenance');
}
@ -200,7 +201,7 @@ $privateapps = Config::get('config', 'private_addons');
if ((local_user()) || (! $privateapps === "1")) {
$arr = ['app_menu' => $a->apps];
call_hooks('app_menu', $arr);
Addon::callHooks('app_menu', $arr);
$a->apps = $arr['app_menu'];
}
@ -243,7 +244,7 @@ if (strlen($a->module)) {
if (is_array($a->plugins) && in_array($a->module, $a->plugins) && file_exists("addon/{$a->module}/{$a->module}.php")) {
//Check if module is an app and if public access to apps is allowed or not
if ((!local_user()) && plugin_is_app($a->module) && $privateapps === "1") {
if ((!local_user()) && Addon::isApp($a->module) && $privateapps === "1") {
info(t("You must be logged in to use addons. "));
} else {
include_once "addon/{$a->module}/{$a->module}.php";
@ -317,7 +318,7 @@ if (! x($a->page, 'content')) {
}
if (!$install && !$maintenance) {
call_hooks('page_content_top', $a->page['content']);
Addon::callHooks('page_content_top', $a->page['content']);
}
/**
@ -329,10 +330,10 @@ if ($a->module_loaded) {
$placeholder = '';
if ($a->module_class) {
call_hooks($a->module . '_mod_init', $placeholder);
Addon::callHooks($a->module . '_mod_init', $placeholder);
call_user_func([$a->module_class, 'init']);
} else if (function_exists($a->module . '_init')) {
call_hooks($a->module . '_mod_init', $placeholder);
Addon::callHooks($a->module . '_mod_init', $placeholder);
$func = $a->module . '_init';
$func($a);
}
@ -343,7 +344,7 @@ if ($a->module_loaded) {
}
if (! $a->error && $_SERVER['REQUEST_METHOD'] === 'POST') {
call_hooks($a->module . '_mod_post', $_POST);
Addon::callHooks($a->module . '_mod_post', $_POST);
if ($a->module_class) {
call_user_func([$a->module_class, 'post']);
} else if (function_exists($a->module . '_post')) {
@ -353,7 +354,7 @@ if ($a->module_loaded) {
}
if (! $a->error) {
call_hooks($a->module . '_mod_afterpost', $placeholder);
Addon::callHooks($a->module . '_mod_afterpost', $placeholder);
if ($a->module_class) {
call_user_func([$a->module_class, 'afterpost']);
} else if (function_exists($a->module . '_afterpost')) {
@ -364,7 +365,7 @@ if ($a->module_loaded) {
if (! $a->error) {
$arr = ['content' => $a->page['content']];
call_hooks($a->module . '_mod_content', $arr);
Addon::callHooks($a->module . '_mod_content', $arr);
$a->page['content'] = $arr['content'];
if ($a->module_class) {
$arr = ['content' => call_user_func([$a->module_class, 'content'])];
@ -372,7 +373,7 @@ if ($a->module_loaded) {
$func = $a->module . '_content';
$arr = ['content' => $func($a)];
}
call_hooks($a->module . '_mod_aftercontent', $arr);
Addon::callHooks($a->module . '_mod_aftercontent', $arr);
$a->page['content'] .= $arr['content'];
}
@ -421,7 +422,7 @@ if (stristr(implode("", $_SESSION['sysmsg']), t('Permission denied'))) {
/*
* Report anything which needs to be communicated in the notification area (before the main body)
*/
call_hooks('page_end', $a->page['content']);
Addon::callHooks('page_end', $a->page['content']);
/*
* Add the navigation (menu) template


+ 6
- 5
mod/admin.php View File

@ -8,6 +8,7 @@
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Content\Text\Markdown;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Core\Worker;
@ -1757,11 +1758,11 @@ function admin_page_plugins(App $a)
$idx = array_search($plugin, $a->plugins);
if ($idx !== false) {
unset($a->plugins[$idx]);
uninstall_plugin($plugin);
Addon::uninstall($plugin);
info(t("Plugin %s disabled.", $plugin));
} else {
$a->plugins[] = $plugin;
install_plugin($plugin);
Addon::install($plugin);
info(t("Plugin %s enabled.", $plugin));
}
Config::set("system", "addon", implode(", ", $a->plugins));
@ -1804,7 +1805,7 @@ function admin_page_plugins(App $a)
'$plugin' => $plugin,
'$status' => $status,
'$action' => $action,
'$info' => get_plugin_info($plugin),
'$info' => Addon::getInfo($plugin),
'$str_author' => t('Author: '),
'$str_maintainer' => t('Maintainer: '),
@ -1822,7 +1823,7 @@ function admin_page_plugins(App $a)
*/
if (x($_GET, "a") && $_GET['a'] == "r") {
check_form_security_token_redirectOnErr(System::baseUrl() . '/admin/plugins', 'admin_themes', 't');
reload_plugins();
Addon::reload();
info("Plugins reloaded");
goaway(System::baseUrl() . '/admin/plugins');
}
@ -1833,7 +1834,7 @@ function admin_page_plugins(App $a)
foreach ($files as $file) {
if (is_dir($file)) {
list($tmp, $id) = array_map("trim", explode("/", $file));
$info = get_plugin_info($id);
$info = Addon::getInfo($id);
$show_plugin = true;
// If the addon is unsupported, then only show it, when it is enabled


+ 3
- 2
mod/contacts.php View File

@ -6,6 +6,7 @@ use Friendica\App;
use Friendica\Content\ContactSelector;
use Friendica\Content\Nav;
use Friendica\Content\Widget;
use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
@ -173,7 +174,7 @@ function contacts_post(App $a)
return; // NOTREACHED
}
call_hooks('contact_edit_post', $_POST);
Addon::callHooks('contact_edit_post', $_POST);
$profile_id = intval($_POST['profile-assign']);
if ($profile_id) {
@ -662,7 +663,7 @@ function contacts_content(App $a)
$arr = ['contact' => $contact, 'output' => $o];
call_hooks('contact_edit', $arr);
Addon::callHooks('contact_edit', $arr);
return $arr['output'];
}


+ 2
- 1
mod/directory.php View File

@ -5,6 +5,7 @@
use Friendica\App;
use Friendica\Content\Nav;
use Friendica\Content\Widget;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
@ -174,7 +175,7 @@ function directory_content(App $a) {
$arr = ['contact' => $rr, 'entry' => $entry];
call_hooks('directory_item', $arr);
Addon::callHooks('directory_item', $arr);
unset($profile);
unset($location);


+ 3
- 2
mod/editpost.php View File

@ -4,6 +4,7 @@
*/
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Database\DBM;
@ -94,8 +95,8 @@ function editpost_content(App $a) {
call_hooks('jot_tool', $jotplugins);
//call_hooks('jot_networks', $jotnets);
Addon::callHooks('jot_tool', $jotplugins);
//Addon::callHooks('jot_networks', $jotnets);
//$tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));


+ 2
- 1
mod/friendica.php View File

@ -1,6 +1,7 @@
<?php
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Database\DBM;
@ -121,7 +122,7 @@ function friendica_content(App $a) {
$o .= '</tbody></table></div>' . PHP_EOL;
}
call_hooks('about_hook', $o);
Addon::callHooks('about_hook', $o);
return $o;
}

+ 3
- 2
mod/home.php View File

@ -1,6 +1,7 @@
<?php
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Module\Login;
@ -9,7 +10,7 @@ if(! function_exists('home_init')) {
function home_init(App $a) {
$ret = [];
call_hooks('home_init',$ret);
Addon::callHooks('home_init',$ret);
if (local_user() && ($a->user['nickname'])) {
goaway(System::baseUrl()."/network");
@ -46,7 +47,7 @@ function home_content(App $a) {
$login = Login::form($a->query_string, $a->config['register_policy'] == REGISTER_CLOSED ? 0 : 1);
$content = '';
call_hooks("home_content",$content);
Addon::callHooks("home_content",$content);
$tpl = get_markup_template('home.tpl');


+ 4
- 3
mod/item.php View File

@ -15,6 +15,7 @@
* information.
*/
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Core\Worker;
@ -50,7 +51,7 @@ function item_post(App $a) {
killme();
}
call_hooks('post_local_start', $_REQUEST);
Addon::callHooks('post_local_start', $_REQUEST);
// logger('postinput ' . file_get_contents('php://input'));
logger('postvars ' . print_r($_REQUEST,true), LOGGER_DATA);
@ -772,7 +773,7 @@ function item_post(App $a) {
killme();
}