Replace deprecated Addon::callHooks with Hook::callAll

- Update documentation
This commit is contained in:
Hypolite Petovan 2018-12-26 01:06:24 -05:00
parent 895b3abf32
commit 55e54bb950
58 changed files with 450 additions and 475 deletions

View File

@ -417,281 +417,281 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep-
### index.php ### index.php
Addon::callHooks('init_1'); Hook::callAll('init_1');
Addon::callHooks('app_menu', $arr); Hook::callAll('app_menu', $arr);
Addon::callHooks('page_content_top', $a->page['content']); Hook::callAll('page_content_top', $a->page['content']);
Addon::callHooks($a->module.'_mod_init', $placeholder); Hook::callAll($a->module.'_mod_init', $placeholder);
Addon::callHooks($a->module.'_mod_init', $placeholder); Hook::callAll($a->module.'_mod_init', $placeholder);
Addon::callHooks($a->module.'_mod_post', $_POST); Hook::callAll($a->module.'_mod_post', $_POST);
Addon::callHooks($a->module.'_mod_afterpost', $placeholder); Hook::callAll($a->module.'_mod_afterpost', $placeholder);
Addon::callHooks($a->module.'_mod_content', $arr); Hook::callAll($a->module.'_mod_content', $arr);
Addon::callHooks($a->module.'_mod_aftercontent', $arr); Hook::callAll($a->module.'_mod_aftercontent', $arr);
Addon::callHooks('page_end', $a->page['content']); Hook::callAll('page_end', $a->page['content']);
### include/api.php ### include/api.php
Addon::callHooks('logged_in', $a->user); Hook::callAll('logged_in', $a->user);
Addon::callHooks('authenticate', $addon_auth); Hook::callAll('authenticate', $addon_auth);
Addon::callHooks('logged_in', $a->user); Hook::callAll('logged_in', $a->user);
### include/enotify.php ### include/enotify.php
Addon::callHooks('enotify', $h); Hook::callAll('enotify', $h);
Addon::callHooks('enotify_store', $datarray); Hook::callAll('enotify_store', $datarray);
Addon::callHooks('enotify_mail', $datarray); Hook::callAll('enotify_mail', $datarray);
Addon::callHooks('check_item_notification', $notification_data); Hook::callAll('check_item_notification', $notification_data);
### include/conversation.php ### include/conversation.php
Addon::callHooks('conversation_start', $cb); Hook::callAll('conversation_start', $cb);
Addon::callHooks('render_location', $locate); Hook::callAll('render_location', $locate);
Addon::callHooks('display_item', $arr); Hook::callAll('display_item', $arr);
Addon::callHooks('display_item', $arr); Hook::callAll('display_item', $arr);
Addon::callHooks('item_photo_menu', $args); Hook::callAll('item_photo_menu', $args);
Addon::callHooks('jot_tool', $jotplugins); Hook::callAll('jot_tool', $jotplugins);
### include/text.php ### include/text.php
Addon::callHooks('contact_block_end', $arr); Hook::callAll('contact_block_end', $arr);
Addon::callHooks('poke_verbs', $arr); Hook::callAll('poke_verbs', $arr);
Addon::callHooks('put_item_in_cache', $hook_data); Hook::callAll('put_item_in_cache', $hook_data);
Addon::callHooks('prepare_body_init', $item); Hook::callAll('prepare_body_init', $item);
Addon::callHooks('prepare_body_content_filter', $hook_data); Hook::callAll('prepare_body_content_filter', $hook_data);
Addon::callHooks('prepare_body', $hook_data); Hook::callAll('prepare_body', $hook_data);
Addon::callHooks('prepare_body_final', $hook_data); Hook::callAll('prepare_body_final', $hook_data);
### include/items.php ### include/items.php
Addon::callHooks('page_info_data', $data); Hook::callAll('page_info_data', $data);
### mod/directory.php ### mod/directory.php
Addon::callHooks('directory_item', $arr); Hook::callAll('directory_item', $arr);
### mod/xrd.php ### mod/xrd.php
Addon::callHooks('personal_xrd', $arr); Hook::callAll('personal_xrd', $arr);
### mod/ping.php ### mod/ping.php
Addon::callHooks('network_ping', $arr); Hook::callAll('network_ping', $arr);
### mod/parse_url.php ### mod/parse_url.php
Addon::callHooks("parse_link", $arr); Hook::callAll("parse_link", $arr);
### mod/manage.php ### mod/manage.php
Addon::callHooks('home_init', $ret); Hook::callAll('home_init', $ret);
### mod/acl.php ### mod/acl.php
Addon::callHooks('acl_lookup_end', $results); Hook::callAll('acl_lookup_end', $results);
### mod/network.php ### mod/network.php
Addon::callHooks('network_content_init', $arr); Hook::callAll('network_content_init', $arr);
Addon::callHooks('network_tabs', $arr); Hook::callAll('network_tabs', $arr);
### mod/friendica.php ### mod/friendica.php
Addon::callHooks('about_hook', $o); Hook::callAll('about_hook', $o);
### mod/subthread.php ### mod/subthread.php
Addon::callHooks('post_local_end', $arr); Hook::callAll('post_local_end', $arr);
### mod/profiles.php ### mod/profiles.php
Addon::callHooks('profile_post', $_POST); Hook::callAll('profile_post', $_POST);
Addon::callHooks('profile_edit', $arr); Hook::callAll('profile_edit', $arr);
### mod/settings.php ### mod/settings.php
Addon::callHooks('addon_settings_post', $_POST); Hook::callAll('addon_settings_post', $_POST);
Addon::callHooks('connector_settings_post', $_POST); Hook::callAll('connector_settings_post', $_POST);
Addon::callHooks('display_settings_post', $_POST); Hook::callAll('display_settings_post', $_POST);
Addon::callHooks('settings_post', $_POST); Hook::callAll('settings_post', $_POST);
Addon::callHooks('addon_settings', $settings_addons); Hook::callAll('addon_settings', $settings_addons);
Addon::callHooks('connector_settings', $settings_connectors); Hook::callAll('connector_settings', $settings_connectors);
Addon::callHooks('display_settings', $o); Hook::callAll('display_settings', $o);
Addon::callHooks('settings_form', $o); Hook::callAll('settings_form', $o);
### mod/photos.php ### mod/photos.php
Addon::callHooks('photo_post_init', $_POST); Hook::callAll('photo_post_init', $_POST);
Addon::callHooks('photo_post_file', $ret); Hook::callAll('photo_post_file', $ret);
Addon::callHooks('photo_post_end', $foo); Hook::callAll('photo_post_end', $foo);
Addon::callHooks('photo_post_end', $foo); Hook::callAll('photo_post_end', $foo);
Addon::callHooks('photo_post_end', $foo); Hook::callAll('photo_post_end', $foo);
Addon::callHooks('photo_post_end', $foo); Hook::callAll('photo_post_end', $foo);
Addon::callHooks('photo_post_end', intval($item_id)); Hook::callAll('photo_post_end', intval($item_id));
Addon::callHooks('photo_upload_form', $ret); Hook::callAll('photo_upload_form', $ret);
### mod/profile.php ### mod/profile.php
Addon::callHooks('profile_advanced', $o); Hook::callAll('profile_advanced', $o);
### mod/home.php ### mod/home.php
Addon::callHooks('home_init', $ret); Hook::callAll('home_init', $ret);
Addon::callHooks("home_content", $content); Hook::callAll("home_content", $content);
### mod/poke.php ### mod/poke.php
Addon::callHooks('post_local_end', $arr); Hook::callAll('post_local_end', $arr);
### mod/contacts.php ### mod/contacts.php
Addon::callHooks('contact_edit_post', $_POST); Hook::callAll('contact_edit_post', $_POST);
Addon::callHooks('contact_edit', $arr); Hook::callAll('contact_edit', $arr);
### mod/tagger.php ### mod/tagger.php
Addon::callHooks('post_local_end', $arr); Hook::callAll('post_local_end', $arr);
### mod/lockview.php ### mod/lockview.php
Addon::callHooks('lockview_content', $item); Hook::callAll('lockview_content', $item);
### mod/uexport.php ### mod/uexport.php
Addon::callHooks('uexport_options', $options); Hook::callAll('uexport_options', $options);
### mod/register.php ### mod/register.php
Addon::callHooks('register_post', $arr); Hook::callAll('register_post', $arr);
Addon::callHooks('register_form', $arr); Hook::callAll('register_form', $arr);
### mod/item.php ### mod/item.php
Addon::callHooks('post_local_start', $_REQUEST); Hook::callAll('post_local_start', $_REQUEST);
Addon::callHooks('post_local', $datarray); Hook::callAll('post_local', $datarray);
Addon::callHooks('post_local_end', $datarray); Hook::callAll('post_local_end', $datarray);
### mod/editpost.php ### mod/editpost.php
Addon::callHooks('jot_tool', $jotplugins); Hook::callAll('jot_tool', $jotplugins);
### src/Network/FKOAuth1.php ### src/Network/FKOAuth1.php
Addon::callHooks('logged_in', $a->user); Hook::callAll('logged_in', $a->user);
### src/Render/FriendicaSmartyEngine.php ### src/Render/FriendicaSmartyEngine.php
Addon::callHooks("template_vars", $arr); Hook::callAll("template_vars", $arr);
### src/App.php ### src/App.php
Addon::callHooks('load_config'); Hook::callAll('load_config');
Addon::callHooks('head'); Hook::callAll('head');
Addon::callHooks('footer'); Hook::callAll('footer');
### src/Model/Item.php ### src/Model/Item.php
Addon::callHooks('post_local', $item); Hook::callAll('post_local', $item);
Addon::callHooks('post_remote', $item); Hook::callAll('post_remote', $item);
Addon::callHooks('post_local_end', $posted_item); Hook::callAll('post_local_end', $posted_item);
Addon::callHooks('post_remote_end', $posted_item); Hook::callAll('post_remote_end', $posted_item);
Addon::callHooks('tagged', $arr); Hook::callAll('tagged', $arr);
Addon::callHooks('post_local_end', $new_item); Hook::callAll('post_local_end', $new_item);
### src/Model/Contact.php ### src/Model/Contact.php
Addon::callHooks('contact_photo_menu', $args); Hook::callAll('contact_photo_menu', $args);
Addon::callHooks('follow', $arr); Hook::callAll('follow', $arr);
### src/Model/Profile.php ### src/Model/Profile.php
Addon::callHooks('profile_sidebar_enter', $profile); Hook::callAll('profile_sidebar_enter', $profile);
Addon::callHooks('profile_sidebar', $arr); Hook::callAll('profile_sidebar', $arr);
Addon::callHooks('profile_tabs', $arr); Hook::callAll('profile_tabs', $arr);
Addon::callHooks('zrl_init', $arr); Hook::callAll('zrl_init', $arr);
Addon::callHooks('magic_auth_success', $arr); Hook::callAll('magic_auth_success', $arr);
### src/Model/Event.php ### src/Model/Event.php
Addon::callHooks('event_updated', $event['id']); Hook::callAll('event_updated', $event['id']);
Addon::callHooks("event_created", $event['id']); Hook::callAll("event_created", $event['id']);
### src/Model/User.php ### src/Model/User.php
Addon::callHooks('register_account', $uid); Hook::callAll('register_account', $uid);
Addon::callHooks('remove_user', $user); Hook::callAll('remove_user', $user);
### src/Content/Text/BBCode.php ### src/Content/Text/BBCode.php
Addon::callHooks('bbcode', $text); Hook::callAll('bbcode', $text);
Addon::callHooks('bb2diaspora', $text); Hook::callAll('bb2diaspora', $text);
### src/Content/Text/HTML.php ### src/Content/Text/HTML.php
Addon::callHooks('html2bbcode', $message); Hook::callAll('html2bbcode', $message);
### src/Content/Smilies.php ### src/Content/Smilies.php
Addon::callHooks('smilie', $params); Hook::callAll('smilie', $params);
### src/Content/Feature.php ### src/Content/Feature.php
Addon::callHooks('isEnabled', $arr); Hook::callAll('isEnabled', $arr);
Addon::callHooks('get', $arr); Hook::callAll('get', $arr);
### src/Content/ContactSelector.php ### src/Content/ContactSelector.php
Addon::callHooks('network_to_name', $nets); Hook::callAll('network_to_name', $nets);
Addon::callHooks('gender_selector', $select); Hook::callAll('gender_selector', $select);
Addon::callHooks('sexpref_selector', $select); Hook::callAll('sexpref_selector', $select);
Addon::callHooks('marital_selector', $select); Hook::callAll('marital_selector', $select);
### src/Content/OEmbed.php ### src/Content/OEmbed.php
Addon::callHooks('oembed_fetch_url', $embedurl, $j); Hook::callAll('oembed_fetch_url', $embedurl, $j);
### src/Content/Nav.php ### src/Content/Nav.php
Addon::callHooks('page_header', $a->page['nav']); Hook::callAll('page_header', $a->page['nav']);
Addon::callHooks('nav_info', $nav); Hook::callAll('nav_info', $nav);
### src/Worker/Directory.php ### src/Worker/Directory.php
Addon::callHooks('globaldir_update', $arr); Hook::callAll('globaldir_update', $arr);
### src/Worker/Notifier.php ### src/Worker/Notifier.php
Addon::callHooks('notifier_end', $target_item); Hook::callAll('notifier_end', $target_item);
### src/Worker/Queue.php ### src/Worker/Queue.php
Addon::callHooks('queue_predeliver', $r); Hook::callAll('queue_predeliver', $r);
Addon::callHooks('queue_deliver', $params); Hook::callAll('queue_deliver', $params);
### src/Module/Login.php ### src/Module/Login.php
Addon::callHooks('authenticate', $addon_auth); Hook::callAll('authenticate', $addon_auth);
Addon::callHooks('login_hook', $o); Hook::callAll('login_hook', $o);
### src/Module/Logout.php ### src/Module/Logout.php
Addon::callHooks("logging_out"); Hook::callAll("logging_out");
### src/Object/Post.php ### src/Object/Post.php
Addon::callHooks('render_location', $locate); Hook::callAll('render_location', $locate);
Addon::callHooks('display_item', $arr); Hook::callAll('display_item', $arr);
### src/Core/ACL.php ### src/Core/ACL.php
Addon::callHooks('contact_select_options', $x); Hook::callAll('contact_select_options', $x);
Addon::callHooks($a->module.'_pre_'.$selname, $arr); Hook::callAll($a->module.'_pre_'.$selname, $arr);
Addon::callHooks($a->module.'_post_'.$selname, $o); Hook::callAll($a->module.'_post_'.$selname, $o);
Addon::callHooks($a->module.'_pre_'.$selname, $arr); Hook::callAll($a->module.'_pre_'.$selname, $arr);
Addon::callHooks($a->module.'_post_'.$selname, $o); Hook::callAll($a->module.'_post_'.$selname, $o);
Addon::callHooks('jot_networks', $jotnets); Hook::callAll('jot_networks', $jotnets);
### src/Core/Authentication.php ### src/Core/Authentication.php
Addon::callHooks('logged_in', $a->user); Hook::callAll('logged_in', $a->user);
### src/Core/Hook.php ### src/Core/Hook.php
@ -699,31 +699,31 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep-
### src/Core/Worker.php ### src/Core/Worker.php
Addon::callHooks("proc_run", $arr); Hook::callAll("proc_run", $arr);
### src/Util/Emailer.php ### src/Util/Emailer.php
Addon::callHooks('emailer_send_prepare', $params); Hook::callAll('emailer_send_prepare', $params);
Addon::callHooks("emailer_send", $hookdata); Hook::callAll("emailer_send", $hookdata);
### src/Util/Map.php ### src/Util/Map.php
Addon::callHooks('generate_map', $arr); Hook::callAll('generate_map', $arr);
Addon::callHooks('generate_named_map', $arr); Hook::callAll('generate_named_map', $arr);
Addon::callHooks('Map::getCoordinates', $arr); Hook::callAll('Map::getCoordinates', $arr);
### src/Util/Network.php ### src/Util/Network.php
Addon::callHooks('avatar_lookup', $avatar); Hook::callAll('avatar_lookup', $avatar);
### src/Util/ParseUrl.php ### src/Util/ParseUrl.php
Addon::callHooks("getsiteinfo", $siteinfo); Hook::callAll("getsiteinfo", $siteinfo);
### src/Protocol/DFRN.php ### src/Protocol/DFRN.php
Addon::callHooks('atom_feed_end', $atom); Hook::callAll('atom_feed_end', $atom);
Addon::callHooks('atom_feed_end', $atom); Hook::callAll('atom_feed_end', $atom);
### view/js/main.js ### view/js/main.js

