diff --git a/doc/Addons.md b/doc/Addons.md index bf139aea7f..3aee9b7384 100644 --- a/doc/Addons.md +++ b/doc/Addons.md @@ -417,281 +417,281 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep- ### index.php - Addon::callHooks('init_1'); - Addon::callHooks('app_menu', $arr); - Addon::callHooks('page_content_top', $a->page['content']); - Addon::callHooks($a->module.'_mod_init', $placeholder); - Addon::callHooks($a->module.'_mod_init', $placeholder); - Addon::callHooks($a->module.'_mod_post', $_POST); - Addon::callHooks($a->module.'_mod_afterpost', $placeholder); - Addon::callHooks($a->module.'_mod_content', $arr); - Addon::callHooks($a->module.'_mod_aftercontent', $arr); - Addon::callHooks('page_end', $a->page['content']); + Hook::callAll('init_1'); + Hook::callAll('app_menu', $arr); + Hook::callAll('page_content_top', $a->page['content']); + Hook::callAll($a->module.'_mod_init', $placeholder); + Hook::callAll($a->module.'_mod_init', $placeholder); + Hook::callAll($a->module.'_mod_post', $_POST); + Hook::callAll($a->module.'_mod_afterpost', $placeholder); + Hook::callAll($a->module.'_mod_content', $arr); + Hook::callAll($a->module.'_mod_aftercontent', $arr); + Hook::callAll('page_end', $a->page['content']); ### include/api.php - Addon::callHooks('logged_in', $a->user); - Addon::callHooks('authenticate', $addon_auth); - Addon::callHooks('logged_in', $a->user); + Hook::callAll('logged_in', $a->user); + Hook::callAll('authenticate', $addon_auth); + Hook::callAll('logged_in', $a->user); ### include/enotify.php - Addon::callHooks('enotify', $h); - Addon::callHooks('enotify_store', $datarray); - Addon::callHooks('enotify_mail', $datarray); - Addon::callHooks('check_item_notification', $notification_data); + Hook::callAll('enotify', $h); + Hook::callAll('enotify_store', $datarray); + Hook::callAll('enotify_mail', $datarray); + Hook::callAll('check_item_notification', $notification_data); ### include/conversation.php - Addon::callHooks('conversation_start', $cb); - Addon::callHooks('render_location', $locate); - Addon::callHooks('display_item', $arr); - Addon::callHooks('display_item', $arr); - Addon::callHooks('item_photo_menu', $args); - Addon::callHooks('jot_tool', $jotplugins); + Hook::callAll('conversation_start', $cb); + Hook::callAll('render_location', $locate); + Hook::callAll('display_item', $arr); + Hook::callAll('display_item', $arr); + Hook::callAll('item_photo_menu', $args); + Hook::callAll('jot_tool', $jotplugins); ### include/text.php - Addon::callHooks('contact_block_end', $arr); - Addon::callHooks('poke_verbs', $arr); - Addon::callHooks('put_item_in_cache', $hook_data); - Addon::callHooks('prepare_body_init', $item); - Addon::callHooks('prepare_body_content_filter', $hook_data); - Addon::callHooks('prepare_body', $hook_data); - Addon::callHooks('prepare_body_final', $hook_data); + Hook::callAll('contact_block_end', $arr); + Hook::callAll('poke_verbs', $arr); + Hook::callAll('put_item_in_cache', $hook_data); + Hook::callAll('prepare_body_init', $item); + Hook::callAll('prepare_body_content_filter', $hook_data); + Hook::callAll('prepare_body', $hook_data); + Hook::callAll('prepare_body_final', $hook_data); ### include/items.php - Addon::callHooks('page_info_data', $data); + Hook::callAll('page_info_data', $data); ### mod/directory.php - Addon::callHooks('directory_item', $arr); + Hook::callAll('directory_item', $arr); ### mod/xrd.php - Addon::callHooks('personal_xrd', $arr); + Hook::callAll('personal_xrd', $arr); ### mod/ping.php - Addon::callHooks('network_ping', $arr); + Hook::callAll('network_ping', $arr); ### mod/parse_url.php - Addon::callHooks("parse_link", $arr); + Hook::callAll("parse_link", $arr); ### mod/manage.php - Addon::callHooks('home_init', $ret); + Hook::callAll('home_init', $ret); ### mod/acl.php - Addon::callHooks('acl_lookup_end', $results); + Hook::callAll('acl_lookup_end', $results); ### mod/network.php - Addon::callHooks('network_content_init', $arr); - Addon::callHooks('network_tabs', $arr); + Hook::callAll('network_content_init', $arr); + Hook::callAll('network_tabs', $arr); ### mod/friendica.php - Addon::callHooks('about_hook', $o); + Hook::callAll('about_hook', $o); ### mod/subthread.php - Addon::callHooks('post_local_end', $arr); + Hook::callAll('post_local_end', $arr); ### mod/profiles.php - Addon::callHooks('profile_post', $_POST); - Addon::callHooks('profile_edit', $arr); + Hook::callAll('profile_post', $_POST); + Hook::callAll('profile_edit', $arr); ### mod/settings.php - Addon::callHooks('addon_settings_post', $_POST); - Addon::callHooks('connector_settings_post', $_POST); - Addon::callHooks('display_settings_post', $_POST); - Addon::callHooks('settings_post', $_POST); - Addon::callHooks('addon_settings', $settings_addons); - Addon::callHooks('connector_settings', $settings_connectors); - Addon::callHooks('display_settings', $o); - Addon::callHooks('settings_form', $o); + Hook::callAll('addon_settings_post', $_POST); + Hook::callAll('connector_settings_post', $_POST); + Hook::callAll('display_settings_post', $_POST); + Hook::callAll('settings_post', $_POST); + Hook::callAll('addon_settings', $settings_addons); + Hook::callAll('connector_settings', $settings_connectors); + Hook::callAll('display_settings', $o); + Hook::callAll('settings_form', $o); ### mod/photos.php - Addon::callHooks('photo_post_init', $_POST); - Addon::callHooks('photo_post_file', $ret); - Addon::callHooks('photo_post_end', $foo); - Addon::callHooks('photo_post_end', $foo); - Addon::callHooks('photo_post_end', $foo); - Addon::callHooks('photo_post_end', $foo); - Addon::callHooks('photo_post_end', intval($item_id)); - Addon::callHooks('photo_upload_form', $ret); + Hook::callAll('photo_post_init', $_POST); + Hook::callAll('photo_post_file', $ret); + Hook::callAll('photo_post_end', $foo); + Hook::callAll('photo_post_end', $foo); + Hook::callAll('photo_post_end', $foo); + Hook::callAll('photo_post_end', $foo); + Hook::callAll('photo_post_end', intval($item_id)); + Hook::callAll('photo_upload_form', $ret); ### mod/profile.php - Addon::callHooks('profile_advanced', $o); + Hook::callAll('profile_advanced', $o); ### mod/home.php - Addon::callHooks('home_init', $ret); - Addon::callHooks("home_content", $content); + Hook::callAll('home_init', $ret); + Hook::callAll("home_content", $content); ### mod/poke.php - Addon::callHooks('post_local_end', $arr); + Hook::callAll('post_local_end', $arr); ### mod/contacts.php - Addon::callHooks('contact_edit_post', $_POST); - Addon::callHooks('contact_edit', $arr); + Hook::callAll('contact_edit_post', $_POST); + Hook::callAll('contact_edit', $arr); ### mod/tagger.php - Addon::callHooks('post_local_end', $arr); + Hook::callAll('post_local_end', $arr); ### mod/lockview.php - Addon::callHooks('lockview_content', $item); + Hook::callAll('lockview_content', $item); ### mod/uexport.php - Addon::callHooks('uexport_options', $options); + Hook::callAll('uexport_options', $options); ### mod/register.php - Addon::callHooks('register_post', $arr); - Addon::callHooks('register_form', $arr); + Hook::callAll('register_post', $arr); + Hook::callAll('register_form', $arr); ### mod/item.php - Addon::callHooks('post_local_start', $_REQUEST); - Addon::callHooks('post_local', $datarray); - Addon::callHooks('post_local_end', $datarray); + Hook::callAll('post_local_start', $_REQUEST); + Hook::callAll('post_local', $datarray); + Hook::callAll('post_local_end', $datarray); ### mod/editpost.php - Addon::callHooks('jot_tool', $jotplugins); + Hook::callAll('jot_tool', $jotplugins); ### src/Network/FKOAuth1.php - Addon::callHooks('logged_in', $a->user); + Hook::callAll('logged_in', $a->user); ### src/Render/FriendicaSmartyEngine.php - Addon::callHooks("template_vars", $arr); + Hook::callAll("template_vars", $arr); ### src/App.php - Addon::callHooks('load_config'); - Addon::callHooks('head'); - Addon::callHooks('footer'); + Hook::callAll('load_config'); + Hook::callAll('head'); + Hook::callAll('footer'); ### src/Model/Item.php - Addon::callHooks('post_local', $item); - Addon::callHooks('post_remote', $item); - Addon::callHooks('post_local_end', $posted_item); - Addon::callHooks('post_remote_end', $posted_item); - Addon::callHooks('tagged', $arr); - Addon::callHooks('post_local_end', $new_item); + Hook::callAll('post_local', $item); + Hook::callAll('post_remote', $item); + Hook::callAll('post_local_end', $posted_item); + Hook::callAll('post_remote_end', $posted_item); + Hook::callAll('tagged', $arr); + Hook::callAll('post_local_end', $new_item); ### src/Model/Contact.php - Addon::callHooks('contact_photo_menu', $args); - Addon::callHooks('follow', $arr); + Hook::callAll('contact_photo_menu', $args); + Hook::callAll('follow', $arr); ### src/Model/Profile.php - Addon::callHooks('profile_sidebar_enter', $profile); - Addon::callHooks('profile_sidebar', $arr); - Addon::callHooks('profile_tabs', $arr); - Addon::callHooks('zrl_init', $arr); - Addon::callHooks('magic_auth_success', $arr); + Hook::callAll('profile_sidebar_enter', $profile); + Hook::callAll('profile_sidebar', $arr); + Hook::callAll('profile_tabs', $arr); + Hook::callAll('zrl_init', $arr); + Hook::callAll('magic_auth_success', $arr); ### src/Model/Event.php - Addon::callHooks('event_updated', $event['id']); - Addon::callHooks("event_created", $event['id']); + Hook::callAll('event_updated', $event['id']); + Hook::callAll("event_created", $event['id']); ### src/Model/User.php - Addon::callHooks('register_account', $uid); - Addon::callHooks('remove_user', $user); + Hook::callAll('register_account', $uid); + Hook::callAll('remove_user', $user); ### src/Content/Text/BBCode.php - Addon::callHooks('bbcode', $text); - Addon::callHooks('bb2diaspora', $text); + Hook::callAll('bbcode', $text); + Hook::callAll('bb2diaspora', $text); ### src/Content/Text/HTML.php - Addon::callHooks('html2bbcode', $message); + Hook::callAll('html2bbcode', $message); ### src/Content/Smilies.php - Addon::callHooks('smilie', $params); + Hook::callAll('smilie', $params); ### src/Content/Feature.php - Addon::callHooks('isEnabled', $arr); - Addon::callHooks('get', $arr); + Hook::callAll('isEnabled', $arr); + Hook::callAll('get', $arr); ### src/Content/ContactSelector.php - Addon::callHooks('network_to_name', $nets); - Addon::callHooks('gender_selector', $select); - Addon::callHooks('sexpref_selector', $select); - Addon::callHooks('marital_selector', $select); + Hook::callAll('network_to_name', $nets); + Hook::callAll('gender_selector', $select); + Hook::callAll('sexpref_selector', $select); + Hook::callAll('marital_selector', $select); ### src/Content/OEmbed.php - Addon::callHooks('oembed_fetch_url', $embedurl, $j); + Hook::callAll('oembed_fetch_url', $embedurl, $j); ### src/Content/Nav.php - Addon::callHooks('page_header', $a->page['nav']); - Addon::callHooks('nav_info', $nav); + Hook::callAll('page_header', $a->page['nav']); + Hook::callAll('nav_info', $nav); ### src/Worker/Directory.php - Addon::callHooks('globaldir_update', $arr); + Hook::callAll('globaldir_update', $arr); ### src/Worker/Notifier.php - Addon::callHooks('notifier_end', $target_item); + Hook::callAll('notifier_end', $target_item); ### src/Worker/Queue.php - Addon::callHooks('queue_predeliver', $r); - Addon::callHooks('queue_deliver', $params); + Hook::callAll('queue_predeliver', $r); + Hook::callAll('queue_deliver', $params); ### src/Module/Login.php - Addon::callHooks('authenticate', $addon_auth); - Addon::callHooks('login_hook', $o); + Hook::callAll('authenticate', $addon_auth); + Hook::callAll('login_hook', $o); ### src/Module/Logout.php - Addon::callHooks("logging_out"); + Hook::callAll("logging_out"); ### src/Object/Post.php - Addon::callHooks('render_location', $locate); - Addon::callHooks('display_item', $arr); + Hook::callAll('render_location', $locate); + Hook::callAll('display_item', $arr); ### src/Core/ACL.php - Addon::callHooks('contact_select_options', $x); - Addon::callHooks($a->module.'_pre_'.$selname, $arr); - Addon::callHooks($a->module.'_post_'.$selname, $o); - Addon::callHooks($a->module.'_pre_'.$selname, $arr); - Addon::callHooks($a->module.'_post_'.$selname, $o); - Addon::callHooks('jot_networks', $jotnets); + Hook::callAll('contact_select_options', $x); + Hook::callAll($a->module.'_pre_'.$selname, $arr); + Hook::callAll($a->module.'_post_'.$selname, $o); + Hook::callAll($a->module.'_pre_'.$selname, $arr); + Hook::callAll($a->module.'_post_'.$selname, $o); + Hook::callAll('jot_networks', $jotnets); ### src/Core/Authentication.php - Addon::callHooks('logged_in', $a->user); + Hook::callAll('logged_in', $a->user); ### 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 - Addon::callHooks("proc_run", $arr); + Hook::callAll("proc_run", $arr); ### src/Util/Emailer.php - Addon::callHooks('emailer_send_prepare', $params); - Addon::callHooks("emailer_send", $hookdata); + Hook::callAll('emailer_send_prepare', $params); + Hook::callAll("emailer_send", $hookdata); ### src/Util/Map.php - Addon::callHooks('generate_map', $arr); - Addon::callHooks('generate_named_map', $arr); - Addon::callHooks('Map::getCoordinates', $arr); + Hook::callAll('generate_map', $arr); + Hook::callAll('generate_named_map', $arr); + Hook::callAll('Map::getCoordinates', $arr); ### src/Util/Network.php - Addon::callHooks('avatar_lookup', $avatar); + Hook::callAll('avatar_lookup', $avatar); ### src/Util/ParseUrl.php - Addon::callHooks("getsiteinfo", $siteinfo); + Hook::callAll("getsiteinfo", $siteinfo); ### src/Protocol/DFRN.php - Addon::callHooks('atom_feed_end', $atom); - Addon::callHooks('atom_feed_end', $atom); + Hook::callAll('atom_feed_end', $atom); + Hook::callAll('atom_feed_end', $atom); ### view/js/main.js diff --git a/doc/de/Addons.md b/doc/de/Addons.md index eb825c0729..d63f0aa37b 100644 --- a/doc/de/Addons.md +++ b/doc/de/Addons.md @@ -193,299 +193,299 @@ Eine komplette Liste aller Hook-Callbacks mit den zugehörigen Dateien (am 01-Ap ### index.php - Addon::callHooks('init_1'); - Addon::callHooks('app_menu', $arr); - Addon::callHooks('page_content_top', $a->page['content']); - Addon::callHooks($a->module.'_mod_init', $placeholder); - Addon::callHooks($a->module.'_mod_init', $placeholder); - Addon::callHooks($a->module.'_mod_post', $_POST); - Addon::callHooks($a->module.'_mod_afterpost', $placeholder); - Addon::callHooks($a->module.'_mod_content', $arr); - Addon::callHooks($a->module.'_mod_aftercontent', $arr); - Addon::callHooks('page_end', $a->page['content']); + Hook::callAll('init_1'); + Hook::callAll('app_menu', $arr); + Hook::callAll('page_content_top', $a->page['content']); + Hook::callAll($a->module.'_mod_init', $placeholder); + Hook::callAll($a->module.'_mod_init', $placeholder); + Hook::callAll($a->module.'_mod_post', $_POST); + Hook::callAll($a->module.'_mod_afterpost', $placeholder); + Hook::callAll($a->module.'_mod_content', $arr); + Hook::callAll($a->module.'_mod_aftercontent', $arr); + Hook::callAll('page_end', $a->page['content']); ### include/api.php - Addon::callHooks('logged_in', $a->user); - Addon::callHooks('authenticate', $addon_auth); - Addon::callHooks('logged_in', $a->user); + Hook::callAll('logged_in', $a->user); + Hook::callAll('authenticate', $addon_auth); + Hook::callAll('logged_in', $a->user); ### include/enotify.php - Addon::callHooks('enotify', $h); - Addon::callHooks('enotify_store', $datarray); - Addon::callHooks('enotify_mail', $datarray); - Addon::callHooks('check_item_notification', $notification_data); + Hook::callAll('enotify', $h); + Hook::callAll('enotify_store', $datarray); + Hook::callAll('enotify_mail', $datarray); + Hook::callAll('check_item_notification', $notification_data); ### include/conversation.php - Addon::callHooks('conversation_start', $cb); - Addon::callHooks('render_location', $locate); - Addon::callHooks('display_item', $arr); - Addon::callHooks('display_item', $arr); - Addon::callHooks('item_photo_menu', $args); - Addon::callHooks('jot_tool', $jotplugins); + Hook::callAll('conversation_start', $cb); + Hook::callAll('render_location', $locate); + Hook::callAll('display_item', $arr); + Hook::callAll('display_item', $arr); + Hook::callAll('item_photo_menu', $args); + Hook::callAll('jot_tool', $jotplugins); ### include/text.php - Addon::callHooks('contact_block_end', $arr); - Addon::callHooks('poke_verbs', $arr); - Addon::callHooks('put_item_in_cache', $hook_data); - Addon::callHooks('prepare_body_init', $item); - Addon::callHooks('prepare_body_content_filter', $hook_data); - Addon::callHooks('prepare_body', $hook_data); - Addon::callHooks('prepare_body_final', $hook_data); + Hook::callAll('contact_block_end', $arr); + Hook::callAll('poke_verbs', $arr); + Hook::callAll('put_item_in_cache', $hook_data); + Hook::callAll('prepare_body_init', $item); + Hook::callAll('prepare_body_content_filter', $hook_data); + Hook::callAll('prepare_body', $hook_data); + Hook::callAll('prepare_body_final', $hook_data); ### include/items.php - Addon::callHooks('page_info_data', $data); + Hook::callAll('page_info_data', $data); ### mod/directory.php - Addon::callHooks('directory_item', $arr); + Hook::callAll('directory_item', $arr); ### mod/xrd.php - Addon::callHooks('personal_xrd', $arr); + Hook::callAll('personal_xrd', $arr); ### mod/ping.php - Addon::callHooks('network_ping', $arr); + Hook::callAll('network_ping', $arr); ### mod/parse_url.php - Addon::callHooks("parse_link", $arr); + Hook::callAll("parse_link", $arr); ### mod/manage.php - Addon::callHooks('home_init', $ret); + Hook::callAll('home_init', $ret); ### mod/acl.php - Addon::callHooks('acl_lookup_end', $results); + Hook::callAll('acl_lookup_end', $results); ### mod/network.php - Addon::callHooks('network_content_init', $arr); - Addon::callHooks('network_tabs', $arr); + Hook::callAll('network_content_init', $arr); + Hook::callAll('network_tabs', $arr); ### mod/friendica.php - Addon::callHooks('about_hook', $o); + Hook::callAll('about_hook', $o); ### mod/subthread.php - Addon::callHooks('post_local_end', $arr); + Hook::callAll('post_local_end', $arr); ### mod/profiles.php - Addon::callHooks('profile_post', $_POST); - Addon::callHooks('profile_edit', $arr); + Hook::callAll('profile_post', $_POST); + Hook::callAll('profile_edit', $arr); ### mod/settings.php - Addon::callHooks('addon_settings_post', $_POST); - Addon::callHooks('connector_settings_post', $_POST); - Addon::callHooks('display_settings_post', $_POST); - Addon::callHooks('settings_post', $_POST); - Addon::callHooks('addon_settings', $settings_addons); - Addon::callHooks('connector_settings', $settings_connectors); - Addon::callHooks('display_settings', $o); - Addon::callHooks('settings_form', $o); + Hook::callAll('addon_settings_post', $_POST); + Hook::callAll('connector_settings_post', $_POST); + Hook::callAll('display_settings_post', $_POST); + Hook::callAll('settings_post', $_POST); + Hook::callAll('addon_settings', $settings_addons); + Hook::callAll('connector_settings', $settings_connectors); + Hook::callAll('display_settings', $o); + Hook::callAll('settings_form', $o); ### mod/photos.php - Addon::callHooks('photo_post_init', $_POST); - Addon::callHooks('photo_post_file', $ret); - Addon::callHooks('photo_post_end', $foo); - Addon::callHooks('photo_post_end', $foo); - Addon::callHooks('photo_post_end', $foo); - Addon::callHooks('photo_post_end', $foo); - Addon::callHooks('photo_post_end', intval($item_id)); - Addon::callHooks('photo_upload_form', $ret); + Hook::callAll('photo_post_init', $_POST); + Hook::callAll('photo_post_file', $ret); + Hook::callAll('photo_post_end', $foo); + Hook::callAll('photo_post_end', $foo); + Hook::callAll('photo_post_end', $foo); + Hook::callAll('photo_post_end', $foo); + Hook::callAll('photo_post_end', intval($item_id)); + Hook::callAll('photo_upload_form', $ret); ### mod/profile.php - Addon::callHooks('profile_advanced', $o); + Hook::callAll('profile_advanced', $o); ### mod/home.php - Addon::callHooks('home_init', $ret); - Addon::callHooks("home_content", $content); + Hook::callAll('home_init', $ret); + Hook::callAll("home_content", $content); ### mod/poke.php - Addon::callHooks('post_local_end', $arr); + Hook::callAll('post_local_end', $arr); ### mod/contacts.php - Addon::callHooks('contact_edit_post', $_POST); - Addon::callHooks('contact_edit', $arr); + Hook::callAll('contact_edit_post', $_POST); + Hook::callAll('contact_edit', $arr); ### mod/tagger.php - Addon::callHooks('post_local_end', $arr); + Hook::callAll('post_local_end', $arr); ### mod/lockview.php - Addon::callHooks('lockview_content', $item); + Hook::callAll('lockview_content', $item); ### mod/uexport.php - Addon::callHooks('uexport_options', $options); + Hook::callAll('uexport_options', $options); ### mod/register.php - Addon::callHooks('register_post', $arr); - Addon::callHooks('register_form', $arr); + Hook::callAll('register_post', $arr); + Hook::callAll('register_form', $arr); ### mod/item.php - Addon::callHooks('post_local_start', $_REQUEST); - Addon::callHooks('post_local', $datarray); - Addon::callHooks('post_local_end', $datarray); + Hook::callAll('post_local_start', $_REQUEST); + Hook::callAll('post_local', $datarray); + Hook::callAll('post_local_end', $datarray); ### mod/editpost.php - Addon::callHooks('jot_tool', $jotplugins); + Hook::callAll('jot_tool', $jotplugins); ### src/Network/FKOAuth1.php - Addon::callHooks('logged_in', $a->user); + Hook::callAll('logged_in', $a->user); ### src/Render/FriendicaSmartyEngine.php - Addon::callHooks("template_vars", $arr); + Hook::callAll("template_vars", $arr); ### src/Model/Item.php - Addon::callHooks('post_local', $item); - Addon::callHooks('post_remote', $item); - Addon::callHooks('post_local_end', $posted_item); - Addon::callHooks('post_remote_end', $posted_item); - Addon::callHooks('tagged', $arr); - Addon::callHooks('post_local_end', $new_item); + Hook::callAll('post_local', $item); + Hook::callAll('post_remote', $item); + Hook::callAll('post_local_end', $posted_item); + Hook::callAll('post_remote_end', $posted_item); + Hook::callAll('tagged', $arr); + Hook::callAll('post_local_end', $new_item); ### src/Model/Contact.php - Addon::callHooks('contact_photo_menu', $args); - Addon::callHooks('follow', $arr); + Hook::callAll('contact_photo_menu', $args); + Hook::callAll('follow', $arr); ### src/Model/Profile.php - Addon::callHooks('profile_sidebar_enter', $profile); - Addon::callHooks('profile_sidebar', $arr); - Addon::callHooks('profile_tabs', $arr); - Addon::callHooks('zrl_init', $arr); + Hook::callAll('profile_sidebar_enter', $profile); + Hook::callAll('profile_sidebar', $arr); + Hook::callAll('profile_tabs', $arr); + Hook::callAll('zrl_init', $arr); ### src/Model/Event.php - Addon::callHooks('event_updated', $event['id']); - Addon::callHooks("event_created", $event['id']); + Hook::callAll('event_updated', $event['id']); + Hook::callAll("event_created", $event['id']); ### src/Model/User.php - Addon::callHooks('register_account', $uid); - Addon::callHooks('remove_user', $user); + Hook::callAll('register_account', $uid); + Hook::callAll('remove_user', $user); ### src/Content/Text/BBCode.php - Addon::callHooks('bbcode', $text); - Addon::callHooks('bb2diaspora', $text); + Hook::callAll('bbcode', $text); + Hook::callAll('bb2diaspora', $text); ### src/Content/Text/HTML.php - Addon::callHooks('html2bbcode', $message); + Hook::callAll('html2bbcode', $message); ### src/Content/Smilies.php - Addon::callHooks('smilie', $params); + Hook::callAll('smilie', $params); ### src/Content/Feature.php - Addon::callHooks('isEnabled', $arr); - Addon::callHooks('get', $arr); + Hook::callAll('isEnabled', $arr); + Hook::callAll('get', $arr); ### src/Content/ContactSelector.php - Addon::callHooks('network_to_name', $nets); - Addon::callHooks('gender_selector', $select); - Addon::callHooks('sexpref_selector', $select); - Addon::callHooks('marital_selector', $select); + Hook::callAll('network_to_name', $nets); + Hook::callAll('gender_selector', $select); + Hook::callAll('sexpref_selector', $select); + Hook::callAll('marital_selector', $select); ### src/Content/OEmbed.php - Addon::callHooks('oembed_fetch_url', $embedurl, $j); + Hook::callAll('oembed_fetch_url', $embedurl, $j); ### src/Content/Nav.php - Addon::callHooks('page_header', $a->page['nav']); - Addon::callHooks('nav_info', $nav); + Hook::callAll('page_header', $a->page['nav']); + Hook::callAll('nav_info', $nav); ### src/Core/Authentication.php - Addon::callHooks('logged_in', $a->user); + Hook::callAll('logged_in', $a->user); ### src/Worker/Directory.php - Addon::callHooks('globaldir_update', $arr); + Hook::callAll('globaldir_update', $arr); ### src/Worker/Notifier.php - Addon::callHooks('notifier_end', $target_item); + Hook::callAll('notifier_end', $target_item); ### src/Worker/Queue.php - Addon::callHooks('queue_predeliver', $r); - Addon::callHooks('queue_deliver', $params); + Hook::callAll('queue_predeliver', $r); + Hook::callAll('queue_deliver', $params); ### src/Module/Login.php - Addon::callHooks('authenticate', $addon_auth); - Addon::callHooks('login_hook', $o); + Hook::callAll('authenticate', $addon_auth); + Hook::callAll('login_hook', $o); ### src/Module/Logout.php - Addon::callHooks("logging_out"); + Hook::callAll("logging_out"); ### src/Object/Post.php - Addon::callHooks('render_location', $locate); - Addon::callHooks('display_item', $arr); + Hook::callAll('render_location', $locate); + Hook::callAll('display_item', $arr); ### src/Core/ACL.php - Addon::callHooks('contact_select_options', $x); - Addon::callHooks($a->module.'_pre_'.$selname, $arr); - Addon::callHooks($a->module.'_post_'.$selname, $o); - Addon::callHooks($a->module.'_pre_'.$selname, $arr); - Addon::callHooks($a->module.'_post_'.$selname, $o); - Addon::callHooks('jot_networks', $jotnets); + Hook::callAll('contact_select_options', $x); + Hook::callAll($a->module.'_pre_'.$selname, $arr); + Hook::callAll($a->module.'_post_'.$selname, $o); + Hook::callAll($a->module.'_pre_'.$selname, $arr); + Hook::callAll($a->module.'_post_'.$selname, $o); + Hook::callAll('jot_networks', $jotnets); ### src/Core/Worker.php - Addon::callHooks("proc_run", $arr); + Hook::callAll("proc_run", $arr); ### src/Util/Emailer.php - Addon::callHooks('emailer_send_prepare', $params); - Addon::callHooks("emailer_send", $hookdata); + Hook::callAll('emailer_send_prepare', $params); + Hook::callAll("emailer_send", $hookdata); ### src/Util/Map.php - Addon::callHooks('generate_map', $arr); - Addon::callHooks('generate_named_map', $arr); - Addon::callHooks('Map::getCoordinates', $arr); + Hook::callAll('generate_map', $arr); + Hook::callAll('generate_named_map', $arr); + Hook::callAll('Map::getCoordinates', $arr); ### src/Util/Network.php - Addon::callHooks('avatar_lookup', $avatar); + Hook::callAll('avatar_lookup', $avatar); ### src/Util/ParseUrl.php - Addon::callHooks("getsiteinfo", $siteinfo); + Hook::callAll("getsiteinfo", $siteinfo); ### src/Protocol/DFRN.php - Addon::callHooks('atom_feed_end', $atom); - Addon::callHooks('atom_feed_end', $atom); + Hook::callAll('atom_feed_end', $atom); + Hook::callAll('atom_feed_end', $atom); diff --git a/include/api.php b/include/api.php index 6993cb6889..f28f182532 100644 --- a/include/api.php +++ b/include/api.php @@ -11,9 +11,9 @@ use Friendica\Content\ContactSelector; use Friendica\Content\Feature; use Friendica\Content\Text\BBCode; use Friendica\Content\Text\HTML; -use Friendica\Core\Addon; use Friendica\Core\Authentication; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\NotificationsManager; @@ -174,7 +174,7 @@ function api_login(App $a) list($consumer, $token) = $oauth1->verify_request($request); if (!is_null($token)) { $oauth1->loginUser($token->uid); - Addon::callHooks('logged_in', $a->user); + Hook::callAll('logged_in', $a->user); return; } echo __FILE__.__LINE__.__FUNCTION__ . "
"; @@ -224,7 +224,7 @@ function api_login(App $a) * 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. */ - Addon::callHooks('authenticate', $addon_auth); + Hook::callAll('authenticate', $addon_auth); if ($addon_auth['authenticated'] && count($addon_auth['user_record'])) { $record = $addon_auth['user_record']; @@ -247,7 +247,7 @@ function api_login(App $a) $_SESSION["allow_api"] = true; - Addon::callHooks('logged_in', $a->user); + Hook::callAll('logged_in', $a->user); } /** diff --git a/include/conversation.php b/include/conversation.php index 1059941b9e..e15ac3f71a 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -8,8 +8,8 @@ use Friendica\Content\ContactSelector; use Friendica\Content\Feature; use Friendica\Content\Pager; use Friendica\Content\Text\BBCode; -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; 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]; - Addon::callHooks('conversation_start',$cb); + Hook::callAll('conversation_start',$cb); $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' => '']; - Addon::callHooks('render_location',$locate); + Hook::callAll('render_location',$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]; - Addon::callHooks('display_item', $arr); + Hook::callAll('display_item', $arr); $threads[$threadsid]['id'] = $item['id']; $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 $arr = ['item' => $item]; - Addon::callHooks('display_item', $arr); + Hook::callAll('display_item', $arr); $item['pagedrop'] = $page_dropping; @@ -892,7 +892,7 @@ function item_photo_menu($item) { $args = ['item' => $item, 'menu' => $menu]; - Addon::callHooks('item_photo_menu', $args); + Hook::callAll('item_photo_menu', $args); $menu = $args['menu']; @@ -1097,7 +1097,7 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false) ]); $jotplugins = ''; - Addon::callHooks('jot_tool', $jotplugins); + Hook::callAll('jot_tool', $jotplugins); // Private/public post links for the non-JS ACL form $private_post = 1; diff --git a/include/enotify.php b/include/enotify.php index 9edfaaca82..e2b5105feb 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -4,8 +4,8 @@ */ use Friendica\Content\Text\BBCode; -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Renderer; @@ -441,7 +441,7 @@ function notification($params) 'itemlink' => $itemlink ]; - Addon::callHooks('enotify', $h); + Hook::callAll('enotify', $h); $subject = $h['subject']; @@ -481,7 +481,7 @@ function notification($params) $datarray['otype'] = $params['otype']; $datarray['abort'] = false; - Addon::callHooks('enotify_store', $datarray); + Hook::callAll('enotify_store', $datarray); if ($datarray['abort']) { L10n::popLang(); @@ -584,7 +584,7 @@ function notification($params) $datarray['subject'] = $subject; $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 // always true for SYSTEM_EMAIL @@ -677,7 +677,7 @@ function check_user_notification($itemid) { */ function check_item_notification($itemid, $uid, $defaulttype = "") { $notification_data = ["uid" => $uid, "profiles" => []]; - Addon::callHooks('check_item_notification', $notification_data); + Hook::callAll('check_item_notification', $notification_data); $profiles = $notification_data["profiles"]; diff --git a/include/items.php b/include/items.php index db60519a2c..3dd405e786 100644 --- a/include/items.php +++ b/include/items.php @@ -5,8 +5,8 @@ use Friendica\BaseObject; use Friendica\Content\Feature; -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -27,7 +27,7 @@ use Friendica\Util\Temporal; require_once 'mod/share.php'; 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'])) { return ''; diff --git a/mod/acl.php b/mod/acl.php index 9f93b76a9b..fc67556739 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -5,7 +5,7 @@ use Friendica\App; use Friendica\Content\Widget; use Friendica\Core\ACL; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Core\Protocol; use Friendica\Database\DBA; @@ -305,7 +305,7 @@ function acl_content(App $a) 'search' => $search, ]; - Addon::callHooks('acl_lookup_end', $results); + Hook::callAll('acl_lookup_end', $results); $o = [ 'tot' => $results['tot'], diff --git a/mod/directory.php b/mod/directory.php index fa5ce73d4c..0a37c1dc04 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -7,8 +7,8 @@ use Friendica\App; use Friendica\Content\Nav; use Friendica\Content\Pager; use Friendica\Content\Widget; -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Renderer; use Friendica\Database\DBA; @@ -190,7 +190,7 @@ function directory_content(App $a) $arr = ['contact' => $rr, 'entry' => $entry]; - Addon::callHooks('directory_item', $arr); + Hook::callAll('directory_item', $arr); unset($profile); unset($location); diff --git a/mod/editpost.php b/mod/editpost.php index 1e53285830..bf103cf23c 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -4,7 +4,6 @@ */ use Friendica\App; use Friendica\Content\Feature; -use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\Hook; use Friendica\Core\L10n; diff --git a/mod/friendica.php b/mod/friendica.php index 4466211607..686e2e804b 100644 --- a/mod/friendica.php +++ b/mod/friendica.php @@ -6,6 +6,7 @@ use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\System; use Friendica\Database\DBA; @@ -126,7 +127,7 @@ function friendica_content(App $a) $o .= '' . PHP_EOL; } - Addon::callHooks('about_hook', $o); + Hook::callAll('about_hook', $o); return $o; } diff --git a/mod/home.php b/mod/home.php index 02ec51dc0b..8e53c24f3d 100644 --- a/mod/home.php +++ b/mod/home.php @@ -3,8 +3,8 @@ * @file mod/home.php */ use Friendica\App; -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Renderer; use Friendica\Core\System; @@ -14,7 +14,7 @@ if(! function_exists('home_init')) { function home_init(App $a) { $ret = []; - Addon::callHooks('home_init',$ret); + Hook::callAll('home_init',$ret); if (local_user() && ($a->user['nickname'])) { $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); $content = ''; - Addon::callHooks("home_content",$content); + Hook::callAll("home_content",$content); $tpl = Renderer::getMarkupTemplate('home.tpl'); diff --git a/mod/item.php b/mod/item.php index 5e6f88bac7..3d6d886eeb 100644 --- a/mod/item.php +++ b/mod/item.php @@ -19,8 +19,8 @@ use Friendica\App; use Friendica\Content\Pager; use Friendica\Content\Text\BBCode; use Friendica\Content\Text\HTML; -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Protocol; @@ -54,7 +54,7 @@ function item_post(App $a) { exit(); } - Addon::callHooks('post_local_start', $_REQUEST); + Hook::callAll('post_local_start', $_REQUEST); Logger::log('postvars ' . print_r($_REQUEST, true), Logger::DATA); @@ -679,7 +679,7 @@ function item_post(App $a) { exit(); } - Addon::callHooks('post_local',$datarray); + Hook::callAll('post_local',$datarray); if (!empty($datarray['cancel'])) { 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()) { $erecips = explode(',', $emailcc); diff --git a/mod/lockview.php b/mod/lockview.php index ef97cc91d0..35c4b04332 100644 --- a/mod/lockview.php +++ b/mod/lockview.php @@ -3,7 +3,7 @@ * @file mod/lockview.php */ use Friendica\App; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Database\DBA; use Friendica\Model\Item; @@ -40,7 +40,7 @@ function lockview_content(App $a) exit(); } - Addon::callHooks('lockview_content', $item); + Hook::callAll('lockview_content', $item); if ($item['uid'] != local_user()) { echo L10n::t('Remote privacy information not available.') . '
'; diff --git a/mod/manage.php b/mod/manage.php index 4d0b65de15..52ddfdf032 100644 --- a/mod/manage.php +++ b/mod/manage.php @@ -4,10 +4,9 @@ */ use Friendica\App; use Friendica\Core\Authentication; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Database\DBA; function manage_post(App $a) { @@ -116,7 +115,7 @@ function manage_post(App $a) { } $ret = []; - Addon::callHooks('home_init',$ret); + Hook::callAll('home_init',$ret); $a->internalRedirect('profile/' . $a->user['nickname'] ); // NOTREACHED diff --git a/mod/network.php b/mod/network.php index ef53be4715..015be2b17c 100644 --- a/mod/network.php +++ b/mod/network.php @@ -12,7 +12,6 @@ use Friendica\Content\Pager; use Friendica\Content\Widget; use Friendica\Content\Text\HTML; use Friendica\Core\ACL; -use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\Hook; 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 $arr = ['query' => $a->query_string]; - Addon::callHooks('network_content_init', $arr); + Hook::callAll('network_content_init', $arr); $flat_mode = false; @@ -1024,7 +1023,7 @@ function network_tabs(App $a) } $arr = ['tabs' => $tabs]; - Addon::callHooks('network_tabs', $arr); + Hook::callAll('network_tabs', $arr); $tpl = Renderer::getMarkupTemplate('common_tabs.tpl'); diff --git a/mod/parse_url.php b/mod/parse_url.php index 02fbfa1b7d..14ec4d42ce 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -10,7 +10,7 @@ * @see ParseUrl::getSiteinfo() for more information about scraping embeddable content */ use Friendica\App; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Util\Network; use Friendica\Util\ParseUrl; @@ -97,7 +97,7 @@ function parse_url_content(App $a) $arr = ['url' => $url, 'text' => '']; - Addon::callHooks('parse_link', $arr); + Hook::callAll('parse_link', $arr); if (strlen($arr['text'])) { echo $arr['text']; diff --git a/mod/photos.php b/mod/photos.php index aff8041a9f..3a92774654 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -9,13 +9,12 @@ use Friendica\Content\Nav; use Friendica\Content\Pager; use Friendica\Content\Text\BBCode; use Friendica\Core\ACL; -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\Core\System; -use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\Model\Contact; use Friendica\Model\Group; @@ -666,7 +665,7 @@ function photos_post(App $a) // default post action - upload a photo - Addon::callHooks('photo_post_init', $_POST); + Hook::callAll('photo_post_init', $_POST); // Determine the album to use $album = !empty($_REQUEST['album']) ? Strings::escapeTags(trim($_REQUEST['album'])) : ''; @@ -714,7 +713,7 @@ function photos_post(App $a) $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'])) { $src = $ret['src']; @@ -754,7 +753,7 @@ function photos_post(App $a) } @unlink($src); $foo = 0; - Addon::callHooks('photo_post_end', $foo); + Hook::callAll('photo_post_end', $foo); return; } @@ -770,7 +769,7 @@ function photos_post(App $a) notice(L10n::t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize)) . EOL); @unlink($src); $foo = 0; - Addon::callHooks('photo_post_end', $foo); + Hook::callAll('photo_post_end', $foo); return; } @@ -778,7 +777,7 @@ function photos_post(App $a) notice(L10n::t('Image file is empty.') . EOL); @unlink($src); $foo = 0; - Addon::callHooks('photo_post_end', $foo); + Hook::callAll('photo_post_end', $foo); return; } @@ -793,7 +792,7 @@ function photos_post(App $a) notice(L10n::t('Unable to process image.') . EOL); @unlink($src); $foo = 0; - Addon::callHooks('photo_post_end',$foo); + Hook::callAll('photo_post_end',$foo); exit(); } @@ -879,7 +878,7 @@ function photos_post(App $a) // Update the photo albums cache 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 // if they do not wish to be redirected @@ -1042,7 +1041,7 @@ function photos_content(App $a) 'addon_text' => $uploader, '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_submit = Renderer::replaceMacros(Renderer::getMarkupTemplate('photos_default_uploader_submit.tpl'), [ diff --git a/mod/ping.php b/mod/ping.php index 9d8311f1c4..872e9f935b 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -4,12 +4,11 @@ */ use Friendica\App; -use Friendica\Content\Feature; use Friendica\Content\ForumManager; use Friendica\Content\Text\BBCode; -use Friendica\Core\Addon; use Friendica\Core\Cache; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\System; @@ -129,7 +128,7 @@ function ping_init(App $a) if (DBA::isResult($items)) { $items_unseen = Item::inArray($items); $arr = ['items' => $items_unseen]; - Addon::callHooks('network_ping', $arr); + Hook::callAll('network_ping', $arr); foreach ($items_unseen as $item) { if ($item['wall']) { diff --git a/mod/poke.php b/mod/poke.php index fb1fae85d6..b8a1ba7bfd 100644 --- a/mod/poke.php +++ b/mod/poke.php @@ -14,12 +14,11 @@ */ use Friendica\App; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\Core\System; -use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\Model\Item; use Friendica\Util\Strings; @@ -129,9 +128,9 @@ function poke_init(App $a) $arr['object'] .= XML::escape('' . "\n"); $arr['object'] .= '' . "\n"; - $item_id = Item::insert($arr); + Item::insert($arr); - Addon::callHooks('post_local_end', $arr); + Hook::callAll('post_local_end', $arr); return; } @@ -143,9 +142,6 @@ function poke_content(App $a) return; } - $name = ''; - $id = ''; - if (empty($_GET['c'])) { return; } diff --git a/mod/profile.php b/mod/profile.php index 51f8ca7534..f7d665334d 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -8,10 +8,9 @@ use Friendica\Content\Nav; use Friendica\Content\Pager; use Friendica\Content\Widget; use Friendica\Core\ACL; -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; -use Friendica\Core\Logger; use Friendica\Core\PConfig; use Friendica\Core\System; use Friendica\Database\DBA; @@ -167,7 +166,7 @@ function profile_content(App $a, $update = 0) if ($tab === 'profile') { $o .= Profile::getAdvanced($a); - Addon::callHooks('profile_advanced', $o); + Hook::callAll('profile_advanced', $o); return $o; } diff --git a/mod/profiles.php b/mod/profiles.php index b30739b304..74a3d91f07 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -8,8 +8,8 @@ use Friendica\BaseModule; use Friendica\Content\ContactSelector; use Friendica\Content\Feature; use Friendica\Content\Nav; -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\Renderer; @@ -186,7 +186,7 @@ function profiles_post(App $a) { $namechanged = false; - Addon::callHooks('profile_post', $_POST); + Hook::callAll('profile_post', $_POST); 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", @@ -645,7 +645,7 @@ function profiles_content(App $a) { ]); $arr = ['profile' => $r[0], 'entry' => $o]; - Addon::callHooks('profile_edit', $arr); + Hook::callAll('profile_edit', $arr); return $o; } else { diff --git a/mod/register.php b/mod/register.php index b13ec22509..0125ae417e 100644 --- a/mod/register.php +++ b/mod/register.php @@ -6,8 +6,8 @@ use Friendica\App; use Friendica\BaseModule; use Friendica\Content\Text\BBCode; -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -26,7 +26,7 @@ function register_post(App $a) $blocked = 1; $arr = ['post' => $_POST]; - Addon::callHooks('register_post', $arr); + Hook::callAll('register_post', $arr); $max_dailies = intval(Config::get('system', 'max_daily_registrations')); if ($max_dailies) { @@ -241,7 +241,7 @@ function register_content(App $a) $arr = ['template' => $tpl]; - Addon::callHooks('register_form', $arr); + Hook::callAll('register_form', $arr); $tpl = $arr['template']; diff --git a/mod/settings.php b/mod/settings.php index 048abff731..14c0cc64d7 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -8,8 +8,8 @@ use Friendica\BaseModule; use Friendica\Content\Feature; use Friendica\Content\Nav; use Friendica\Core\ACL; -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -215,7 +215,7 @@ function settings_post(App $a) if (($a->argc > 1) && ($a->argv[1] == 'addon')) { BaseModule::checkFormSecurityTokenRedirectOnError('/settings/addon', 'settings_addon'); - Addon::callHooks('addon_settings_post', $_POST); + Hook::callAll('addon_settings_post', $_POST); return; } @@ -297,7 +297,7 @@ function settings_post(App $a) } } - Addon::callHooks('connector_settings_post', $_POST); + Hook::callAll('connector_settings_post', $_POST); return; } @@ -372,7 +372,7 @@ function settings_post(App $a) intval(local_user()) ); - Addon::callHooks('display_settings_post', $_POST); + Hook::callAll('display_settings_post', $_POST); $a->internalRedirect('settings/display'); return; // NOTREACHED } @@ -385,7 +385,7 @@ function settings_post(App $a) $a->internalRedirect('settings'); } - Addon::callHooks('settings_post', $_POST); + Hook::callAll('settings_post', $_POST); if (!empty($_POST['password']) || !empty($_POST['confirm'])) { $newpass = $_POST['password']; @@ -743,7 +743,7 @@ function settings_content(App $a) $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'); @@ -790,7 +790,7 @@ function settings_content(App $a) } $settings_connectors = ''; - Addon::callHooks('connector_settings', $settings_connectors); + Hook::callAll('connector_settings', $settings_connectors); 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'))); @@ -863,7 +863,7 @@ function settings_content(App $a) '$submit' => L10n::t('Save Settings'), ]); - Addon::callHooks('display_settings', $o); + Hook::callAll('display_settings', $o); return $o; } @@ -1262,7 +1262,7 @@ function settings_content(App $a) ]); - Addon::callHooks('settings_form', $o); + Hook::callAll('settings_form', $o); $o .= '' . "\r\n"; diff --git a/mod/subthread.php b/mod/subthread.php index 3d71673033..23ebf4fe48 100644 --- a/mod/subthread.php +++ b/mod/subthread.php @@ -3,7 +3,7 @@ * @file mod/subthread.php */ use Friendica\App; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\System; @@ -149,7 +149,7 @@ EOT; $arr['id'] = $post_id; - Addon::callHooks('post_local_end', $arr); + Hook::callAll('post_local_end', $arr); exit(); diff --git a/mod/tagger.php b/mod/tagger.php index 87895e16f8..7cb43e330c 100644 --- a/mod/tagger.php +++ b/mod/tagger.php @@ -3,7 +3,7 @@ * @file mod/tagger.php */ use Friendica\App; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\System; @@ -199,7 +199,7 @@ EOT; $arr['id'] = $post_id; - Addon::callHooks('post_local_end', $arr); + Hook::callAll('post_local_end', $arr); Worker::add(PRIORITY_HIGH, "Notifier", "tag", $post_id); diff --git a/mod/uexport.php b/mod/uexport.php index 11ed4b67ea..523e2fef85 100644 --- a/mod/uexport.php +++ b/mod/uexport.php @@ -3,7 +3,7 @@ * @file mod/uexport.php */ use Friendica\App; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Renderer; 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/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"); return Renderer::replaceMacros($tpl, [ diff --git a/mod/xrd.php b/mod/xrd.php index b470197a2e..1b3b4f3cc1 100644 --- a/mod/xrd.php +++ b/mod/xrd.php @@ -4,7 +4,7 @@ */ use Friendica\App; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\Renderer; use Friendica\Core\System; use Friendica\Database\DBA; @@ -127,7 +127,7 @@ function xrd_xml($a, $uri, $alias, $profile_url, $r) ); $arr = ['user' => $r, 'xml' => $o]; - Addon::callHooks('personal_xrd', $arr); + Hook::callAll('personal_xrd', $arr); echo $arr['xml']; exit(); diff --git a/src/App.php b/src/App.php index c41cfdc6c0..df350542ad 100644 --- a/src/App.php +++ b/src/App.php @@ -781,7 +781,7 @@ class App $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'); /* 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'); $this->page['footer'] = Core\Renderer::replaceMacros($tpl, [ @@ -1534,7 +1534,7 @@ class App } Core\Session::init(); - Core\Addon::callHooks('init_1'); + Core\Hook::callAll('init_1'); } // Exclude the backend processes from the session management @@ -1725,7 +1725,7 @@ class App $this->page['page_title'] = $this->module; $placeholder = ''; - Core\Addon::callHooks($this->module . '_mod_init', $placeholder); + Core\Hook::callAll($this->module . '_mod_init', $placeholder); call_user_func([$this->module_class, 'init']); @@ -1749,28 +1749,28 @@ class App if ($this->module_loaded) { 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']); } 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']); } if (! $this->error) { $arr = ['content' => $content]; - Core\Addon::callHooks($this->module . '_mod_content', $arr); + Core\Hook::callAll($this->module . '_mod_content', $arr); $content = $arr['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']; } } // initialise content region 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; @@ -1797,7 +1797,7 @@ class App } // 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 if ($this->module != 'install' && $this->module != 'maintenance') { diff --git a/src/Content/ContactSelector.php b/src/Content/ContactSelector.php index 6a5ee9112b..4ba579b514 100644 --- a/src/Content/ContactSelector.php +++ b/src/Content/ContactSelector.php @@ -4,10 +4,9 @@ */ namespace Friendica\Content; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Protocol; -use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\Util\Network; use Friendica\Util\Strings; @@ -96,7 +95,7 @@ class ContactSelector Protocol::PNUT => L10n::t('pnut'), ]; - Addon::callHooks('network_to_name', $nets); + Hook::callAll('network_to_name', $nets); $search = array_keys($nets); $replace = array_values($nets); @@ -141,6 +140,7 @@ class ContactSelector /** * @param string $current optional, default empty * @param string $suffix optionsl, default empty + * @return string */ public static function gender($current = "", $suffix = "") { @@ -163,7 +163,7 @@ class ContactSelector 'Undecided' => L10n::t('Undecided'), ]; - Addon::callHooks('gender_selector', $select); + Hook::callAll('gender_selector', $select); $o .= "