View File

@ -193,299 +193,299 @@ Eine komplette Liste aller Hook-Callbacks mit den zugehörigen Dateien (am 01-Ap
### index.php ### index.php
Addon::callHooks('init_1'); Hook::callAll('init_1');
Addon::callHooks('app_menu', $arr); Hook::callAll('app_menu', $arr);
Addon::callHooks('page_content_top', $a->page['content']); Hook::callAll('page_content_top', $a->page['content']);
Addon::callHooks($a->module.'_mod_init', $placeholder); Hook::callAll($a->module.'_mod_init', $placeholder);
Addon::callHooks($a->module.'_mod_init', $placeholder); Hook::callAll($a->module.'_mod_init', $placeholder);
Addon::callHooks($a->module.'_mod_post', $_POST); Hook::callAll($a->module.'_mod_post', $_POST);
Addon::callHooks($a->module.'_mod_afterpost', $placeholder); Hook::callAll($a->module.'_mod_afterpost', $placeholder);
Addon::callHooks($a->module.'_mod_content', $arr); Hook::callAll($a->module.'_mod_content', $arr);
Addon::callHooks($a->module.'_mod_aftercontent', $arr); Hook::callAll($a->module.'_mod_aftercontent', $arr);
Addon::callHooks('page_end', $a->page['content']); Hook::callAll('page_end', $a->page['content']);
### include/api.php ### include/api.php
Addon::callHooks('logged_in', $a->user); Hook::callAll('logged_in', $a->user);
Addon::callHooks('authenticate', $addon_auth); Hook::callAll('authenticate', $addon_auth);
Addon::callHooks('logged_in', $a->user); Hook::callAll('logged_in', $a->user);
### include/enotify.php ### include/enotify.php
Addon::callHooks('enotify', $h); Hook::callAll('enotify', $h);
Addon::callHooks('enotify_store', $datarray); Hook::callAll('enotify_store', $datarray);
Addon::callHooks('enotify_mail', $datarray); Hook::callAll('enotify_mail', $datarray);
Addon::callHooks('check_item_notification', $notification_data); Hook::callAll('check_item_notification', $notification_data);
### include/conversation.php ### include/conversation.php
Addon::callHooks('conversation_start', $cb); Hook::callAll('conversation_start', $cb);
Addon::callHooks('render_location', $locate); Hook::callAll('render_location', $locate);
Addon::callHooks('display_item', $arr); Hook::callAll('display_item', $arr);
Addon::callHooks('display_item', $arr); Hook::callAll('display_item', $arr);
Addon::callHooks('item_photo_menu', $args); Hook::callAll('item_photo_menu', $args);
Addon::callHooks('jot_tool', $jotplugins); Hook::callAll('jot_tool', $jotplugins);
### include/text.php ### include/text.php
Addon::callHooks('contact_block_end', $arr); Hook::callAll('contact_block_end', $arr);
Addon::callHooks('poke_verbs', $arr); Hook::callAll('poke_verbs', $arr);
Addon::callHooks('put_item_in_cache', $hook_data); Hook::callAll('put_item_in_cache', $hook_data);
Addon::callHooks('prepare_body_init', $item); Hook::callAll('prepare_body_init', $item);
Addon::callHooks('prepare_body_content_filter', $hook_data); Hook::callAll('prepare_body_content_filter', $hook_data);
Addon::callHooks('prepare_body', $hook_data); Hook::callAll('prepare_body', $hook_data);
Addon::callHooks('prepare_body_final', $hook_data); Hook::callAll('prepare_body_final', $hook_data);
### include/items.php ### include/items.php
Addon::callHooks('page_info_data', $data); Hook::callAll('page_info_data', $data);
### mod/directory.php ### mod/directory.php
Addon::callHooks('directory_item', $arr); Hook::callAll('directory_item', $arr);
### mod/xrd.php ### mod/xrd.php
Addon::callHooks('personal_xrd', $arr); Hook::callAll('personal_xrd', $arr);
### mod/ping.php ### mod/ping.php
Addon::callHooks('network_ping', $arr); Hook::callAll('network_ping', $arr);
### mod/parse_url.php ### mod/parse_url.php
Addon::callHooks("parse_link", $arr); Hook::callAll("parse_link", $arr);
### mod/manage.php ### mod/manage.php
Addon::callHooks('home_init', $ret); Hook::callAll('home_init', $ret);
### mod/acl.php ### mod/acl.php
Addon::callHooks('acl_lookup_end', $results); Hook::callAll('acl_lookup_end', $results);
### mod/network.php ### mod/network.php
Addon::callHooks('network_content_init', $arr); Hook::callAll('network_content_init', $arr);
Addon::callHooks('network_tabs', $arr); Hook::callAll('network_tabs', $arr);
### mod/friendica.php ### mod/friendica.php
Addon::callHooks('about_hook', $o); Hook::callAll('about_hook', $o);
### mod/subthread.php ### mod/subthread.php
Addon::callHooks('post_local_end', $arr); Hook::callAll('post_local_end', $arr);
### mod/profiles.php ### mod/profiles.php
Addon::callHooks('profile_post', $_POST); Hook::callAll('profile_post', $_POST);
Addon::callHooks('profile_edit', $arr); Hook::callAll('profile_edit', $arr);
### mod/settings.php ### mod/settings.php
Addon::callHooks('addon_settings_post', $_POST); Hook::callAll('addon_settings_post', $_POST);
Addon::callHooks('connector_settings_post', $_POST); Hook::callAll('connector_settings_post', $_POST);
Addon::callHooks('display_settings_post', $_POST); Hook::callAll('display_settings_post', $_POST);
Addon::callHooks('settings_post', $_POST); Hook::callAll('settings_post', $_POST);
Addon::callHooks('addon_settings', $settings_addons); Hook::callAll('addon_settings', $settings_addons);
Addon::callHooks('connector_settings', $settings_connectors); Hook::callAll('connector_settings', $settings_connectors);
Addon::callHooks('display_settings', $o); Hook::callAll('display_settings', $o);
Addon::callHooks('settings_form', $o); Hook::callAll('settings_form', $o);
### mod/photos.php ### mod/photos.php
Addon::callHooks('photo_post_init', $_POST); Hook::callAll('photo_post_init', $_POST);
Addon::callHooks('photo_post_file', $ret); Hook::callAll('photo_post_file', $ret);
Addon::callHooks('photo_post_end', $foo); Hook::callAll('photo_post_end', $foo);
Addon::callHooks('photo_post_end', $foo); Hook::callAll('photo_post_end', $foo);
Addon::callHooks('photo_post_end', $foo); Hook::callAll('photo_post_end', $foo);
Addon::callHooks('photo_post_end', $foo); Hook::callAll('photo_post_end', $foo);
Addon::callHooks('photo_post_end', intval($item_id)); Hook::callAll('photo_post_end', intval($item_id));
Addon::callHooks('photo_upload_form', $ret); Hook::callAll('photo_upload_form', $ret);
### mod/profile.php ### mod/profile.php
Addon::callHooks('profile_advanced', $o); Hook::callAll('profile_advanced', $o);
### mod/home.php ### mod/home.php
Addon::callHooks('home_init', $ret); Hook::callAll('home_init', $ret);
Addon::callHooks("home_content", $content); Hook::callAll("home_content", $content);
### mod/poke.php ### mod/poke.php
Addon::callHooks('post_local_end', $arr); Hook::callAll('post_local_end', $arr);
### mod/contacts.php ### mod/contacts.php
Addon::callHooks('contact_edit_post', $_POST); Hook::callAll('contact_edit_post', $_POST);
Addon::callHooks('contact_edit', $arr); Hook::callAll('contact_edit', $arr);
### mod/tagger.php ### mod/tagger.php
Addon::callHooks('post_local_end', $arr); Hook::callAll('post_local_end', $arr);
### mod/lockview.php ### mod/lockview.php
Addon::callHooks('lockview_content', $item); Hook::callAll('lockview_content', $item);
### mod/uexport.php ### mod/uexport.php
Addon::callHooks('uexport_options', $options); Hook::callAll('uexport_options', $options);
### mod/register.php ### mod/register.php
Addon::callHooks('register_post', $arr); Hook::callAll('register_post', $arr);
Addon::callHooks('register_form', $arr); Hook::callAll('register_form', $arr);
### mod/item.php ### mod/item.php
Addon::callHooks('post_local_start', $_REQUEST); Hook::callAll('post_local_start', $_REQUEST);
Addon::callHooks('post_local', $datarray); Hook::callAll('post_local', $datarray);
Addon::callHooks('post_local_end', $datarray); Hook::callAll('post_local_end', $datarray);
### mod/editpost.php ### mod/editpost.php
Addon::callHooks('jot_tool', $jotplugins); Hook::callAll('jot_tool', $jotplugins);
### src/Network/FKOAuth1.php ### src/Network/FKOAuth1.php
Addon::callHooks('logged_in', $a->user); Hook::callAll('logged_in', $a->user);
### src/Render/FriendicaSmartyEngine.php ### src/Render/FriendicaSmartyEngine.php
Addon::callHooks("template_vars", $arr); Hook::callAll("template_vars", $arr);
### src/Model/Item.php ### src/Model/Item.php
Addon::callHooks('post_local', $item); Hook::callAll('post_local', $item);
Addon::callHooks('post_remote', $item); Hook::callAll('post_remote', $item);
Addon::callHooks('post_local_end', $posted_item); Hook::callAll('post_local_end', $posted_item);
Addon::callHooks('post_remote_end', $posted_item); Hook::callAll('post_remote_end', $posted_item);
Addon::callHooks('tagged', $arr); Hook::callAll('tagged', $arr);
Addon::callHooks('post_local_end', $new_item); Hook::callAll('post_local_end', $new_item);
### src/Model/Contact.php ### src/Model/Contact.php
Addon::callHooks('contact_photo_menu', $args); Hook::callAll('contact_photo_menu', $args);
Addon::callHooks('follow', $arr); Hook::callAll('follow', $arr);
### src/Model/Profile.php ### src/Model/Profile.php
Addon::callHooks('profile_sidebar_enter', $profile); Hook::callAll('profile_sidebar_enter', $profile);
Addon::callHooks('profile_sidebar', $arr); Hook::callAll('profile_sidebar', $arr);
Addon::callHooks('profile_tabs', $arr); Hook::callAll('profile_tabs', $arr);
Addon::callHooks('zrl_init', $arr); Hook::callAll('zrl_init', $arr);
### src/Model/Event.php ### src/Model/Event.php
Addon::callHooks('event_updated', $event['id']); Hook::callAll('event_updated', $event['id']);
Addon::callHooks("event_created", $event['id']); Hook::callAll("event_created", $event['id']);
### src/Model/User.php ### src/Model/User.php
Addon::callHooks('register_account', $uid); Hook::callAll('register_account', $uid);
Addon::callHooks('remove_user', $user); Hook::callAll('remove_user', $user);
### src/Content/Text/BBCode.php ### src/Content/Text/BBCode.php
Addon::callHooks('bbcode', $text); Hook::callAll('bbcode', $text);
Addon::callHooks('bb2diaspora', $text); Hook::callAll('bb2diaspora', $text);
### src/Content/Text/HTML.php ### src/Content/Text/HTML.php
Addon::callHooks('html2bbcode', $message); Hook::callAll('html2bbcode', $message);
### src/Content/Smilies.php ### src/Content/Smilies.php
Addon::callHooks('smilie', $params); Hook::callAll('smilie', $params);
### src/Content/Feature.php ### src/Content/Feature.php
Addon::callHooks('isEnabled', $arr); Hook::callAll('isEnabled', $arr);
Addon::callHooks('get', $arr); Hook::callAll('get', $arr);
### src/Content/ContactSelector.php ### src/Content/ContactSelector.php
Addon::callHooks('network_to_name', $nets); Hook::callAll('network_to_name', $nets);
Addon::callHooks('gender_selector', $select); Hook::callAll('gender_selector', $select);
Addon::callHooks('sexpref_selector', $select); Hook::callAll('sexpref_selector', $select);
Addon::callHooks('marital_selector', $select); Hook::callAll('marital_selector', $select);
### src/Content/OEmbed.php ### src/Content/OEmbed.php
Addon::callHooks('oembed_fetch_url', $embedurl, $j); Hook::callAll('oembed_fetch_url', $embedurl, $j);
### src/Content/Nav.php ### src/Content/Nav.php
Addon::callHooks('page_header', $a->page['nav']); Hook::callAll('page_header', $a->page['nav']);
Addon::callHooks('nav_info', $nav); Hook::callAll('nav_info', $nav);
### src/Core/Authentication.php ### src/Core/Authentication.php
Addon::callHooks('logged_in', $a->user); Hook::callAll('logged_in', $a->user);
### src/Worker/Directory.php ### src/Worker/Directory.php
Addon::callHooks('globaldir_update', $arr); Hook::callAll('globaldir_update', $arr);
### src/Worker/Notifier.php ### src/Worker/Notifier.php
Addon::callHooks('notifier_end', $target_item); Hook::callAll('notifier_end', $target_item);
### src/Worker/Queue.php ### src/Worker/Queue.php
Addon::callHooks('queue_predeliver', $r); Hook::callAll('queue_predeliver', $r);
Addon::callHooks('queue_deliver', $params); Hook::callAll('queue_deliver', $params);
### src/Module/Login.php ### src/Module/Login.php
Addon::callHooks('authenticate', $addon_auth); Hook::callAll('authenticate', $addon_auth);
Addon::callHooks('login_hook', $o); Hook::callAll('login_hook', $o);
### src/Module/Logout.php ### src/Module/Logout.php
Addon::callHooks("logging_out"); Hook::callAll("logging_out");
### src/Object/Post.php ### src/Object/Post.php
Addon::callHooks('render_location', $locate); Hook::callAll('render_location', $locate);
Addon::callHooks('display_item', $arr); Hook::callAll('display_item', $arr);
### src/Core/ACL.php ### src/Core/ACL.php
Addon::callHooks('contact_select_options', $x); Hook::callAll('contact_select_options', $x);
Addon::callHooks($a->module.'_pre_'.$selname, $arr); Hook::callAll($a->module.'_pre_'.$selname, $arr);
Addon::callHooks($a->module.'_post_'.$selname, $o); Hook::callAll($a->module.'_post_'.$selname, $o);
Addon::callHooks($a->module.'_pre_'.$selname, $arr); Hook::callAll($a->module.'_pre_'.$selname, $arr);
Addon::callHooks($a->module.'_post_'.$selname, $o); Hook::callAll($a->module.'_post_'.$selname, $o);
Addon::callHooks('jot_networks', $jotnets); Hook::callAll('jot_networks', $jotnets);
### src/Core/Worker.php ### src/Core/Worker.php
Addon::callHooks("proc_run", $arr); Hook::callAll("proc_run", $arr);
### src/Util/Emailer.php ### src/Util/Emailer.php
Addon::callHooks('emailer_send_prepare', $params); Hook::callAll('emailer_send_prepare', $params);
Addon::callHooks("emailer_send", $hookdata); Hook::callAll("emailer_send", $hookdata);
### src/Util/Map.php ### src/Util/Map.php
Addon::callHooks('generate_map', $arr); Hook::callAll('generate_map', $arr);
Addon::callHooks('generate_named_map', $arr); Hook::callAll('generate_named_map', $arr);
Addon::callHooks('Map::getCoordinates', $arr); Hook::callAll('Map::getCoordinates', $arr);
### src/Util/Network.php ### src/Util/Network.php
Addon::callHooks('avatar_lookup', $avatar); Hook::callAll('avatar_lookup', $avatar);
### src/Util/ParseUrl.php ### src/Util/ParseUrl.php
Addon::callHooks("getsiteinfo", $siteinfo); Hook::callAll("getsiteinfo", $siteinfo);
### src/Protocol/DFRN.php ### src/Protocol/DFRN.php
Addon::callHooks('atom_feed_end', $atom); Hook::callAll('atom_feed_end', $atom);
Addon::callHooks('atom_feed_end', $atom); Hook::callAll('atom_feed_end', $atom);

View File

@ -11,9 +11,9 @@ use Friendica\Content\ContactSelector;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML; use Friendica\Content\Text\HTML;
use Friendica\Core\Addon;
use Friendica\Core\Authentication; use Friendica\Core\Authentication;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\NotificationsManager; use Friendica\Core\NotificationsManager;
@ -174,7 +174,7 @@ function api_login(App $a)
list($consumer, $token) = $oauth1->verify_request($request); list($consumer, $token) = $oauth1->verify_request($request);
if (!is_null($token)) { if (!is_null($token)) {
$oauth1->loginUser($token->uid); $oauth1->loginUser($token->uid);
Addon::callHooks('logged_in', $a->user); Hook::callAll('logged_in', $a->user);
return; return;
} }
echo __FILE__.__LINE__.__FUNCTION__ . "<pre>"; echo __FILE__.__LINE__.__FUNCTION__ . "<pre>";
@ -224,7 +224,7 @@ function api_login(App $a)
* Addons should never set 'authenticated' except to indicate success - as hooks may be chained * Addons should never set 'authenticated' except to indicate success - as hooks may be chained
* and later addons should not interfere with an earlier one that succeeded. * and later addons should not interfere with an earlier one that succeeded.
*/ */
Addon::callHooks('authenticate', $addon_auth); Hook::callAll('authenticate', $addon_auth);
if ($addon_auth['authenticated'] && count($addon_auth['user_record'])) { if ($addon_auth['authenticated'] && count($addon_auth['user_record'])) {
$record = $addon_auth['user_record']; $record = $addon_auth['user_record'];
@ -247,7 +247,7 @@ function api_login(App $a)
$_SESSION["allow_api"] = true; $_SESSION["allow_api"] = true;
Addon::callHooks('logged_in', $a->user); Hook::callAll('logged_in', $a->user);
} }
/** /**

View File

@ -8,8 +8,8 @@ use Friendica\Content\ContactSelector;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Content\Pager; use Friendica\Content\Pager;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
@ -543,7 +543,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
} }
$cb = ['items' => $items, 'mode' => $mode, 'update' => $update, 'preview' => $preview]; $cb = ['items' => $items, 'mode' => $mode, 'update' => $update, 'preview' => $preview];
Addon::callHooks('conversation_start',$cb); Hook::callAll('conversation_start',$cb);
$items = $cb['items']; $items = $cb['items'];
@ -615,7 +615,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
} }
$locate = ['location' => $item['location'], 'coord' => $item['coord'], 'html' => '']; $locate = ['location' => $item['location'], 'coord' => $item['coord'], 'html' => ''];
Addon::callHooks('render_location',$locate); Hook::callAll('render_location',$locate);
$location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate)); $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate));
@ -706,7 +706,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
]; ];
$arr = ['item' => $item, 'output' => $tmp_item]; $arr = ['item' => $item, 'output' => $tmp_item];
Addon::callHooks('display_item', $arr); Hook::callAll('display_item', $arr);
$threads[$threadsid]['id'] = $item['id']; $threads[$threadsid]['id'] = $item['id'];
$threads[$threadsid]['network'] = $item['network']; $threads[$threadsid]['network'] = $item['network'];
@ -743,7 +743,7 @@ function conversation(App $a, array $items, Pager $pager, $mode, $update, $previ
/// @todo Check if this call is needed or not /// @todo Check if this call is needed or not
$arr = ['item' => $item]; $arr = ['item' => $item];
Addon::callHooks('display_item', $arr); Hook::callAll('display_item', $arr);
$item['pagedrop'] = $page_dropping; $item['pagedrop'] = $page_dropping;
@ -892,7 +892,7 @@ function item_photo_menu($item) {
$args = ['item' => $item, 'menu' => $menu]; $args = ['item' => $item, 'menu' => $menu];
Addon::callHooks('item_photo_menu', $args); Hook::callAll('item_photo_menu', $args);
$menu = $args['menu']; $menu = $args['menu'];
@ -1097,7 +1097,7 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false)
]); ]);
$jotplugins = ''; $jotplugins = '';
Addon::callHooks('jot_tool', $jotplugins); Hook::callAll('jot_tool', $jotplugins);
// Private/public post links for the non-JS ACL form // Private/public post links for the non-JS ACL form
$private_post = 1; $private_post = 1;

View File

@ -4,8 +4,8 @@
*/ */
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
@ -441,7 +441,7 @@ function notification($params)
'itemlink' => $itemlink 'itemlink' => $itemlink
]; ];
Addon::callHooks('enotify', $h); Hook::callAll('enotify', $h);
$subject = $h['subject']; $subject = $h['subject'];
@ -481,7 +481,7 @@ function notification($params)
$datarray['otype'] = $params['otype']; $datarray['otype'] = $params['otype'];
$datarray['abort'] = false; $datarray['abort'] = false;
Addon::callHooks('enotify_store', $datarray); Hook::callAll('enotify_store', $datarray);
if ($datarray['abort']) { if ($datarray['abort']) {
L10n::popLang(); L10n::popLang();
@ -584,7 +584,7 @@ function notification($params)
$datarray['subject'] = $subject; $datarray['subject'] = $subject;
$datarray['headers'] = $additional_mail_header; $datarray['headers'] = $additional_mail_header;
Addon::callHooks('enotify_mail', $datarray); Hook::callAll('enotify_mail', $datarray);
// check whether sending post content in email notifications is allowed // check whether sending post content in email notifications is allowed
// always true for SYSTEM_EMAIL // always true for SYSTEM_EMAIL
@ -677,7 +677,7 @@ function check_user_notification($itemid) {
*/ */
function check_item_notification($itemid, $uid, $defaulttype = "") { function check_item_notification($itemid, $uid, $defaulttype = "") {
$notification_data = ["uid" => $uid, "profiles" => []]; $notification_data = ["uid" => $uid, "profiles" => []];
Addon::callHooks('check_item_notification', $notification_data); Hook::callAll('check_item_notification', $notification_data);
$profiles = $notification_data["profiles"]; $profiles = $notification_data["profiles"];

View File

@ -5,8 +5,8 @@
use Friendica\BaseObject; use Friendica\BaseObject;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
@ -27,7 +27,7 @@ use Friendica\Util\Temporal;
require_once 'mod/share.php'; require_once 'mod/share.php';
function add_page_info_data(array $data, $no_photos = false) function add_page_info_data(array $data, $no_photos = false)
{ {
Addon::callHooks('page_info_data', $data); Hook::callAll('page_info_data', $data);
if (empty($data['type'])) { if (empty($data['type'])) {
return ''; return '';

View File

@ -5,7 +5,7 @@
use Friendica\App; use Friendica\App;
use Friendica\Content\Widget; use Friendica\Content\Widget;
use Friendica\Core\ACL; use Friendica\Core\ACL;
use Friendica\Core\Addon; use Friendica\Core\Hook;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Database\DBA; use Friendica\Database\DBA;
@ -305,7 +305,7 @@ function acl_content(App $a)
'search' => $search, 'search' => $search,
]; ];
Addon::callHooks('acl_lookup_end', $results); Hook::callAll('acl_lookup_end', $results);
$o = [ $o = [
'tot' => $results['tot'], 'tot' => $results['tot'],

View File

@ -7,8 +7,8 @@ use Friendica\App;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Content\Pager; use Friendica\Content\Pager;
use Friendica\Content\Widget; use Friendica\Content\Widget;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Database\DBA; use Friendica\Database\DBA;
@ -190,7 +190,7 @@ function directory_content(App $a)
$arr = ['contact' => $rr, 'entry' => $entry]; $arr = ['contact' => $rr, 'entry' => $entry];
Addon::callHooks('directory_item', $arr); Hook::callAll('directory_item', $arr);
unset($profile); unset($profile);
unset($location); unset($location);

View File

@ -4,7 +4,6 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;

View File

@ -6,6 +6,7 @@
use Friendica\App; use Friendica\App;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBA; use Friendica\Database\DBA;
@ -126,7 +127,7 @@ function friendica_content(App $a)
$o .= '</tbody></table></div>' . PHP_EOL; $o .= '</tbody></table></div>' . PHP_EOL;
} }
Addon::callHooks('about_hook', $o); Hook::callAll('about_hook', $o);
return $o; return $o;
} }

View File

@ -3,8 +3,8 @@
* @file mod/home.php * @file mod/home.php
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\System; use Friendica\Core\System;
@ -14,7 +14,7 @@ if(! function_exists('home_init')) {
function home_init(App $a) { function home_init(App $a) {
$ret = []; $ret = [];
Addon::callHooks('home_init',$ret); Hook::callAll('home_init',$ret);
if (local_user() && ($a->user['nickname'])) { if (local_user() && ($a->user['nickname'])) {
$a->internalRedirect('network'); $a->internalRedirect('network');
@ -51,7 +51,7 @@ function home_content(App $a) {
$login = Login::form($a->query_string, intval(Config::get('config', 'register_policy')) === REGISTER_CLOSED ? 0 : 1); $login = Login::form($a->query_string, intval(Config::get('config', 'register_policy')) === REGISTER_CLOSED ? 0 : 1);
$content = ''; $content = '';
Addon::callHooks("home_content",$content); Hook::callAll("home_content",$content);
$tpl = Renderer::getMarkupTemplate('home.tpl'); $tpl = Renderer::getMarkupTemplate('home.tpl');

View File

@ -19,8 +19,8 @@ use Friendica\App;
use Friendica\Content\Pager; use Friendica\Content\Pager;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML; use Friendica\Content\Text\HTML;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
@ -54,7 +54,7 @@ function item_post(App $a) {
exit(); exit();
} }
Addon::callHooks('post_local_start', $_REQUEST); Hook::callAll('post_local_start', $_REQUEST);
Logger::log('postvars ' . print_r($_REQUEST, true), Logger::DATA); Logger::log('postvars ' . print_r($_REQUEST, true), Logger::DATA);
@ -679,7 +679,7 @@ function item_post(App $a) {
exit(); exit();
} }
Addon::callHooks('post_local',$datarray); Hook::callAll('post_local',$datarray);
if (!empty($datarray['cancel'])) { if (!empty($datarray['cancel'])) {
Logger::log('mod_item: post cancelled by addon.'); Logger::log('mod_item: post cancelled by addon.');
@ -795,7 +795,7 @@ function item_post(App $a) {
} }
} }
Addon::callHooks('post_local_end', $datarray); Hook::callAll('post_local_end', $datarray);
if (strlen($emailcc) && $profile_uid == local_user()) { if (strlen($emailcc) && $profile_uid == local_user()) {
$erecips = explode(',', $emailcc); $erecips = explode(',', $emailcc);

View File

@ -3,7 +3,7 @@
* @file mod/lockview.php * @file mod/lockview.php
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Addon; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Model\Item; use Friendica\Model\Item;
@ -40,7 +40,7 @@ function lockview_content(App $a)
exit(); exit();
} }
Addon::callHooks('lockview_content', $item); Hook::callAll('lockview_content', $item);
if ($item['uid'] != local_user()) { if ($item['uid'] != local_user()) {
echo L10n::t('Remote privacy information not available.') . '<br />'; echo L10n::t('Remote privacy information not available.') . '<br />';

View File

@ -4,10 +4,9 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Authentication; use Friendica\Core\Authentication;
use Friendica\Core\Addon; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Database\DBA; use Friendica\Database\DBA;
function manage_post(App $a) { function manage_post(App $a) {
@ -116,7 +115,7 @@ function manage_post(App $a) {
} }
$ret = []; $ret = [];
Addon::callHooks('home_init',$ret); Hook::callAll('home_init',$ret);
$a->internalRedirect('profile/' . $a->user['nickname'] ); $a->internalRedirect('profile/' . $a->user['nickname'] );
// NOTREACHED // NOTREACHED

View File

@ -12,7 +12,6 @@ use Friendica\Content\Pager;
use Friendica\Content\Widget; use Friendica\Content\Widget;
use Friendica\Content\Text\HTML; use Friendica\Content\Text\HTML;
use Friendica\Core\ACL; use Friendica\Core\ACL;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
@ -355,7 +354,7 @@ function network_content(App $a, $update = 0, $parent = 0)
/// @TODO Is this really necessary? $a is already available to hooks /// @TODO Is this really necessary? $a is already available to hooks
$arr = ['query' => $a->query_string]; $arr = ['query' => $a->query_string];
Addon::callHooks('network_content_init', $arr); Hook::callAll('network_content_init', $arr);
$flat_mode = false; $flat_mode = false;
@ -1024,7 +1023,7 @@ function network_tabs(App $a)
} }
$arr = ['tabs' => $tabs]; $arr = ['tabs' => $tabs];
Addon::callHooks('network_tabs', $arr); Hook::callAll('network_tabs', $arr);
$tpl = Renderer::getMarkupTemplate('common_tabs.tpl'); $tpl = Renderer::getMarkupTemplate('common_tabs.tpl');

View File

@ -10,7 +10,7 @@
* @see ParseUrl::getSiteinfo() for more information about scraping embeddable content * @see ParseUrl::getSiteinfo() for more information about scraping embeddable content
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Addon; use Friendica\Core\Hook;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Util\Network; use Friendica\Util\Network;
use Friendica\Util\ParseUrl; use Friendica\Util\ParseUrl;
@ -97,7 +97,7 @@ function parse_url_content(App $a)
$arr = ['url' => $url, 'text' => '']; $arr = ['url' => $url, 'text' => ''];
Addon::callHooks('parse_link', $arr); Hook::callAll('parse_link', $arr);
if (strlen($arr['text'])) { if (strlen($arr['text'])) {
echo $arr['text']; echo $arr['text'];

View File

@ -9,13 +9,12 @@ use Friendica\Content\Nav;
use Friendica\Content\Pager; use Friendica\Content\Pager;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Core\ACL; use Friendica\Core\ACL;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\Group; use Friendica\Model\Group;
@ -666,7 +665,7 @@ function photos_post(App $a)
// default post action - upload a photo // default post action - upload a photo
Addon::callHooks('photo_post_init', $_POST); Hook::callAll('photo_post_init', $_POST);
// Determine the album to use // Determine the album to use
$album = !empty($_REQUEST['album']) ? Strings::escapeTags(trim($_REQUEST['album'])) : ''; $album = !empty($_REQUEST['album']) ? Strings::escapeTags(trim($_REQUEST['album'])) : '';
@ -714,7 +713,7 @@ function photos_post(App $a)
$ret = ['src' => '', 'filename' => '', 'filesize' => 0, 'type' => '']; $ret = ['src' => '', 'filename' => '', 'filesize' => 0, 'type' => ''];
Addon::callHooks('photo_post_file', $ret); Hook::callAll('photo_post_file', $ret);
if (!empty($ret['src']) && !empty($ret['filesize'])) { if (!empty($ret['src']) && !empty($ret['filesize'])) {
$src = $ret['src']; $src = $ret['src'];
@ -754,7 +753,7 @@ function photos_post(App $a)
} }
@unlink($src); @unlink($src);
$foo = 0; $foo = 0;
Addon::callHooks('photo_post_end', $foo); Hook::callAll('photo_post_end', $foo);
return; return;
} }
@ -770,7 +769,7 @@ function photos_post(App $a)
notice(L10n::t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)) . EOL); notice(L10n::t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)) . EOL);
@unlink($src); @unlink($src);
$foo = 0; $foo = 0;
Addon::callHooks('photo_post_end', $foo); Hook::callAll('photo_post_end', $foo);
return; return;
} }
@ -778,7 +777,7 @@ function photos_post(App $a)
notice(L10n::t('Image file is empty.') . EOL); notice(L10n::t('Image file is empty.') . EOL);
@unlink($src); @unlink($src);
$foo = 0; $foo = 0;
Addon::callHooks('photo_post_end', $foo); Hook::callAll('photo_post_end', $foo);
return; return;
} }
@ -793,7 +792,7 @@ function photos_post(App $a)
notice(L10n::t('Unable to process image.') . EOL); notice(L10n::t('Unable to process image.') . EOL);
@unlink($src); @unlink($src);
$foo = 0; $foo = 0;
Addon::callHooks('photo_post_end',$foo); Hook::callAll('photo_post_end',$foo);
exit(); exit();
} }
@ -879,7 +878,7 @@ function photos_post(App $a)
// Update the photo albums cache // Update the photo albums cache
Photo::clearAlbumCache($page_owner_uid); Photo::clearAlbumCache($page_owner_uid);
Addon::callHooks('photo_post_end', $item_id); Hook::callAll('photo_post_end', $item_id);
// addon uploaders should call "killme()" [e.g. exit] within the photo_post_end hook // addon uploaders should call "killme()" [e.g. exit] within the photo_post_end hook
// if they do not wish to be redirected // if they do not wish to be redirected
@ -1042,7 +1041,7 @@ function photos_content(App $a)
'addon_text' => $uploader, 'addon_text' => $uploader,
'default_upload' => true]; 'default_upload' => true];
Addon::callHooks('photo_upload_form',$ret); Hook::callAll('photo_upload_form',$ret);
$default_upload_box = Renderer::replaceMacros(Renderer::getMarkupTemplate('photos_default_uploader_box.tpl'), []); $default_upload_box = Renderer::replaceMacros(Renderer::getMarkupTemplate('photos_default_uploader_box.tpl'), []);
$default_upload_submit = Renderer::replaceMacros(Renderer::getMarkupTemplate('photos_default_uploader_submit.tpl'), [ $default_upload_submit = Renderer::replaceMacros(Renderer::getMarkupTemplate('photos_default_uploader_submit.tpl'), [

View File

@ -4,12 +4,11 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Content\ForumManager; use Friendica\Content\ForumManager;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Core\Addon;
use Friendica\Core\Cache; use Friendica\Core\Cache;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
@ -129,7 +128,7 @@ function ping_init(App $a)
if (DBA::isResult($items)) { if (DBA::isResult($items)) {
$items_unseen = Item::inArray($items); $items_unseen = Item::inArray($items);
$arr = ['items' => $items_unseen]; $arr = ['items' => $items_unseen];
Addon::callHooks('network_ping', $arr); Hook::callAll('network_ping', $arr);
foreach ($items_unseen as $item) { foreach ($items_unseen as $item) {
if ($item['wall']) { if ($item['wall']) {

View File

@ -14,12 +14,11 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Addon; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Model\Item; use Friendica\Model\Item;
use Friendica\Util\Strings; use Friendica\Util\Strings;
@ -129,9 +128,9 @@ function poke_init(App $a)
$arr['object'] .= XML::escape('<link rel="photo" type="image/jpeg" href="' . $target['photo'] . '" />' . "\n"); $arr['object'] .= XML::escape('<link rel="photo" type="image/jpeg" href="' . $target['photo'] . '" />' . "\n");
$arr['object'] .= '</link></object>' . "\n"; $arr['object'] .= '</link></object>' . "\n";
$item_id = Item::insert($arr); Item::insert($arr);
Addon::callHooks('post_local_end', $arr); Hook::callAll('post_local_end', $arr);
return; return;
} }
@ -143,9 +142,6 @@ function poke_content(App $a)
return; return;
} }
$name = '';
$id = '';
if (empty($_GET['c'])) { if (empty($_GET['c'])) {
return; return;
} }

View File

@ -8,10 +8,9 @@ use Friendica\Content\Nav;
use Friendica\Content\Pager; use Friendica\Content\Pager;
use Friendica\Content\Widget; use Friendica\Content\Widget;
use Friendica\Core\ACL; use Friendica\Core\ACL;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBA; use Friendica\Database\DBA;
@ -167,7 +166,7 @@ function profile_content(App $a, $update = 0)
if ($tab === 'profile') { if ($tab === 'profile') {
$o .= Profile::getAdvanced($a); $o .= Profile::getAdvanced($a);
Addon::callHooks('profile_advanced', $o); Hook::callAll('profile_advanced', $o);
return $o; return $o;
} }

View File

@ -8,8 +8,8 @@ use Friendica\BaseModule;
use Friendica\Content\ContactSelector; use Friendica\Content\ContactSelector;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
@ -186,7 +186,7 @@ function profiles_post(App $a) {
$namechanged = false; $namechanged = false;
Addon::callHooks('profile_post', $_POST); Hook::callAll('profile_post', $_POST);
if (($a->argc > 1) && ($a->argv[1] !== "new") && intval($a->argv[1])) { if (($a->argc > 1) && ($a->argv[1] !== "new") && intval($a->argv[1])) {
$orig = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1", $orig = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
@ -645,7 +645,7 @@ function profiles_content(App $a) {
]); ]);
$arr = ['profile' => $r[0], 'entry' => $o]; $arr = ['profile' => $r[0], 'entry' => $o];
Addon::callHooks('profile_edit', $arr); Hook::callAll('profile_edit', $arr);
return $o; return $o;
} else { } else {

View File

@ -6,8 +6,8 @@
use Friendica\App; use Friendica\App;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
@ -26,7 +26,7 @@ function register_post(App $a)
$blocked = 1; $blocked = 1;
$arr = ['post' => $_POST]; $arr = ['post' => $_POST];
Addon::callHooks('register_post', $arr); Hook::callAll('register_post', $arr);
$max_dailies = intval(Config::get('system', 'max_daily_registrations')); $max_dailies = intval(Config::get('system', 'max_daily_registrations'));
if ($max_dailies) { if ($max_dailies) {
@ -241,7 +241,7 @@ function register_content(App $a)
$arr = ['template' => $tpl]; $arr = ['template' => $tpl];
Addon::callHooks('register_form', $arr); Hook::callAll('register_form', $arr);
$tpl = $arr['template']; $tpl = $arr['template'];

View File

@ -8,8 +8,8 @@ use Friendica\BaseModule;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Core\ACL; use Friendica\Core\ACL;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
@ -215,7 +215,7 @@ function settings_post(App $a)
if (($a->argc > 1) && ($a->argv[1] == 'addon')) { if (($a->argc > 1) && ($a->argv[1] == 'addon')) {
BaseModule::checkFormSecurityTokenRedirectOnError('/settings/addon', 'settings_addon'); BaseModule::checkFormSecurityTokenRedirectOnError('/settings/addon', 'settings_addon');
Addon::callHooks('addon_settings_post', $_POST); Hook::callAll('addon_settings_post', $_POST);
return; return;
} }
@ -297,7 +297,7 @@ function settings_post(App $a)
} }
} }
Addon::callHooks('connector_settings_post', $_POST); Hook::callAll('connector_settings_post', $_POST);
return; return;
} }
@ -372,7 +372,7 @@ function settings_post(App $a)
intval(local_user()) intval(local_user())
); );
Addon::callHooks('display_settings_post', $_POST); Hook::callAll('display_settings_post', $_POST);
$a->internalRedirect('settings/display'); $a->internalRedirect('settings/display');
return; // NOTREACHED return; // NOTREACHED
} }
@ -385,7 +385,7 @@ function settings_post(App $a)
$a->internalRedirect('settings'); $a->internalRedirect('settings');
} }
Addon::callHooks('settings_post', $_POST); Hook::callAll('settings_post', $_POST);
if (!empty($_POST['password']) || !empty($_POST['confirm'])) { if (!empty($_POST['password']) || !empty($_POST['confirm'])) {
$newpass = $_POST['password']; $newpass = $_POST['password'];
@ -743,7 +743,7 @@ function settings_content(App $a)
$settings_addons = L10n::t('No Addon settings configured'); $settings_addons = L10n::t('No Addon settings configured');
} }
Addon::callHooks('addon_settings', $settings_addons); Hook::callAll('addon_settings', $settings_addons);
$tpl = Renderer::getMarkupTemplate('settings/addons.tpl'); $tpl = Renderer::getMarkupTemplate('settings/addons.tpl');
@ -790,7 +790,7 @@ function settings_content(App $a)
} }
$settings_connectors = ''; $settings_connectors = '';
Addon::callHooks('connector_settings', $settings_connectors); Hook::callAll('connector_settings', $settings_connectors);
if (is_site_admin()) { if (is_site_admin()) {
$diasp_enabled = L10n::t('Built-in support for %s connectivity is %s', L10n::t('Diaspora'), ((Config::get('system', 'diaspora_enabled')) ? L10n::t('enabled') : L10n::t('disabled'))); $diasp_enabled = L10n::t('Built-in support for %s connectivity is %s', L10n::t('Diaspora'), ((Config::get('system', 'diaspora_enabled')) ? L10n::t('enabled') : L10n::t('disabled')));
@ -863,7 +863,7 @@ function settings_content(App $a)
'$submit' => L10n::t('Save Settings'), '$submit' => L10n::t('Save Settings'),
]); ]);
Addon::callHooks('display_settings', $o); Hook::callAll('display_settings', $o);
return $o; return $o;
} }
@ -1262,7 +1262,7 @@ function settings_content(App $a)
]); ]);
Addon::callHooks('settings_form', $o); Hook::callAll('settings_form', $o);
$o .= '</form>' . "\r\n"; $o .= '</form>' . "\r\n";

View File

@ -3,7 +3,7 @@
* @file mod/subthread.php * @file mod/subthread.php
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Addon; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\System; use Friendica\Core\System;
@ -149,7 +149,7 @@ EOT;
$arr['id'] = $post_id; $arr['id'] = $post_id;
Addon::callHooks('post_local_end', $arr); Hook::callAll('post_local_end', $arr);
exit(); exit();

View File

@ -3,7 +3,7 @@
* @file mod/tagger.php * @file mod/tagger.php
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Addon; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\System; use Friendica\Core\System;
@ -199,7 +199,7 @@ EOT;
$arr['id'] = $post_id; $arr['id'] = $post_id;
Addon::callHooks('post_local_end', $arr); Hook::callAll('post_local_end', $arr);
Worker::add(PRIORITY_HIGH, "Notifier", "tag", $post_id); Worker::add(PRIORITY_HIGH, "Notifier", "tag", $post_id);

View File

@ -3,7 +3,7 @@
* @file mod/uexport.php * @file mod/uexport.php
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Addon; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\System; use Friendica\Core\System;
@ -45,7 +45,7 @@ function uexport_content(App $a) {
['uexport/account', L10n::t('Export account'), L10n::t('Export your account info and contacts. Use this to make a backup of your account and/or to move it to another server.')], ['uexport/account', L10n::t('Export account'), L10n::t('Export your account info and contacts. Use this to make a backup of your account and/or to move it to another server.')],
['uexport/backup', L10n::t('Export all'), L10n::t("Export your accout info, contacts and all your items as json. Could be a very big file, and could take a lot of time. Use this to make a full backup of your account \x28photos are not exported\x29")], ['uexport/backup', L10n::t('Export all'), L10n::t("Export your accout info, contacts and all your items as json. Could be a very big file, and could take a lot of time. Use this to make a full backup of your account \x28photos are not exported\x29")],
]; ];
Addon::callHooks('uexport_options', $options); Hook::callAll('uexport_options', $options);
$tpl = Renderer::getMarkupTemplate("uexport.tpl"); $tpl = Renderer::getMarkupTemplate("uexport.tpl");
return Renderer::replaceMacros($tpl, [ return Renderer::replaceMacros($tpl, [

View File

@ -4,7 +4,7 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Addon; use Friendica\Core\Hook;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBA; use Friendica\Database\DBA;
@ -127,7 +127,7 @@ function xrd_xml($a, $uri, $alias, $profile_url, $r)
); );
$arr = ['user' => $r, 'xml' => $o]; $arr = ['user' => $r, 'xml' => $o];
Addon::callHooks('personal_xrd', $arr); Hook::callAll('personal_xrd', $arr);
echo $arr['xml']; echo $arr['xml'];
exit(); exit();

View File

@ -781,7 +781,7 @@ class App
$touch_icon = 'images/friendica-128.png'; $touch_icon = 'images/friendica-128.png';
} }
Core\Addon::callHooks('head', $this->page['htmlhead']); Core\Hook::callAll('head', $this->page['htmlhead']);
$tpl = Core\Renderer::getMarkupTemplate('head.tpl'); $tpl = Core\Renderer::getMarkupTemplate('head.tpl');
/* put the head template at the beginning of page['htmlhead'] /* put the head template at the beginning of page['htmlhead']
@ -840,7 +840,7 @@ class App
]); ]);
} }
Core\Addon::callHooks('footer', $this->page['footer']); Core\Hook::callAll('footer', $this->page['footer']);
$tpl = Core\Renderer::getMarkupTemplate('footer.tpl'); $tpl = Core\Renderer::getMarkupTemplate('footer.tpl');
$this->page['footer'] = Core\Renderer::replaceMacros($tpl, [ $this->page['footer'] = Core\Renderer::replaceMacros($tpl, [
@ -1534,7 +1534,7 @@ class App
} }
Core\Session::init(); Core\Session::init();
Core\Addon::callHooks('init_1'); Core\Hook::callAll('init_1');
} }
// Exclude the backend processes from the session management // Exclude the backend processes from the session management
@ -1725,7 +1725,7 @@ class App
$this->page['page_title'] = $this->module; $this->page['page_title'] = $this->module;
$placeholder = ''; $placeholder = '';
Core\Addon::callHooks($this->module . '_mod_init', $placeholder); Core\Hook::callAll($this->module . '_mod_init', $placeholder);
call_user_func([$this->module_class, 'init']); call_user_func([$this->module_class, 'init']);
@ -1749,28 +1749,28 @@ class App
if ($this->module_loaded) { if ($this->module_loaded) {
if (! $this->error && $_SERVER['REQUEST_METHOD'] === 'POST') { if (! $this->error && $_SERVER['REQUEST_METHOD'] === 'POST') {
Core\Addon::callHooks($this->module . '_mod_post', $_POST); Core\Hook::callAll($this->module . '_mod_post', $_POST);
call_user_func([$this->module_class, 'post']); call_user_func([$this->module_class, 'post']);
} }
if (! $this->error) { if (! $this->error) {
Core\Addon::callHooks($this->module . '_mod_afterpost', $placeholder); Core\Hook::callAll($this->module . '_mod_afterpost', $placeholder);
call_user_func([$this->module_class, 'afterpost']); call_user_func([$this->module_class, 'afterpost']);
} }
if (! $this->error) { if (! $this->error) {
$arr = ['content' => $content]; $arr = ['content' => $content];
Core\Addon::callHooks($this->module . '_mod_content', $arr); Core\Hook::callAll($this->module . '_mod_content', $arr);
$content = $arr['content']; $content = $arr['content'];
$arr = ['content' => call_user_func([$this->module_class, 'content'])]; $arr = ['content' => call_user_func([$this->module_class, 'content'])];
Core\Addon::callHooks($this->module . '_mod_aftercontent', $arr); Core\Hook::callAll($this->module . '_mod_aftercontent', $arr);
$content .= $arr['content']; $content .= $arr['content'];
} }
} }
// initialise content region // initialise content region
if ($this->getMode()->isNormal()) { if ($this->getMode()->isNormal()) {
Core\Addon::callHooks('page_content_top', $this->page['content']); Core\Hook::callAll('page_content_top', $this->page['content']);
} }
$this->page['content'] .= $content; $this->page['content'] .= $content;
@ -1797,7 +1797,7 @@ class App
} }
// Report anything which needs to be communicated in the notification area (before the main body) // Report anything which needs to be communicated in the notification area (before the main body)
Core\Addon::callHooks('page_end', $this->page['content']); Core\Hook::callAll('page_end', $this->page['content']);
// Add the navigation (menu) template // Add the navigation (menu) template
if ($this->module != 'install' && $this->module != 'maintenance') { if ($this->module != 'install' && $this->module != 'maintenance') {

View File

@ -4,10 +4,9 @@
*/ */
namespace Friendica\Content; namespace Friendica\Content;
use Friendica\Core\Addon; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Core\System;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Util\Network; use Friendica\Util\Network;
use Friendica\Util\Strings; use Friendica\Util\Strings;
@ -96,7 +95,7 @@ class ContactSelector
Protocol::PNUT => L10n::t('pnut'), Protocol::PNUT => L10n::t('pnut'),
]; ];
Addon::callHooks('network_to_name', $nets); Hook::callAll('network_to_name', $nets);
$search = array_keys($nets); $search = array_keys($nets);
$replace = array_values($nets); $replace = array_values($nets);
@ -141,6 +140,7 @@ class ContactSelector
/** /**
* @param string $current optional, default empty * @param string $current optional, default empty
* @param string $suffix optionsl, default empty * @param string $suffix optionsl, default empty
* @return string
*/ */
public static function gender($current = "", $suffix = "") public static function gender($current = "", $suffix = "")
{ {
@ -163,7 +163,7 @@ class ContactSelector
'Undecided' => L10n::t('Undecided'), 'Undecided' => L10n::t('Undecided'),
]; ];
Addon::callHooks('gender_selector', $select); Hook::callAll('gender_selector', $select);
$o .= "<select name=\"gender$suffix\" id=\"gender-select$suffix\" size=\"1\" >"; $o .= "<select name=\"gender$suffix\" id=\"gender-select$suffix\" size=\"1\" >";
foreach ($select as $neutral => $selection) { foreach ($select as $neutral => $selection) {
@ -179,6 +179,7 @@ class ContactSelector
/** /**
* @param string $current optional, default empty * @param string $current optional, default empty
* @param string $suffix optionsl, default empty * @param string $suffix optionsl, default empty
* @return string
*/ */
public static function sexualPreference($current = "", $suffix = "") public static function sexualPreference($current = "", $suffix = "")
{ {
@ -200,7 +201,7 @@ class ContactSelector
'Nonsexual' => L10n::t('Nonsexual'), 'Nonsexual' => L10n::t('Nonsexual'),
]; ];
Addon::callHooks('sexpref_selector', $select); Hook::callAll('sexpref_selector', $select);
$o .= "<select name=\"sexual$suffix\" id=\"sexual-select$suffix\" size=\"1\" >"; $o .= "<select name=\"sexual$suffix\" id=\"sexual-select$suffix\" size=\"1\" >";
foreach ($select as $neutral => $selection) { foreach ($select as $neutral => $selection) {
@ -215,6 +216,7 @@ class ContactSelector
/** /**
* @param string $current optional, default empty * @param string $current optional, default empty
* @return string
*/ */
public static function maritalStatus($current = "") public static function maritalStatus($current = "")
{ {
@ -254,7 +256,7 @@ class ContactSelector
'Ask me' => L10n::t('Ask me'), 'Ask me' => L10n::t('Ask me'),
]; ];
Addon::callHooks('marital_selector', $select); Hook::callAll('marital_selector', $select);
$o .= '<select name="marital" id="marital-select" size="1" >'; $o .= '<select name="marital" id="marital-select" size="1" >';
foreach ($select as $neutral => $selection) { foreach ($select as $neutral => $selection) {

View File

@ -5,8 +5,8 @@
*/ */
namespace Friendica\Content; namespace Friendica\Content;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
@ -36,7 +36,7 @@ class Feature
} }
$arr = ['uid' => $uid, 'feature' => $feature, 'enabled' => $x]; $arr = ['uid' => $uid, 'feature' => $feature, 'enabled' => $x];
Addon::callHooks('isEnabled', $arr); Hook::callAll('isEnabled', $arr);
return($arr['enabled']); return($arr['enabled']);
} }
@ -139,7 +139,7 @@ class Feature
} }
} }
Addon::callHooks('get', $arr); Hook::callAll('get', $arr);
return $arr; return $arr;
} }
} }

View File

@ -5,9 +5,8 @@
namespace Friendica\Content; namespace Friendica\Content;
use Friendica\App; use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\System; use Friendica\Core\System;
@ -74,7 +73,7 @@ class Nav
'$search_hint' => L10n::t('@name, !forum, #tags, content') '$search_hint' => L10n::t('@name, !forum, #tags, content')
]); ]);
Addon::callHooks('page_header', $nav); Hook::callAll('page_header', $nav);
return $nav; return $nav;
} }
@ -105,7 +104,7 @@ class Nav
if (local_user() || !$privateapps) { if (local_user() || !$privateapps) {
$arr = ['app_menu' => self::$app_menu]; $arr = ['app_menu' => self::$app_menu];
Addon::callHooks('app_menu', $arr); Hook::callAll('app_menu', $arr);
self::$app_menu = $arr['app_menu']; self::$app_menu = $arr['app_menu'];
} }
@ -276,7 +275,7 @@ class Nav
$banner = '<a href="https://friendi.ca"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>'; $banner = '<a href="https://friendi.ca"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>';
} }
Addon::callHooks('nav_info', $nav); Hook::callAll('nav_info', $nav);
return [ return [
'sitelocation' => $sitelocation, 'sitelocation' => $sitelocation,

View File

@ -10,9 +10,9 @@ use DOMNode;
use DOMText; use DOMText;
use DOMXPath; use DOMXPath;
use Exception; use Exception;
use Friendica\Core\Addon;
use Friendica\Core\Cache; use Friendica\Core\Cache;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\System; use Friendica\Core\System;
@ -159,7 +159,7 @@ class OEmbed
} }
} }
Addon::callHooks('oembed_fetch_url', $embedurl, $oembed); Hook::callAll('oembed_fetch_url', $embedurl, $oembed);
return $oembed; return $oembed;
} }

View File

@ -14,9 +14,8 @@
*/ */
namespace Friendica\Content; namespace Friendica\Content;
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Util\Strings; use Friendica\Util\Strings;
@ -141,7 +140,7 @@ class Smilies
]; ];
$params = ['texts' => $texts, 'icons' => $icons]; $params = ['texts' => $texts, 'icons' => $icons];
Addon::callHooks('smilie', $params); Hook::callAll('smilie', $params);
return $params; return $params;
} }

View File

@ -11,9 +11,9 @@ use Exception;
use Friendica\BaseObject; use Friendica\BaseObject;
use Friendica\Content\OEmbed; use Friendica\Content\OEmbed;
use Friendica\Content\Smilies; use Friendica\Content\Smilies;
use Friendica\Core\Addon;
use Friendica\Core\Cache; use Friendica\Core\Cache;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
@ -1756,7 +1756,7 @@ class BBCode extends BaseObject
//$Text = str_replace('<br /><li>', '<li>', $Text); //$Text = str_replace('<br /><li>', '<li>', $Text);
//$Text = str_replace('<br /><ul', '<ul ', $Text); //$Text = str_replace('<br /><ul', '<ul ', $Text);
Addon::callHooks('bbcode', $text); Hook::callAll('bbcode', $text);
return trim($text); return trim($text);
} }
@ -1917,7 +1917,7 @@ class BBCode extends BaseObject
); );
} }
Addon::callHooks('bb2diaspora', $text); Hook::callAll('bb2diaspora', $text);
return $text; return $text;
} }

View File

@ -7,8 +7,7 @@ namespace Friendica\Content\Text;
use DOMDocument; use DOMDocument;
use DOMXPath; use DOMXPath;
use Friendica\Content\Feature; use Friendica\Core\Hook;
use Friendica\Core\Addon;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
@ -315,7 +314,7 @@ class HTML
$message = preg_replace('=\r *\r=i', "\n", $message); $message = preg_replace('=\r *\r=i', "\n", $message);
$message = str_replace("\r", "\n", $message); $message = str_replace("\r", "\n", $message);
Addon::callHooks('html2bbcode', $message); Hook::callAll('html2bbcode', $message);
$message = strip_tags($message); $message = strip_tags($message);
@ -883,7 +882,7 @@ class HTML
$arr = ['contacts' => $r, 'output' => $o]; $arr = ['contacts' => $r, 'output' => $o];
Addon::callHooks('contact_block_end', $arr); Hook::callAll('contact_block_end', $arr);
return $o; return $o;
} }

View File

@ -8,8 +8,6 @@ namespace Friendica\Core;
use Friendica\BaseObject; use Friendica\BaseObject;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\GContact; use Friendica\Model\GContact;
@ -69,7 +67,7 @@ class ACL extends BaseObject
$x = ['options' => $options, 'size' => $size, 'single' => $single, 'mutual' => $mutual, 'exclude' => $exclude, 'networks' => $networks]; $x = ['options' => $options, 'size' => $size, 'single' => $single, 'mutual' => $mutual, 'exclude' => $exclude, 'networks' => $networks];
Addon::callHooks('contact_select_options', $x); Hook::callAll('contact_select_options', $x);
$o = ''; $o = '';
@ -111,7 +109,7 @@ class ACL extends BaseObject
$arr = ['contact' => $contacts, 'entry' => $o]; $arr = ['contact' => $contacts, 'entry' => $o];
// e.g. 'network_pre_contact_deny', 'profile_pre_contact_allow' // e.g. 'network_pre_contact_deny', 'profile_pre_contact_allow'
Addon::callHooks($a->module . '_pre_' . $selname, $arr); Hook::callAll($a->module . '_pre_' . $selname, $arr);
if (DBA::isResult($contacts)) { if (DBA::isResult($contacts)) {
foreach ($contacts as $contact) { foreach ($contacts as $contact) {
@ -129,7 +127,7 @@ class ACL extends BaseObject
$o .= '</select>' . PHP_EOL; $o .= '</select>' . PHP_EOL;
Addon::callHooks($a->module . '_post_' . $selname, $o); Hook::callAll($a->module . '_post_' . $selname, $o);
return $o; return $o;
} }
@ -176,7 +174,7 @@ class ACL extends BaseObject
$arr = ['contact' => $contacts, 'entry' => $o]; $arr = ['contact' => $contacts, 'entry' => $o];
// e.g. 'network_pre_contact_deny', 'profile_pre_contact_allow' // e.g. 'network_pre_contact_deny', 'profile_pre_contact_allow'
Addon::callHooks($a->module . '_pre_' . $selname, $arr); Hook::callAll($a->module . '_pre_' . $selname, $arr);
$receiverlist = []; $receiverlist = [];
@ -202,7 +200,7 @@ class ACL extends BaseObject
$o .= implode(', ', $receiverlist); $o .= implode(', ', $receiverlist);
} }
Addon::callHooks($a->module . '_post_' . $selname, $o); Hook::callAll($a->module . '_post_' . $selname, $o);
return $o; return $o;
} }
@ -285,7 +283,7 @@ class ACL extends BaseObject
$jotnets .= '<div class="profile-jot-net"><input type="checkbox" name="pubmail_enable"' . $selected . ' value="1" /> ' . L10n::t("Post to Email") . '</div>'; $jotnets .= '<div class="profile-jot-net"><input type="checkbox" name="pubmail_enable"' . $selected . ' value="1" /> ' . L10n::t("Post to Email") . '</div>';
} }
Addon::callHooks('jot_networks', $jotnets); Hook::callAll('jot_networks', $jotnets);
} else { } else {
$jotnets .= L10n::t('Connectors disabled, since "%s" is enabled.', $jotnets .= L10n::t('Connectors disabled, since "%s" is enabled.',
L10n::t('Hide your profile details from unknown viewers?')); L10n::t('Hide your profile details from unknown viewers?'));

View File

@ -6,11 +6,6 @@
namespace Friendica\Core; namespace Friendica\Core;
use Friendica\BaseObject; use Friendica\BaseObject;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\PConfig;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
@ -154,7 +149,7 @@ class Authentication extends BaseObject
} }
if ($login_initial) { if ($login_initial) {
Addon::callHooks('logged_in', $a->user); Hook::callAll('logged_in', $a->user);
if (($a->module !== 'home') && isset($_SESSION['return_path'])) { if (($a->module !== 'home') && isset($_SESSION['return_path'])) {
$a->internalRedirect($_SESSION['return_path']); $a->internalRedirect($_SESSION['return_path']);

View File

@ -6,9 +6,6 @@ namespace Friendica\Core;
use Friendica\BaseObject; use Friendica\BaseObject;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Core\Addon;
use Friendica\Core\Logger;
use Friendica\Core\System;
/** /**
* Provide Language, Translation, and Localization functions to the application * Provide Language, Translation, and Localization functions to the application
@ -402,7 +399,7 @@ class L10n extends BaseObject
'rebuff' => ['rebuffed', self::t('rebuff'), self::t('rebuffed')], 'rebuff' => ['rebuffed', self::t('rebuff'), self::t('rebuffed')],
]; ];
Addon::callHooks('poke_verbs', $arr); Hook::callAll('poke_verbs', $arr);
return $arr; return $arr;
} }

View File

@ -5,7 +5,6 @@
namespace Friendica\Core; namespace Friendica\Core;
use Friendica\BaseObject; use Friendica\BaseObject;
use Friendica\Core\Logger;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Model\Process; use Friendica\Model\Process;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
@ -1070,7 +1069,7 @@ class Worker
$arr = ['args' => $args, 'run_cmd' => true]; $arr = ['args' => $args, 'run_cmd' => true];
Addon::callHooks("proc_run", $arr); Hook::callAll("proc_run", $arr);
if (!$arr['run_cmd'] || !count($args)) { if (!$arr['run_cmd'] || !count($args)) {
return true; return true;
} }

View File

@ -6,7 +6,6 @@ namespace Friendica\Model;
use Friendica\BaseObject; use Friendica\BaseObject;
use Friendica\Content\Pager; use Friendica\Content\Pager;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
@ -1007,7 +1006,7 @@ class Contact extends BaseObject
$args = ['contact' => $contact, 'menu' => &$menu]; $args = ['contact' => $contact, 'menu' => &$menu];
Addon::callHooks('contact_photo_menu', $args); Hook::callAll('contact_photo_menu', $args);
$menucondensed = []; $menucondensed = [];

View File

@ -7,7 +7,7 @@ namespace Friendica\Model;
use Friendica\BaseObject; use Friendica\BaseObject;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Core\Addon; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
@ -311,7 +311,7 @@ class Event extends BaseObject
$item_id = 0; $item_id = 0;
} }
Addon::callHooks('event_updated', $event['id']); Hook::callAll('event_updated', $event['id']);
} else { } else {
$event['guid'] = defaults($arr, 'guid', System::createUUID()); $event['guid'] = defaults($arr, 'guid', System::createUUID());
@ -361,7 +361,7 @@ class Event extends BaseObject
$item_id = Item::insert($item_arr); $item_id = Item::insert($item_arr);
} }
Addon::callHooks("event_created", $event['id']); Hook::callAll("event_created", $event['id']);
} }
return $item_id; return $item_id;

View File

@ -9,8 +9,8 @@ namespace Friendica\Model;
use Friendica\BaseObject; use Friendica\BaseObject;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML; use Friendica\Content\Text\HTML;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\Lock; use Friendica\Core\Lock;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\L10n; use Friendica\Core\L10n;
@ -1608,11 +1608,11 @@ class Item extends BaseObject
if ($notify) { if ($notify) {
$item['edit'] = false; $item['edit'] = false;
$item['parent'] = $parent_id; $item['parent'] = $parent_id;
Addon::callHooks('post_local', $item); Hook::callAll('post_local', $item);
unset($item['edit']); unset($item['edit']);
unset($item['parent']); unset($item['parent']);
} else { } else {
Addon::callHooks('post_remote', $item); Hook::callAll('post_remote', $item);
} }
// This array field is used to trigger some automatic reactions // This array field is used to trigger some automatic reactions
@ -1785,9 +1785,9 @@ class Item extends BaseObject
$posted_item = self::selectFirst(self::ITEM_FIELDLIST, ['id' => $current_post]); $posted_item = self::selectFirst(self::ITEM_FIELDLIST, ['id' => $current_post]);
if (DBA::isResult($posted_item)) { if (DBA::isResult($posted_item)) {
if ($notify) { if ($notify) {
Addon::callHooks('post_local_end', $posted_item); Hook::callAll('post_local_end', $posted_item);
} else { } else {
Addon::callHooks('post_remote_end', $posted_item); Hook::callAll('post_remote_end', $posted_item);
} }
} else { } else {
Logger::log('new item not found in DB, id ' . $current_post); Logger::log('new item not found in DB, id ' . $current_post);
@ -2532,7 +2532,7 @@ class Item extends BaseObject
$arr = ['item' => $item, 'user' => $user]; $arr = ['item' => $item, 'user' => $user];
Addon::callHooks('tagged', $arr); Hook::callAll('tagged', $arr);
if (!$community_page && !$prvgroup) { if (!$community_page && !$prvgroup) {
return; return;
@ -3090,7 +3090,7 @@ class Item extends BaseObject
$new_item['id'] = $new_item_id; $new_item['id'] = $new_item_id;
Addon::callHooks('post_local_end', $new_item); Hook::callAll('post_local_end', $new_item);
return true; return true;
} }
@ -3255,7 +3255,7 @@ class Item extends BaseObject
$item["rendered-hash"] = hash("md5", $item["body"]); $item["rendered-hash"] = hash("md5", $item["body"]);
$hook_data = ['item' => $item, 'rendered-html' => $item['rendered-html'], 'rendered-hash' => $item['rendered-hash']]; $hook_data = ['item' => $item, 'rendered-html' => $item['rendered-html'], 'rendered-hash' => $item['rendered-hash']];
Addon::callHooks('put_item_in_cache', $hook_data); Hook::callAll('put_item_in_cache', $hook_data);
$item['rendered-html'] = $hook_data['rendered-html']; $item['rendered-html'] = $hook_data['rendered-html'];
$item['rendered-hash'] = $hook_data['rendered-hash']; $item['rendered-hash'] = $hook_data['rendered-hash'];
unset($hook_data); unset($hook_data);
@ -3300,7 +3300,7 @@ class Item extends BaseObject
public static function prepareBody(array &$item, $attach = false, $is_preview = false) public static function prepareBody(array &$item, $attach = false, $is_preview = false)
{ {
$a = self::getApp(); $a = self::getApp();
Addon::callHooks('prepare_body_init', $item); Hook::callAll('prepare_body_init', $item);
// In order to provide theme developers more possibilities, event items // In order to provide theme developers more possibilities, event items
// are treated differently. // are treated differently.
@ -3326,7 +3326,7 @@ class Item extends BaseObject
'item' => $item, 'item' => $item,
'filter_reasons' => $filter_reasons 'filter_reasons' => $filter_reasons
]; ];
Addon::callHooks('prepare_body_content_filter', $hook_data); Hook::callAll('prepare_body_content_filter', $hook_data);
$filter_reasons = $hook_data['filter_reasons']; $filter_reasons = $hook_data['filter_reasons'];
unset($hook_data); unset($hook_data);
} }
@ -3348,7 +3348,7 @@ class Item extends BaseObject
'preview' => $is_preview, 'preview' => $is_preview,
'filter_reasons' => $filter_reasons 'filter_reasons' => $filter_reasons
]; ];
Addon::callHooks('prepare_body', $hook_data); Hook::callAll('prepare_body', $hook_data);
$s = $hook_data['html']; $s = $hook_data['html'];
unset($hook_data); unset($hook_data);
@ -3456,7 +3456,7 @@ class Item extends BaseObject
$s = HTML::applyContentFilter($s, $filter_reasons); $s = HTML::applyContentFilter($s, $filter_reasons);
$hook_data = ['item' => $item, 'html' => $s]; $hook_data = ['item' => $item, 'html' => $s];
Addon::callHooks('prepare_body_final', $hook_data); Hook::callAll('prepare_body_final', $hook_data);
return $hook_data['html']; return $hook_data['html'];
} }

View File

@ -9,9 +9,9 @@ use Friendica\Content\Feature;
use Friendica\Content\ForumManager; use Friendica\Content\ForumManager;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML; use Friendica\Content\Text\HTML;
use Friendica\Core\Addon;
use Friendica\Core\Cache; use Friendica\Core\Cache;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
@ -300,7 +300,7 @@ class Profile
$profile['network_link'] = ''; $profile['network_link'] = '';
} }
Addon::callHooks('profile_sidebar_enter', $profile); Hook::callAll('profile_sidebar_enter', $profile);
// don't show connect link to yourself // don't show connect link to yourself
@ -548,7 +548,7 @@ class Profile
$arr = ['profile' => &$profile, 'entry' => &$o]; $arr = ['profile' => &$profile, 'entry' => &$o];
Addon::callHooks('profile_sidebar', $arr); Hook::callAll('profile_sidebar', $arr);
return $o; return $o;
} }
@ -992,7 +992,7 @@ class Profile
} }
$arr = ['is_owner' => $is_owner, 'nickname' => $nickname, 'tab' => $tab, 'tabs' => $tabs]; $arr = ['is_owner' => $is_owner, 'nickname' => $nickname, 'tab' => $tab, 'tabs' => $tabs];
Addon::callHooks('profile_tabs', $arr); Hook::callAll('profile_tabs', $arr);
$tpl = Renderer::getMarkupTemplate('common_tabs.tpl'); $tpl = Renderer::getMarkupTemplate('common_tabs.tpl');
@ -1033,7 +1033,7 @@ class Profile
} }
$arr = ['zrl' => $my_url, 'url' => $a->cmd]; $arr = ['zrl' => $my_url, 'url' => $a->cmd];
Addon::callHooks('zrl_init', $arr); Hook::callAll('zrl_init', $arr);
// Try to find the public contact entry of the visitor. // Try to find the public contact entry of the visitor.
$cid = Contact::getIdForURL($my_url); $cid = Contact::getIdForURL($my_url);
@ -1144,7 +1144,7 @@ class Profile
* * \e array \b visitor * * \e array \b visitor
* * \e string \b url * * \e string \b url
*/ */
Addon::callHooks('magic_auth_success', $arr); Hook::callAll('magic_auth_success', $arr);
$a->contact = $arr['visitor']; $a->contact = $arr['visitor'];

View File

@ -7,7 +7,6 @@ namespace Friendica\Model;
use DivineOmega\PasswordExposed; use DivineOmega\PasswordExposed;
use Exception; use Exception;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
@ -707,7 +706,7 @@ class User
} }
} }
Addon::callHooks('register_account', $uid); Hook::callAll('register_account', $uid);
$return['user'] = $user; $return['user'] = $user;
return $return; return $return;

View File

@ -10,7 +10,7 @@ use Friendica\Content\Pager;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Content\Widget; use Friendica\Content\Widget;
use Friendica\Core\ACL; use Friendica\Core\ACL;
use Friendica\Core\Addon; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
@ -194,7 +194,7 @@ class Contact extends BaseModule
return; // NOTREACHED return; // NOTREACHED
} }
Addon::callHooks('contact_edit_post', $_POST); Hook::callAll('contact_edit_post', $_POST);
$profile_id = intval(defaults($_POST, 'profile-assign', 0)); $profile_id = intval(defaults($_POST, 'profile-assign', 0));
if ($profile_id) { if ($profile_id) {
@ -659,7 +659,7 @@ class Contact extends BaseModule
$arr = ['contact' => $contact, 'output' => $o]; $arr = ['contact' => $contact, 'output' => $o];
Addon::callHooks('contact_edit', $arr); Hook::callAll('contact_edit', $arr);
return $arr['output']; return $arr['output'];
} }

View File

@ -6,9 +6,9 @@ namespace Friendica\Module;
use Exception; use Exception;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\Addon;
use Friendica\Core\Authentication; use Friendica\Core\Authentication;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
@ -131,7 +131,7 @@ class Login extends BaseModule
* Addons should never set 'authenticated' except to indicate success - as hooks may be chained * Addons should never set 'authenticated' except to indicate success - as hooks may be chained
* and later addons should not interfere with an earlier one that succeeded. * and later addons should not interfere with an earlier one that succeeded.
*/ */
Addon::callHooks('authenticate', $addon_auth); Hook::callAll('authenticate', $addon_auth);
try { try {
if ($addon_auth['authenticated']) { if ($addon_auth['authenticated']) {
@ -340,7 +340,7 @@ class Login extends BaseModule
] ]
); );
Addon::callHooks('login_hook', $o); Hook::callAll('login_hook', $o);
return $o; return $o;
} }

View File

@ -2,13 +2,13 @@
/** /**
* @file src/Module/Logout.php * @file src/Module/Logout.php
*/ */
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\Addon;
use Friendica\Core\Authentication; use Friendica\Core\Authentication;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\System;
/** /**
* Logout module * Logout module
@ -22,7 +22,7 @@ class Logout extends BaseModule
*/ */
public static function init() public static function init()
{ {
Addon::callHooks("logging_out"); Hook::callAll("logging_out");
Authentication::deleteSession(); Authentication::deleteSession();
info(L10n::t('Logged out.') . EOL); info(L10n::t('Logged out.') . EOL);
self::getApp()->internalRedirect(); self::getApp()->internalRedirect();

View File

@ -4,7 +4,7 @@
*/ */
namespace Friendica\Network; namespace Friendica\Network;
use Friendica\Core\Addon; use Friendica\Core\Hook;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\System; use Friendica\Core\System;
@ -69,6 +69,6 @@ class FKOAuth1 extends OAuthServer
DBA::update('user', ['login_date' => DateTimeFormat::utcNow()], ['uid' => $_SESSION['uid']]); DBA::update('user', ['login_date' => DateTimeFormat::utcNow()], ['uid' => $_SESSION['uid']]);
Addon::callHooks('logged_in', $a->user); Hook::callAll('logged_in', $a->user);
} }
} }

View File

@ -8,6 +8,7 @@ use Friendica\BaseObject;
use Friendica\Content\ContactSelector; use Friendica\Content\ContactSelector;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
@ -229,7 +230,7 @@ class Post extends BaseObject
} }
$locate = ['location' => $item['location'], 'coord' => $item['coord'], 'html' => '']; $locate = ['location' => $item['location'], 'coord' => $item['coord'], 'html' => ''];
Addon::callHooks('render_location', $locate); Hook::callAll('render_location', $locate);
$location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate)); $location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate));
// process action responses - e.g. like/dislike/attend/agree/whatever // process action responses - e.g. like/dislike/attend/agree/whatever
@ -433,7 +434,7 @@ class Post extends BaseObject
]; ];
$arr = ['item' => $item, 'output' => $tmp_item]; $arr = ['item' => $item, 'output' => $tmp_item];
Addon::callHooks('display_item', $arr); Hook::callAll('display_item', $arr);
$result = $arr['output']; $result = $arr['output'];

View File

@ -14,8 +14,8 @@ use Friendica\App;
use Friendica\Content\OEmbed; use Friendica\Content\OEmbed;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML; use Friendica\Content\Text\HTML;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Core\System; use Friendica\Core\System;
@ -295,12 +295,12 @@ class DFRN
$root = self::addHeader($doc, $owner, $author, $alternatelink, true); $root = self::addHeader($doc, $owner, $author, $alternatelink, true);
/// @TODO This hook can't work anymore /// @TODO This hook can't work anymore
// Addon::callHooks('atom_feed', $atom); // \Friendica\Core\Hook::callAll('atom_feed', $atom);
if (!DBA::isResult($items) || $onlyheader) { if (!DBA::isResult($items) || $onlyheader) {
$atom = trim($doc->saveXML()); $atom = trim($doc->saveXML());
Addon::callHooks('atom_feed_end', $atom); Hook::callAll('atom_feed_end', $atom);
return $atom; return $atom;
} }
@ -329,7 +329,7 @@ class DFRN
$atom = trim($doc->saveXML()); $atom = trim($doc->saveXML());
Addon::callHooks('atom_feed_end', $atom); Hook::callAll('atom_feed_end', $atom);
return $atom; return $atom;
} }

View File

@ -4,7 +4,7 @@
*/ */
namespace Friendica\Render; namespace Friendica\Render;
use Friendica\Core\Addon; use Friendica\Core\Hook;
/** /**
* Smarty implementation of the Friendica template engine interface * Smarty implementation of the Friendica template engine interface
@ -39,7 +39,7 @@ class FriendicaSmartyEngine implements ITemplateEngine
"template" => basename($s->filename), "template" => basename($s->filename),
"vars" => $r "vars" => $r
]; ];
Addon::callHooks("template_vars", $arr); Hook::callAll("template_vars", $arr);
$r = $arr['vars']; $r = $arr['vars'];
foreach ($r as $key => $value) { foreach ($r as $key => $value) {

View File

@ -4,10 +4,9 @@
*/ */
namespace Friendica\Util; namespace Friendica\Util;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Util\Strings;
use ASN_BASE; use ASN_BASE;
use ASNValue; use ASNValue;
@ -372,7 +371,7 @@ class Crypto
return $result; return $result;
} else { } else {
$x = ['data' => $data, 'pubkey' => $pubkey, 'alg' => $alg, 'result' => $data]; $x = ['data' => $data, 'pubkey' => $pubkey, 'alg' => $alg, 'result' => $data];
Addon::callHooks('other_encapsulate', $x); Hook::callAll('other_encapsulate', $x);
return $x['result']; return $x['result'];
} }
@ -455,7 +454,7 @@ class Crypto
return self::$fn(Strings::base64UrlDecode($data['data']), $k, $i); return self::$fn(Strings::base64UrlDecode($data['data']), $k, $i);
} else { } else {
$x = ['data' => $data, 'prvkey' => $prvkey, 'alg' => $alg, 'result' => $data]; $x = ['data' => $data, 'prvkey' => $prvkey, 'alg' => $alg, 'result' => $data];
Addon::callHooks('other_unencapsulate', $x); Hook::callAll('other_unencapsulate', $x);
return $x['result']; return $x['result'];
} }

View File

@ -4,8 +4,8 @@
*/ */
namespace Friendica\Util; namespace Friendica\Util;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Protocol\Email; use Friendica\Protocol\Email;
@ -33,7 +33,7 @@ class Emailer
*/ */
public static function send($params) public static function send($params)
{ {
Addon::callHooks('emailer_send_prepare', $params); Hook::callAll('emailer_send_prepare', $params);
$email_textonly = false; $email_textonly = false;
if (!empty($params['uid'])) { if (!empty($params['uid'])) {
@ -89,7 +89,7 @@ class Emailer
'parameters' => $sendmail_params 'parameters' => $sendmail_params
]; ];
Addon::callHooks("emailer_send", $hookdata); Hook::callAll("emailer_send", $hookdata);
$res = mail( $res = mail(
$hookdata['to'], $hookdata['to'],

View File

@ -4,7 +4,7 @@
*/ */
namespace Friendica\Util; namespace Friendica\Util;
use Friendica\Core\Addon; use Friendica\Core\Hook;
/** /**
* Leaflet Map related functions * Leaflet Map related functions
@ -14,19 +14,19 @@ class Map {
$coord = trim($coord); $coord = trim($coord);
$coord = str_replace([',','/',' '],[' ',' ',' '],$coord); $coord = str_replace([',','/',' '],[' ',' ',' '],$coord);
$arr = ['lat' => trim(substr($coord,0,strpos($coord,' '))), 'lon' => trim(substr($coord,strpos($coord,' ')+1)), 'mode' => $html_mode, 'html' => '']; $arr = ['lat' => trim(substr($coord,0,strpos($coord,' '))), 'lon' => trim(substr($coord,strpos($coord,' ')+1)), 'mode' => $html_mode, 'html' => ''];
Addon::callHooks('generate_map',$arr); Hook::callAll('generate_map',$arr);
return ($arr['html']) ? $arr['html'] : $coord; return ($arr['html']) ? $arr['html'] : $coord;
} }
public static function byLocation($location, $html_mode = 0) { public static function byLocation($location, $html_mode = 0) {
$arr = ['location' => $location, 'mode' => $html_mode, 'html' => '']; $arr = ['location' => $location, 'mode' => $html_mode, 'html' => ''];
Addon::callHooks('generate_named_map',$arr); Hook::callAll('generate_named_map',$arr);
return ($arr['html']) ? $arr['html'] : $location; return ($arr['html']) ? $arr['html'] : $location;
} }
public static function getCoordinates($location) { public static function getCoordinates($location) {
$arr = ['location' => $location, 'lat' => false, 'lon' => false]; $arr = ['location' => $location, 'lat' => false, 'lon' => false];
Addon::callHooks('Map::getCoordinates', $arr); Hook::callAll('Map::getCoordinates', $arr);
return $arr; return $arr;
} }
} }

View File

@ -4,12 +4,11 @@
*/ */
namespace Friendica\Util; namespace Friendica\Util;
use Friendica\Core\Addon; use Friendica\Core\Hook;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Network\CurlResult; use Friendica\Network\CurlResult;
use Friendica\Util\Strings;
use DOMDocument; use DOMDocument;
use DomXPath; use DomXPath;
@ -533,7 +532,7 @@ class Network
$avatar['url'] = ''; $avatar['url'] = '';
$avatar['success'] = false; $avatar['success'] = false;
Addon::callHooks('avatar_lookup', $avatar); Hook::callAll('avatar_lookup', $avatar);
if (! $avatar['success']) { if (! $avatar['success']) {
$avatar['url'] = System::baseUrl() . '/images/person-300.jpg'; $avatar['url'] = System::baseUrl() . '/images/person-300.jpg';

View File

@ -8,11 +8,10 @@ namespace Friendica\Util;
use DOMDocument; use DOMDocument;
use DOMXPath; use DOMXPath;
use Friendica\Content\OEmbed; use Friendica\Content\OEmbed;
use Friendica\Core\Addon; use Friendica\Core\Hook;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Object\Image; use Friendica\Object\Image;
use Friendica\Util\Strings;
/** /**
* @brief Class with methods for extracting certain content from an url * @brief Class with methods for extracting certain content from an url
@ -422,7 +421,7 @@ class ParseUrl
Logger::log('Siteinfo for ' . $url . ' ' . print_r($siteinfo, true), Logger::DEBUG); Logger::log('Siteinfo for ' . $url . ' ' . print_r($siteinfo, true), Logger::DEBUG);
Addon::callHooks('getsiteinfo', $siteinfo); Hook::callAll('getsiteinfo', $siteinfo);
return $siteinfo; return $siteinfo;
} }

View File

@ -6,8 +6,8 @@
namespace Friendica\Worker; namespace Friendica\Worker;
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Database\DBA; use Friendica\Database\DBA;
@ -32,7 +32,7 @@ class Directory
$arr = ['url' => $url]; $arr = ['url' => $url];
Addon::callHooks('globaldir_update', $arr); Hook::callAll('globaldir_update', $arr);
Logger::log('Updating directory: ' . $arr['url'], Logger::DEBUG); Logger::log('Updating directory: ' . $arr['url'], Logger::DEBUG);
if (strlen($arr['url'])) { if (strlen($arr['url'])) {

View File

@ -4,9 +4,9 @@
*/ */
namespace Friendica\Worker; namespace Friendica\Worker;
use Friendica\Core\Addon;
use Friendica\Core\Cache; use Friendica\Core\Cache;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Core\Worker; use Friendica\Core\Worker;
@ -37,7 +37,7 @@ class Queue
$r = DBA::toArray(DBA::p("SELECT `id` FROM `queue` WHERE `next` < UTC_TIMESTAMP() ORDER BY `batch`, `cid`")); $r = DBA::toArray(DBA::p("SELECT `id` FROM `queue` WHERE `next` < UTC_TIMESTAMP() ORDER BY `batch`, `cid`"));
Addon::callHooks('queue_predeliver', $r); Hook::callAll('queue_predeliver', $r);
if (DBA::isResult($r)) { if (DBA::isResult($r)) {
foreach ($r as $q_item) { foreach ($r as $q_item) {
@ -148,7 +148,7 @@ class Queue
default: default:
$params = ['owner' => $owner, 'contact' => $contact, 'queue' => $q_item, 'result' => false]; $params = ['owner' => $owner, 'contact' => $contact, 'queue' => $q_item, 'result' => false];
Addon::callHooks('queue_deliver', $params); Hook::callAll('queue_deliver', $params);
if ($params['result']) { if ($params['result']) {
QueueModel::removeItem($q_item['id']); QueueModel::removeItem($q_item['id']);