From c27b1cb66fd0877da0947edfdad1a62dfaf41888 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 26 Dec 2018 02:28:16 -0500 Subject: [PATCH] Replace deprecated Addon::*registerHook by Hook::*register --- .../advancedcontentfilter.php | 14 ++--- blackout/blackout.php | 6 +- blockem/blockem.php | 32 +++++----- blogger/blogger.php | 32 +++++----- buffer/buffer.php | 27 ++++----- buglink/buglink.php | 6 +- calc/calc.php | 6 +- catavatar/catavatar.php | 14 ++--- convert/convert.php | 6 +- curweather/curweather.php | 14 ++--- diaspora/diaspora.php | 30 +++++----- dwpost/dwpost.php | 22 +++---- fortunate/fortunate.php | 6 +- forumdirectory/forumdirectory.php | 6 +- fromapp/fromapp.php | 14 ++--- fromgplus/fromgplus.php | 18 +++--- geocoordinates/geocoordinates.php | 10 ++-- geonames/geonames.php | 18 +++--- gnot/gnot.php | 14 ++--- googlemaps/googlemaps.php | 7 +-- gravatar/gravatar.php | 11 ++-- group_text/group_text.php | 10 ++-- highlightjs/highlightjs.php | 10 ++-- ifttt/ifttt.php | 10 ++-- ijpost/ijpost.php | 22 +++---- impressum/impressum.php | 14 ++--- .../infiniteimprobabilitydrive.php | 6 +- irc/irc.php | 12 ++-- jappixmini/jappixmini.php | 26 ++++---- js_upload/js_upload.php | 18 +++--- krynn/krynn.php | 14 ++--- langfilter/langfilter.php | 16 ++--- ldapauth/ldapauth.php | 10 ++-- leistungsschutzrecht/leistungsschutzrecht.php | 14 ++--- libertree/libertree.php | 26 ++++---- libravatar/libravatar.php | 11 ++-- ljpost/ljpost.php | 22 +++---- mahjongg/mahjongg.php | 6 +- mailstream/mailstream.php | 32 +++++----- mastodoncustomemojis/mastodoncustomemojis.php | 26 ++++---- mathjax/mathjax.php | 20 +++---- membersince/membersince.php | 6 +- morechoice/morechoice.php | 17 +++--- morepokes/morepokes.php | 6 +- namethingy/namethingy.php | 6 +- newmemberwidget/newmemberwidget.php | 6 +- notimeline/notimeline.php | 10 ++-- nsfw/nsfw.php | 16 ++--- numfriends/numfriends.php | 10 ++-- openstreetmap/openstreetmap.php | 26 ++++---- pageheader/pageheader.php | 15 ++--- piwik/piwik.php | 10 ++-- planets/planets.php | 14 ++--- pledgie/pledgie.php | 14 ++--- public_server/public_server.php | 21 +++---- pumpio/pumpio.php | 42 ++++++------- qcomment/qcomment.php | 10 ++-- randplace/randplace.php | 14 ++--- remote_permissions/remote_permissions.php | 14 ++--- rendertime/rendertime.php | 8 +-- securemail/securemail.php | 14 ++--- showmore/showmore.php | 14 ++--- .../lang/smiley_pack_es/smiley_pack_es.php | 6 +- .../lang/smiley_pack_fr/smiley_pack_fr.php | 6 +- smiley_pack/smiley_pack.php | 6 +- smileybutton/smileybutton.php | 5 +- smilies_adult/smilies_adult.php | 6 +- sniper/sniper.php | 6 +- startpage/startpage.php | 14 ++--- statusnet/statusnet.php | 44 +++++++------- superblock/superblock.php | 22 +++---- testdrive/testdrive.php | 22 +++---- tictac/tictac.php | 5 +- tumblr/tumblr.php | 26 ++++---- twitter/twitter.php | 60 +++++++++---------- unicode_smilies/unicode_smilies.php | 6 +- viewsrc/viewsrc.php | 10 ++-- webrtc/webrtc.php | 6 +- widgets/widgets.php | 10 ++-- windowsphonepush/windowsphonepush.php | 13 ++-- wppost/wppost.php | 33 +++++----- xmpp/xmpp.php | 18 +++--- 82 files changed, 625 insertions(+), 630 deletions(-) diff --git a/advancedcontentfilter/advancedcontentfilter.php b/advancedcontentfilter/advancedcontentfilter.php index a00f2f07..6479fe8e 100644 --- a/advancedcontentfilter/advancedcontentfilter.php +++ b/advancedcontentfilter/advancedcontentfilter.php @@ -36,8 +36,8 @@ use Friendica\App; use Friendica\BaseModule; use Friendica\Content\Text\Markdown; -use Friendica\Core\Addon; use Friendica\Core\Cache; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Renderer; @@ -60,9 +60,9 @@ require_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'a function advancedcontentfilter_install() { - Addon::registerHook('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition'); - Addon::registerHook('prepare_body_content_filter', __FILE__, 'advancedcontentfilter_prepare_body_content_filter'); - Addon::registerHook('addon_settings' , __FILE__, 'advancedcontentfilter_addon_settings'); + Hook::register('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition'); + Hook::register('prepare_body_content_filter', __FILE__, 'advancedcontentfilter_prepare_body_content_filter'); + Hook::register('addon_settings' , __FILE__, 'advancedcontentfilter_addon_settings'); DBStructure::update(false, true); @@ -71,9 +71,9 @@ function advancedcontentfilter_install() function advancedcontentfilter_uninstall() { - Addon::unregisterHook('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition'); - Addon::unregisterHook('prepare_body_content_filter', __FILE__, 'advancedcontentfilter_prepare_body_content_filter'); - Addon::unregisterHook('addon_settings' , __FILE__, 'advancedcontentfilter_addon_settings'); + Hook::unregister('dbstructure_definition' , __FILE__, 'advancedcontentfilter_dbstructure_definition'); + Hook::unregister('prepare_body_content_filter', __FILE__, 'advancedcontentfilter_prepare_body_content_filter'); + Hook::unregister('addon_settings' , __FILE__, 'advancedcontentfilter_addon_settings'); } /* diff --git a/blackout/blackout.php b/blackout/blackout.php index c0e0dc59..68854200 100644 --- a/blackout/blackout.php +++ b/blackout/blackout.php @@ -50,17 +50,17 @@ */ use Friendica\Core\Config; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Renderer; function blackout_install() { - Addon::registerHook('page_header', 'addon/blackout/blackout.php', 'blackout_redirect'); + Hook::register('page_header', 'addon/blackout/blackout.php', 'blackout_redirect'); } function blackout_uninstall() { - Addon::unregisterHook('page_header', 'addon/blackout/blackout.php', 'blackout_redirect'); + Hook::unregister('page_header', 'addon/blackout/blackout.php', 'blackout_redirect'); } function blackout_redirect ($a, $b) { // if we have a logged in user, don't throw her out diff --git a/blockem/blockem.php b/blockem/blockem.php index c8b6c907..e0c0a74a 100644 --- a/blockem/blockem.php +++ b/blockem/blockem.php @@ -8,32 +8,32 @@ */ use Friendica\App; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Util\Strings; function blockem_install() { - Addon::registerHook('prepare_body_content_filter', 'addon/blockem/blockem.php', 'blockem_prepare_body_content_filter'); - Addon::registerHook('display_item' , 'addon/blockem/blockem.php', 'blockem_display_item'); - Addon::registerHook('addon_settings' , 'addon/blockem/blockem.php', 'blockem_addon_settings'); - Addon::registerHook('addon_settings_post' , 'addon/blockem/blockem.php', 'blockem_addon_settings_post'); - Addon::registerHook('conversation_start' , 'addon/blockem/blockem.php', 'blockem_conversation_start'); - Addon::registerHook('item_photo_menu' , 'addon/blockem/blockem.php', 'blockem_item_photo_menu'); - Addon::registerHook('enotify_store' , 'addon/blockem/blockem.php', 'blockem_enotify_store'); + Hook::register('prepare_body_content_filter', 'addon/blockem/blockem.php', 'blockem_prepare_body_content_filter'); + Hook::register('display_item' , 'addon/blockem/blockem.php', 'blockem_display_item'); + Hook::register('addon_settings' , 'addon/blockem/blockem.php', 'blockem_addon_settings'); + Hook::register('addon_settings_post' , 'addon/blockem/blockem.php', 'blockem_addon_settings_post'); + Hook::register('conversation_start' , 'addon/blockem/blockem.php', 'blockem_conversation_start'); + Hook::register('item_photo_menu' , 'addon/blockem/blockem.php', 'blockem_item_photo_menu'); + Hook::register('enotify_store' , 'addon/blockem/blockem.php', 'blockem_enotify_store'); } function blockem_uninstall() { - Addon::unregisterHook('prepare_body_content_filter', 'addon/blockem/blockem.php', 'blockem_prepare_body_content_filter'); - Addon::unregisterHook('prepare_body' , 'addon/blockem/blockem.php', 'blockem_prepare_body'); - Addon::unregisterHook('display_item' , 'addon/blockem/blockem.php', 'blockem_display_item'); - Addon::unregisterHook('addon_settings' , 'addon/blockem/blockem.php', 'blockem_addon_settings'); - Addon::unregisterHook('addon_settings_post' , 'addon/blockem/blockem.php', 'blockem_addon_settings_post'); - Addon::unregisterHook('conversation_start' , 'addon/blockem/blockem.php', 'blockem_conversation_start'); - Addon::unregisterHook('item_photo_menu' , 'addon/blockem/blockem.php', 'blockem_item_photo_menu'); - Addon::unregisterHook('enotify_store' , 'addon/blockem/blockem.php', 'blockem_enotify_store'); + Hook::unregister('prepare_body_content_filter', 'addon/blockem/blockem.php', 'blockem_prepare_body_content_filter'); + Hook::unregister('prepare_body' , 'addon/blockem/blockem.php', 'blockem_prepare_body'); + Hook::unregister('display_item' , 'addon/blockem/blockem.php', 'blockem_display_item'); + Hook::unregister('addon_settings' , 'addon/blockem/blockem.php', 'blockem_addon_settings'); + Hook::unregister('addon_settings_post' , 'addon/blockem/blockem.php', 'blockem_addon_settings_post'); + Hook::unregister('conversation_start' , 'addon/blockem/blockem.php', 'blockem_conversation_start'); + Hook::unregister('item_photo_menu' , 'addon/blockem/blockem.php', 'blockem_item_photo_menu'); + Hook::unregister('enotify_store' , 'addon/blockem/blockem.php', 'blockem_enotify_store'); } function blockem_addon_settings (App $a, &$s) diff --git a/blogger/blogger.php b/blogger/blogger.php index 3faba1ca..066de29e 100644 --- a/blogger/blogger.php +++ b/blogger/blogger.php @@ -8,7 +8,7 @@ use Friendica\App; use Friendica\Content\Text\BBCode; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -17,27 +17,27 @@ use Friendica\Util\XML; function blogger_install() { - Addon::registerHook('hook_fork', 'addon/blogger/blogger.php', 'blogger_hook_fork'); - Addon::registerHook('post_local', 'addon/blogger/blogger.php', 'blogger_post_local'); - Addon::registerHook('notifier_normal', 'addon/blogger/blogger.php', 'blogger_send'); - Addon::registerHook('jot_networks', 'addon/blogger/blogger.php', 'blogger_jot_nets'); - Addon::registerHook('connector_settings', 'addon/blogger/blogger.php', 'blogger_settings'); - Addon::registerHook('connector_settings_post', 'addon/blogger/blogger.php', 'blogger_settings_post'); + Hook::register('hook_fork', 'addon/blogger/blogger.php', 'blogger_hook_fork'); + Hook::register('post_local', 'addon/blogger/blogger.php', 'blogger_post_local'); + Hook::register('notifier_normal', 'addon/blogger/blogger.php', 'blogger_send'); + Hook::register('jot_networks', 'addon/blogger/blogger.php', 'blogger_jot_nets'); + Hook::register('connector_settings', 'addon/blogger/blogger.php', 'blogger_settings'); + Hook::register('connector_settings_post', 'addon/blogger/blogger.php', 'blogger_settings_post'); } function blogger_uninstall() { - Addon::unregisterHook('hook_fork', 'addon/blogger/blogger.php', 'blogger_hook_fork'); - Addon::unregisterHook('post_local', 'addon/blogger/blogger.php', 'blogger_post_local'); - Addon::unregisterHook('notifier_normal', 'addon/blogger/blogger.php', 'blogger_send'); - Addon::unregisterHook('jot_networks', 'addon/blogger/blogger.php', 'blogger_jot_nets'); - Addon::unregisterHook('connector_settings', 'addon/blogger/blogger.php', 'blogger_settings'); - Addon::unregisterHook('connector_settings_post', 'addon/blogger/blogger.php', 'blogger_settings_post'); + Hook::unregister('hook_fork', 'addon/blogger/blogger.php', 'blogger_hook_fork'); + Hook::unregister('post_local', 'addon/blogger/blogger.php', 'blogger_post_local'); + Hook::unregister('notifier_normal', 'addon/blogger/blogger.php', 'blogger_send'); + Hook::unregister('jot_networks', 'addon/blogger/blogger.php', 'blogger_jot_nets'); + Hook::unregister('connector_settings', 'addon/blogger/blogger.php', 'blogger_settings'); + Hook::unregister('connector_settings_post', 'addon/blogger/blogger.php', 'blogger_settings_post'); // obsolete - remove - Addon::unregisterHook('post_local_end', 'addon/blogger/blogger.php', 'blogger_send'); - Addon::unregisterHook('addon_settings', 'addon/blogger/blogger.php', 'blogger_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/blogger/blogger.php', 'blogger_settings_post'); + Hook::unregister('post_local_end', 'addon/blogger/blogger.php', 'blogger_send'); + Hook::unregister('addon_settings', 'addon/blogger/blogger.php', 'blogger_settings'); + Hook::unregister('addon_settings_post', 'addon/blogger/blogger.php', 'blogger_settings_post'); } diff --git a/buffer/buffer.php b/buffer/buffer.php index 385bdd5b..78e695a3 100644 --- a/buffer/buffer.php +++ b/buffer/buffer.php @@ -8,9 +8,8 @@ require 'addon/buffer/bufferapp.php'; use Friendica\App; -use Friendica\Content\Text\Plaintext; -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -23,22 +22,22 @@ use Friendica\Util\Strings; function buffer_install() { - Addon::registerHook('hook_fork', 'addon/buffer/buffer.php', 'buffer_hook_fork'); - Addon::registerHook('post_local', 'addon/buffer/buffer.php', 'buffer_post_local'); - Addon::registerHook('notifier_normal', 'addon/buffer/buffer.php', 'buffer_send'); - Addon::registerHook('jot_networks', 'addon/buffer/buffer.php', 'buffer_jot_nets'); - Addon::registerHook('connector_settings', 'addon/buffer/buffer.php', 'buffer_settings'); - Addon::registerHook('connector_settings_post', 'addon/buffer/buffer.php', 'buffer_settings_post'); + Hook::register('hook_fork', 'addon/buffer/buffer.php', 'buffer_hook_fork'); + Hook::register('post_local', 'addon/buffer/buffer.php', 'buffer_post_local'); + Hook::register('notifier_normal', 'addon/buffer/buffer.php', 'buffer_send'); + Hook::register('jot_networks', 'addon/buffer/buffer.php', 'buffer_jot_nets'); + Hook::register('connector_settings', 'addon/buffer/buffer.php', 'buffer_settings'); + Hook::register('connector_settings_post', 'addon/buffer/buffer.php', 'buffer_settings_post'); } function buffer_uninstall() { - Addon::unregisterHook('hook_fork', 'addon/buffer/buffer.php', 'buffer_hook_fork'); - Addon::unregisterHook('post_local', 'addon/buffer/buffer.php', 'buffer_post_local'); - Addon::unregisterHook('notifier_normal', 'addon/buffer/buffer.php', 'buffer_send'); - Addon::unregisterHook('jot_networks', 'addon/buffer/buffer.php', 'buffer_jot_nets'); - Addon::unregisterHook('connector_settings', 'addon/buffer/buffer.php', 'buffer_settings'); - Addon::unregisterHook('connector_settings_post', 'addon/buffer/buffer.php', 'buffer_settings_post'); + Hook::unregister('hook_fork', 'addon/buffer/buffer.php', 'buffer_hook_fork'); + Hook::unregister('post_local', 'addon/buffer/buffer.php', 'buffer_post_local'); + Hook::unregister('notifier_normal', 'addon/buffer/buffer.php', 'buffer_send'); + Hook::unregister('jot_networks', 'addon/buffer/buffer.php', 'buffer_jot_nets'); + Hook::unregister('connector_settings', 'addon/buffer/buffer.php', 'buffer_settings'); + Hook::unregister('connector_settings_post', 'addon/buffer/buffer.php', 'buffer_settings_post'); } function buffer_module() diff --git a/buglink/buglink.php b/buglink/buglink.php index 91d860cd..d8253d98 100644 --- a/buglink/buglink.php +++ b/buglink/buglink.php @@ -7,17 +7,17 @@ */ use Friendica\App; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; function buglink_install() { - Addon::registerHook('page_end', 'addon/buglink/buglink.php', 'buglink_active'); + Hook::register('page_end', 'addon/buglink/buglink.php', 'buglink_active'); } function buglink_uninstall() { - Addon::unregisterHook('page_end', 'addon/buglink/buglink.php', 'buglink_active'); + Hook::unregister('page_end', 'addon/buglink/buglink.php', 'buglink_active'); } function buglink_active(App $a, &$b) diff --git a/calc/calc.php b/calc/calc.php index 176ade85..f60682b0 100644 --- a/calc/calc.php +++ b/calc/calc.php @@ -5,14 +5,14 @@ * Version: 1.0 * Author: Mike Macgirvin */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; function calc_install() { - Addon::registerHook('app_menu', 'addon/calc/calc.php', 'calc_app_menu'); + Hook::register('app_menu', 'addon/calc/calc.php', 'calc_app_menu'); } function calc_uninstall() { - Addon::unregisterHook('app_menu', 'addon/calc/calc.php', 'calc_app_menu'); + Hook::unregister('app_menu', 'addon/calc/calc.php', 'calc_app_menu'); } diff --git a/catavatar/catavatar.php b/catavatar/catavatar.php index 77dd1812..e70449af 100644 --- a/catavatar/catavatar.php +++ b/catavatar/catavatar.php @@ -7,8 +7,8 @@ */ use Friendica\App; -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,9 +26,9 @@ define("CATAVATAR_SIZE", 256); */ function catavatar_install() { - Addon::registerHook('avatar_lookup', 'addon/catavatar/catavatar.php', 'catavatar_lookup'); - Addon::registerHook('addon_settings', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings'); - Addon::registerHook('addon_settings_post', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings_post'); + Hook::register('avatar_lookup', 'addon/catavatar/catavatar.php', 'catavatar_lookup'); + Hook::register('addon_settings', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings'); + Hook::register('addon_settings_post', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings_post'); Logger::log('registered catavatar'); } @@ -38,9 +38,9 @@ function catavatar_install() */ function catavatar_uninstall() { - Addon::unregisterHook('avatar_lookup', 'addon/catavatar/catavatar.php', 'catavatar_lookup'); - Addon::unregisterHook('addon_settings', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings_post'); + Hook::unregister('avatar_lookup', 'addon/catavatar/catavatar.php', 'catavatar_lookup'); + Hook::unregister('addon_settings', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings'); + Hook::unregister('addon_settings_post', 'addon/catavatar/catavatar.php', 'catavatar_addon_settings_post'); Logger::log('unregistered catavatar'); } diff --git a/convert/convert.php b/convert/convert.php index 1ddd2978..e9563741 100644 --- a/convert/convert.php +++ b/convert/convert.php @@ -5,14 +5,14 @@ * Version: 1.0 * Author: Mike Macgirvin */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; function convert_install() { - Addon::registerHook('app_menu', 'addon/convert/convert.php', 'convert_app_menu'); + Hook::register('app_menu', 'addon/convert/convert.php', 'convert_app_menu'); } function convert_uninstall() { - Addon::unregisterHook('app_menu', 'addon/convert/convert.php', 'convert_app_menu'); + Hook::unregister('app_menu', 'addon/convert/convert.php', 'convert_app_menu'); } function convert_app_menu($a,&$b) { diff --git a/curweather/curweather.php b/curweather/curweather.php index 9d4d42e7..4c24007c 100644 --- a/curweather/curweather.php +++ b/curweather/curweather.php @@ -12,9 +12,9 @@ require_once 'include/text.php'; use Friendica\App; -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\Renderer; @@ -23,16 +23,16 @@ use Friendica\Util\Proxy as ProxyUtils; function curweather_install() { - Addon::registerHook('network_mod_init' , 'addon/curweather/curweather.php', 'curweather_network_mod_init'); - Addon::registerHook('addon_settings' , 'addon/curweather/curweather.php', 'curweather_addon_settings'); - Addon::registerHook('addon_settings_post', 'addon/curweather/curweather.php', 'curweather_addon_settings_post'); + Hook::register('network_mod_init' , 'addon/curweather/curweather.php', 'curweather_network_mod_init'); + Hook::register('addon_settings' , 'addon/curweather/curweather.php', 'curweather_addon_settings'); + Hook::register('addon_settings_post', 'addon/curweather/curweather.php', 'curweather_addon_settings_post'); } function curweather_uninstall() { - Addon::unregisterHook('network_mod_init' , 'addon/curweather/curweather.php', 'curweather_network_mod_init'); - Addon::unregisterHook('addon_settings' , 'addon/curweather/curweather.php', 'curweather_addon_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/curweather/curweather.php', 'curweather_addon_settings_post'); + Hook::unregister('network_mod_init' , 'addon/curweather/curweather.php', 'curweather_network_mod_init'); + Hook::unregister('addon_settings' , 'addon/curweather/curweather.php', 'curweather_addon_settings'); + Hook::unregister('addon_settings_post', 'addon/curweather/curweather.php', 'curweather_addon_settings_post'); } // get the weather data from OpenWeatherMap diff --git a/diaspora/diaspora.php b/diaspora/diaspora.php index b36b2774..75256fff 100644 --- a/diaspora/diaspora.php +++ b/diaspora/diaspora.php @@ -11,7 +11,7 @@ require_once 'addon/diaspora/Diaspora_Connection.php'; use Friendica\App; use Friendica\Content\Text\BBCode; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -21,24 +21,24 @@ use Friendica\Model\Queue; function diaspora_install() { - Addon::registerHook('hook_fork', 'addon/diaspora/diaspora.php', 'diaspora_hook_fork'); - Addon::registerHook('post_local', 'addon/diaspora/diaspora.php', 'diaspora_post_local'); - Addon::registerHook('notifier_normal', 'addon/diaspora/diaspora.php', 'diaspora_send'); - Addon::registerHook('jot_networks', 'addon/diaspora/diaspora.php', 'diaspora_jot_nets'); - Addon::registerHook('connector_settings', 'addon/diaspora/diaspora.php', 'diaspora_settings'); - Addon::registerHook('connector_settings_post', 'addon/diaspora/diaspora.php', 'diaspora_settings_post'); - Addon::registerHook('queue_predeliver', 'addon/diaspora/diaspora.php', 'diaspora_queue_hook'); + Hook::register('hook_fork', 'addon/diaspora/diaspora.php', 'diaspora_hook_fork'); + Hook::register('post_local', 'addon/diaspora/diaspora.php', 'diaspora_post_local'); + Hook::register('notifier_normal', 'addon/diaspora/diaspora.php', 'diaspora_send'); + Hook::register('jot_networks', 'addon/diaspora/diaspora.php', 'diaspora_jot_nets'); + Hook::register('connector_settings', 'addon/diaspora/diaspora.php', 'diaspora_settings'); + Hook::register('connector_settings_post', 'addon/diaspora/diaspora.php', 'diaspora_settings_post'); + Hook::register('queue_predeliver', 'addon/diaspora/diaspora.php', 'diaspora_queue_hook'); } function diaspora_uninstall() { - Addon::unregisterHook('hook_fork', 'addon/diaspora/diaspora.php', 'diaspora_hook_fork'); - Addon::unregisterHook('post_local', 'addon/diaspora/diaspora.php', 'diaspora_post_local'); - Addon::unregisterHook('notifier_normal', 'addon/diaspora/diaspora.php', 'diaspora_send'); - Addon::unregisterHook('jot_networks', 'addon/diaspora/diaspora.php', 'diaspora_jot_nets'); - Addon::unregisterHook('connector_settings', 'addon/diaspora/diaspora.php', 'diaspora_settings'); - Addon::unregisterHook('connector_settings_post', 'addon/diaspora/diaspora.php', 'diaspora_settings_post'); - Addon::unregisterHook('queue_predeliver', 'addon/diaspora/diaspora.php', 'diaspora_queue_hook'); + Hook::unregister('hook_fork', 'addon/diaspora/diaspora.php', 'diaspora_hook_fork'); + Hook::unregister('post_local', 'addon/diaspora/diaspora.php', 'diaspora_post_local'); + Hook::unregister('notifier_normal', 'addon/diaspora/diaspora.php', 'diaspora_send'); + Hook::unregister('jot_networks', 'addon/diaspora/diaspora.php', 'diaspora_jot_nets'); + Hook::unregister('connector_settings', 'addon/diaspora/diaspora.php', 'diaspora_settings'); + Hook::unregister('connector_settings_post', 'addon/diaspora/diaspora.php', 'diaspora_settings_post'); + Hook::unregister('queue_predeliver', 'addon/diaspora/diaspora.php', 'diaspora_queue_hook'); } function diaspora_jot_nets(App $a, &$b) diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index cceb3ca0..1fdf003d 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -10,7 +10,7 @@ use Friendica\App; use Friendica\Content\Text\BBCode; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -21,20 +21,20 @@ use Friendica\Util\XML; function dwpost_install() { - Addon::registerHook('post_local', 'addon/dwpost/dwpost.php', 'dwpost_post_local'); - Addon::registerHook('notifier_normal', 'addon/dwpost/dwpost.php', 'dwpost_send'); - Addon::registerHook('jot_networks', 'addon/dwpost/dwpost.php', 'dwpost_jot_nets'); - Addon::registerHook('connector_settings', 'addon/dwpost/dwpost.php', 'dwpost_settings'); - Addon::registerHook('connector_settings_post', 'addon/dwpost/dwpost.php', 'dwpost_settings_post'); + Hook::register('post_local', 'addon/dwpost/dwpost.php', 'dwpost_post_local'); + Hook::register('notifier_normal', 'addon/dwpost/dwpost.php', 'dwpost_send'); + Hook::register('jot_networks', 'addon/dwpost/dwpost.php', 'dwpost_jot_nets'); + Hook::register('connector_settings', 'addon/dwpost/dwpost.php', 'dwpost_settings'); + Hook::register('connector_settings_post', 'addon/dwpost/dwpost.php', 'dwpost_settings_post'); } function dwpost_uninstall() { - Addon::unregisterHook('post_local', 'addon/dwpost/dwpost.php', 'dwpost_post_local'); - Addon::unregisterHook('notifier_normal', 'addon/dwpost/dwpost.php', 'dwpost_send'); - Addon::unregisterHook('jot_networks', 'addon/dwpost/dwpost.php', 'dwpost_jot_nets'); - Addon::unregisterHook('connector_settings', 'addon/dwpost/dwpost.php', 'dwpost_settings'); - Addon::unregisterHook('connector_settings_post', 'addon/dwpost/dwpost.php', 'dwpost_settings_post'); + Hook::unregister('post_local', 'addon/dwpost/dwpost.php', 'dwpost_post_local'); + Hook::unregister('notifier_normal', 'addon/dwpost/dwpost.php', 'dwpost_send'); + Hook::unregister('jot_networks', 'addon/dwpost/dwpost.php', 'dwpost_jot_nets'); + Hook::unregister('connector_settings', 'addon/dwpost/dwpost.php', 'dwpost_settings'); + Hook::unregister('connector_settings_post', 'addon/dwpost/dwpost.php', 'dwpost_settings_post'); } function dwpost_jot_nets(App $a, &$b) diff --git a/fortunate/fortunate.php b/fortunate/fortunate.php index b92f6085..939cbb4b 100644 --- a/fortunate/fortunate.php +++ b/fortunate/fortunate.php @@ -6,7 +6,7 @@ * Author: Mike Macgirvin * Status: Unsupported */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Util\Network; // IMPORTANT: SET THIS to your fortunate server @@ -15,7 +15,7 @@ define('FORTUNATE_SERVER', 'hostname.com'); function fortunate_install() { - Addon::registerHook('page_end', 'addon/fortunate/fortunate.php', 'fortunate_fetch'); + Hook::register('page_end', 'addon/fortunate/fortunate.php', 'fortunate_fetch'); if (FORTUNATE_SERVER == 'hostname.com' && is_site_admin()) { notice('Fortunate addon requires configuration. See README'); } @@ -23,7 +23,7 @@ function fortunate_install() function fortunate_uninstall() { - Addon::unregisterHook('page_end', 'addon/fortunate/fortunate.php', 'fortunate_fetch'); + Hook::unregister('page_end', 'addon/fortunate/fortunate.php', 'fortunate_fetch'); } diff --git a/forumdirectory/forumdirectory.php b/forumdirectory/forumdirectory.php index 0e2f0fe3..c07f072c 100644 --- a/forumdirectory/forumdirectory.php +++ b/forumdirectory/forumdirectory.php @@ -10,8 +10,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; @@ -26,12 +26,12 @@ require_once 'include/text.php'; function forumdirectory_install() { - Addon::registerHook('app_menu', 'addon/forumdirectory/forumdirectory.php', 'forumdirectory_app_menu'); + Hook::register('app_menu', 'addon/forumdirectory/forumdirectory.php', 'forumdirectory_app_menu'); } function forumdirectory_uninstall() { - Addon::unregisterHook('app_menu', 'addon/forumdirectory/forumdirectory.php', 'forumdirectory_app_menu'); + Hook::unregister('app_menu', 'addon/forumdirectory/forumdirectory.php', 'forumdirectory_app_menu'); } function forumdirectory_module() diff --git a/fromapp/fromapp.php b/fromapp/fromapp.php index e0ede735..bbef3d9a 100644 --- a/fromapp/fromapp.php +++ b/fromapp/fromapp.php @@ -6,25 +6,25 @@ * Author: Commander Zot * */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; function fromapp_install() { - Addon::registerHook('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook'); - Addon::registerHook('addon_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings'); - Addon::registerHook('addon_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post'); + Hook::register('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook'); + Hook::register('addon_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings'); + Hook::register('addon_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post'); Logger::log("installed fromapp"); } function fromapp_uninstall() { - Addon::unregisterHook('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook'); - Addon::unregisterHook('addon_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post'); + Hook::unregister('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook'); + Hook::unregister('addon_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings'); + Hook::unregister('addon_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post'); Logger::log("removed fromapp"); } diff --git a/fromgplus/fromgplus.php b/fromgplus/fromgplus.php index 35f90ac0..28cb7602 100644 --- a/fromgplus/fromgplus.php +++ b/fromgplus/fromgplus.php @@ -9,8 +9,8 @@ define('FROMGPLUS_DEFAULT_POLL_INTERVAL', 30); // given in minutes -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,19 +26,19 @@ require_once 'mod/parse_url.php'; require_once 'include/text.php'; function fromgplus_install() { - Addon::registerHook('connector_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings'); - Addon::registerHook('connector_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post'); - Addon::registerHook('cron', 'addon/fromgplus/fromgplus.php', 'fromgplus_cron'); + Hook::register('connector_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings'); + Hook::register('connector_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post'); + Hook::register('cron', 'addon/fromgplus/fromgplus.php', 'fromgplus_cron'); } function fromgplus_uninstall() { - Addon::unregisterHook('connector_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings'); - Addon::unregisterHook('connector_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post'); - Addon::unregisterHook('cron', 'addon/fromgplus/fromgplus.php', 'fromgplus_cron'); + Hook::unregister('connector_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings'); + Hook::unregister('connector_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post'); + Hook::unregister('cron', 'addon/fromgplus/fromgplus.php', 'fromgplus_cron'); // Old hooks - Addon::unregisterHook('addon_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post'); + Hook::unregister('addon_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings'); + Hook::unregister('addon_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post'); } function fromgplus_addon_settings(&$a,&$s) { diff --git a/geocoordinates/geocoordinates.php b/geocoordinates/geocoordinates.php index abb33abb..77bfa8e6 100644 --- a/geocoordinates/geocoordinates.php +++ b/geocoordinates/geocoordinates.php @@ -5,9 +5,9 @@ * Version: 0.1 * Author: Michael Vogel */ -use Friendica\Core\Addon; use Friendica\Core\Cache; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Renderer; @@ -16,15 +16,15 @@ use Friendica\Util\Strings; function geocoordinates_install() { - Addon::registerHook('post_local', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook'); - Addon::registerHook('post_remote', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook'); + Hook::register('post_local', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook'); + Hook::register('post_remote', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook'); } function geocoordinates_uninstall() { - Addon::unregisterHook('post_local', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook'); - Addon::unregisterHook('post_remote', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook'); + Hook::unregister('post_local', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook'); + Hook::unregister('post_remote', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook'); } function geocoordinates_resolve_item(&$item) diff --git a/geonames/geonames.php b/geonames/geonames.php index 91a466fc..7023336b 100644 --- a/geonames/geonames.php +++ b/geonames/geonames.php @@ -21,8 +21,8 @@ * system will call the name_uninstall() function. * */ -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -31,7 +31,7 @@ use Friendica\Util\XML; function geonames_install() { - Addon::registerHook('load_config', 'addon/geonames/geonames.php', 'geonames_load_config'); + Hook::register('load_config', 'addon/geonames/geonames.php', 'geonames_load_config'); /** * @@ -40,7 +40,7 @@ function geonames_install() { * */ - Addon::registerHook('post_local', 'addon/geonames/geonames.php', 'geonames_post_hook'); + Hook::register('post_local', 'addon/geonames/geonames.php', 'geonames_post_hook'); /** * @@ -50,8 +50,8 @@ function geonames_install() { * */ - Addon::registerHook('addon_settings', 'addon/geonames/geonames.php', 'geonames_addon_admin'); - Addon::registerHook('addon_settings_post', 'addon/geonames/geonames.php', 'geonames_addon_admin_post'); + Hook::register('addon_settings', 'addon/geonames/geonames.php', 'geonames_addon_admin'); + Hook::register('addon_settings_post', 'addon/geonames/geonames.php', 'geonames_addon_admin_post'); Logger::log("installed geonames"); } @@ -67,10 +67,10 @@ function geonames_uninstall() { * */ - Addon::unregisterHook('load_config', 'addon/geonames/geonames.php', 'geonames_load_config'); - Addon::unregisterHook('post_local', 'addon/geonames/geonames.php', 'geonames_post_hook'); - Addon::unregisterHook('addon_settings', 'addon/geonames/geonames.php', 'geonames_addon_admin'); - Addon::unregisterHook('addon_settings_post', 'addon/geonames/geonames.php', 'geonames_addon_admin_post'); + Hook::unregister('load_config', 'addon/geonames/geonames.php', 'geonames_load_config'); + Hook::unregister('post_local', 'addon/geonames/geonames.php', 'geonames_post_hook'); + Hook::unregister('addon_settings', 'addon/geonames/geonames.php', 'geonames_addon_admin'); + Hook::unregister('addon_settings_post', 'addon/geonames/geonames.php', 'geonames_addon_admin_post'); Logger::log("removed geonames"); diff --git a/gnot/gnot.php b/gnot/gnot.php index f3a50705..7adf045f 100644 --- a/gnot/gnot.php +++ b/gnot/gnot.php @@ -7,16 +7,16 @@ * * */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; function gnot_install() { - Addon::registerHook('addon_settings', 'addon/gnot/gnot.php', 'gnot_settings'); - Addon::registerHook('addon_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post'); - Addon::registerHook('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail'); + Hook::register('addon_settings', 'addon/gnot/gnot.php', 'gnot_settings'); + Hook::register('addon_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post'); + Hook::register('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail'); Logger::log("installed gnot"); } @@ -24,9 +24,9 @@ function gnot_install() { function gnot_uninstall() { - Addon::unregisterHook('addon_settings', 'addon/gnot/gnot.php', 'gnot_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post'); - Addon::unregisterHook('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail'); + Hook::unregister('addon_settings', 'addon/gnot/gnot.php', 'gnot_settings'); + Hook::unregister('addon_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post'); + Hook::unregister('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail'); Logger::log("removed gnot"); diff --git a/googlemaps/googlemaps.php b/googlemaps/googlemaps.php index f9aeefd8..09a566e8 100644 --- a/googlemaps/googlemaps.php +++ b/googlemaps/googlemaps.php @@ -6,20 +6,19 @@ * Author: Michael Vogel * */ -use Friendica\Core\Addon; -use Friendica\Core\Cache; +use Friendica\Core\Hook; use Friendica\Core\Logger; function googlemaps_install() { - Addon::registerHook('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location'); + Hook::register('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location'); Logger::log("installed googlemaps"); } function googlemaps_uninstall() { - Addon::unregisterHook('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location'); + Hook::unregister('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location'); Logger::log("removed googlemaps"); } diff --git a/gravatar/gravatar.php b/gravatar/gravatar.php index fea06270..70e81448 100644 --- a/gravatar/gravatar.php +++ b/gravatar/gravatar.php @@ -8,21 +8,20 @@ use Friendica\App; use Friendica\BaseModule; -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\Database\DBA; -use Friendica\Util\Security; use Friendica\Util\Strings; /** * Installs the addon hook */ function gravatar_install() { - Addon::registerHook('load_config', 'addon/gravatar/gravatar.php', 'gravatar_load_config'); - Addon::registerHook('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup'); + Hook::register('load_config', 'addon/gravatar/gravatar.php', 'gravatar_load_config'); + Hook::register('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup'); Logger::log("registered gravatar in avatar_lookup hook"); } @@ -31,8 +30,8 @@ function gravatar_install() { * Removes the addon hook */ function gravatar_uninstall() { - Addon::unregisterHook('load_config', 'addon/gravatar/gravatar.php', 'gravatar_load_config'); - Addon::unregisterHook('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup'); + Hook::unregister('load_config', 'addon/gravatar/gravatar.php', 'gravatar_load_config'); + Hook::unregister('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup'); Logger::log("unregistered gravatar in avatar_lookup hook"); } diff --git a/group_text/group_text.php b/group_text/group_text.php index cf56dbec..47768df2 100644 --- a/group_text/group_text.php +++ b/group_text/group_text.php @@ -5,15 +5,15 @@ * Version: 1.0 * Author: Thomas Willingham */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; function group_text_install() { - Addon::registerHook('addon_settings', 'addon/group_text/group_text.php', 'group_text_settings'); - Addon::registerHook('addon_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post'); + Hook::register('addon_settings', 'addon/group_text/group_text.php', 'group_text_settings'); + Hook::register('addon_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post'); Logger::log("installed group_text"); } @@ -21,8 +21,8 @@ function group_text_install() { function group_text_uninstall() { - Addon::unregisterHook('addon_settings', 'addon/group_text/group_text.php', 'group_text_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post'); + Hook::unregister('addon_settings', 'addon/group_text/group_text.php', 'group_text_settings'); + Hook::unregister('addon_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post'); Logger::log("removed group_text"); diff --git a/highlightjs/highlightjs.php b/highlightjs/highlightjs.php index 8d05453b..258cb4ad 100644 --- a/highlightjs/highlightjs.php +++ b/highlightjs/highlightjs.php @@ -7,18 +7,18 @@ */ use Friendica\App; -use Friendica\Core\Addon; +use Friendica\Core\Hook; function highlightjs_install() { - Addon::registerHook('head' , __FILE__, 'highlightjs_head'); - Addon::registerHook('footer', __FILE__, 'highlightjs_footer'); + Hook::register('head' , __FILE__, 'highlightjs_head'); + Hook::register('footer', __FILE__, 'highlightjs_footer'); } function highlightjs_uninstall() { - Addon::unregisterHook('head' , __FILE__, 'highlightjs_head'); - Addon::unregisterHook('footer', __FILE__, 'highlightjs_footer'); + Hook::unregister('head' , __FILE__, 'highlightjs_head'); + Hook::unregister('footer', __FILE__, 'highlightjs_footer'); } function highlightjs_head(App $a, &$b) diff --git a/ifttt/ifttt.php b/ifttt/ifttt.php index 50fa119c..a1891499 100644 --- a/ifttt/ifttt.php +++ b/ifttt/ifttt.php @@ -11,7 +11,7 @@ require_once 'include/items.php'; require_once 'include/text.php'; use Friendica\App; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -22,14 +22,14 @@ use Friendica\Util\Strings; function ifttt_install() { - Addon::registerHook('connector_settings', 'addon/ifttt/ifttt.php', 'ifttt_settings'); - Addon::registerHook('connector_settings_post', 'addon/ifttt/ifttt.php', 'ifttt_settings_post'); + Hook::register('connector_settings', 'addon/ifttt/ifttt.php', 'ifttt_settings'); + Hook::register('connector_settings_post', 'addon/ifttt/ifttt.php', 'ifttt_settings_post'); } function ifttt_uninstall() { - Addon::unregisterHook('connector_settings', 'addon/ifttt/ifttt.php', 'ifttt_settings'); - Addon::unregisterHook('connector_settings_post', 'addon/ifttt/ifttt.php', 'ifttt_settings_post'); + Hook::unregister('connector_settings', 'addon/ifttt/ifttt.php', 'ifttt_settings'); + Hook::unregister('connector_settings_post', 'addon/ifttt/ifttt.php', 'ifttt_settings_post'); } function ifttt_module() diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index dcb8f4bf..b3ae2ed9 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -9,7 +9,7 @@ */ use Friendica\Content\Text\BBCode; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -19,20 +19,20 @@ use Friendica\Util\XML; function ijpost_install() { - Addon::registerHook('post_local', 'addon/ijpost/ijpost.php', 'ijpost_post_local'); - Addon::registerHook('notifier_normal', 'addon/ijpost/ijpost.php', 'ijpost_send'); - Addon::registerHook('jot_networks', 'addon/ijpost/ijpost.php', 'ijpost_jot_nets'); - Addon::registerHook('connector_settings', 'addon/ijpost/ijpost.php', 'ijpost_settings'); - Addon::registerHook('connector_settings_post', 'addon/ijpost/ijpost.php', 'ijpost_settings_post'); + Hook::register('post_local', 'addon/ijpost/ijpost.php', 'ijpost_post_local'); + Hook::register('notifier_normal', 'addon/ijpost/ijpost.php', 'ijpost_send'); + Hook::register('jot_networks', 'addon/ijpost/ijpost.php', 'ijpost_jot_nets'); + Hook::register('connector_settings', 'addon/ijpost/ijpost.php', 'ijpost_settings'); + Hook::register('connector_settings_post', 'addon/ijpost/ijpost.php', 'ijpost_settings_post'); } function ijpost_uninstall() { - Addon::unregisterHook('post_local', 'addon/ijpost/ijpost.php', 'ijpost_post_local'); - Addon::unregisterHook('notifier_normal', 'addon/ijpost/ijpost.php', 'ijpost_send'); - Addon::unregisterHook('jot_networks', 'addon/ijpost/ijpost.php', 'ijpost_jot_nets'); - Addon::unregisterHook('connector_settings', 'addon/ijpost/ijpost.php', 'ijpost_settings'); - Addon::unregisterHook('connector_settings_post', 'addon/ijpost/ijpost.php', 'ijpost_settings_post'); + Hook::unregister('post_local', 'addon/ijpost/ijpost.php', 'ijpost_post_local'); + Hook::unregister('notifier_normal', 'addon/ijpost/ijpost.php', 'ijpost_send'); + Hook::unregister('jot_networks', 'addon/ijpost/ijpost.php', 'ijpost_jot_nets'); + Hook::unregister('connector_settings', 'addon/ijpost/ijpost.php', 'ijpost_settings'); + Hook::unregister('connector_settings_post', 'addon/ijpost/ijpost.php', 'ijpost_settings_post'); } function ijpost_jot_nets(&$a, &$b) diff --git a/impressum/impressum.php b/impressum/impressum.php index c5a1c98d..b68c0e2e 100644 --- a/impressum/impressum.php +++ b/impressum/impressum.php @@ -8,8 +8,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; @@ -17,16 +17,16 @@ use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\Strings; function impressum_install() { - Addon::registerHook('load_config', 'addon/impressum/impressum.php', 'impressum_load_config'); - Addon::registerHook('about_hook', 'addon/impressum/impressum.php', 'impressum_show'); - Addon::registerHook('page_end', 'addon/impressum/impressum.php', 'impressum_footer'); + Hook::register('load_config', 'addon/impressum/impressum.php', 'impressum_load_config'); + Hook::register('about_hook', 'addon/impressum/impressum.php', 'impressum_show'); + Hook::register('page_end', 'addon/impressum/impressum.php', 'impressum_footer'); Logger::log("installed impressum Addon"); } function impressum_uninstall() { - Addon::unregisterHook('load_config', 'addon/impressum/impressum.php', 'impressum_load_config'); - Addon::unregisterHook('about_hook', 'addon/impressum/impressum.php', 'impressum_show'); - Addon::unregisterHook('page_end', 'addon/impressum/impressum.php', 'impressum_footer'); + Hook::unregister('load_config', 'addon/impressum/impressum.php', 'impressum_load_config'); + Hook::unregister('about_hook', 'addon/impressum/impressum.php', 'impressum_show'); + Hook::unregister('page_end', 'addon/impressum/impressum.php', 'impressum_footer'); Logger::log("uninstalled impressum Addon"); } diff --git a/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php b/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php index 3106a2fe..a71fe651 100644 --- a/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php +++ b/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php @@ -5,17 +5,17 @@ * Version: 1.0 * Author: Thomas Willingham */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; function infiniteimprobabilitydrive_install() { - Addon::registerHook('app_menu', 'addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php', 'infiniteimprobabilitydrive_app_menu'); + Hook::register('app_menu', 'addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php', 'infiniteimprobabilitydrive_app_menu'); } function infiniteimprobabilitydrive_uninstall() { - Addon::unregisterHook('app_menu', 'addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php', 'infiniteimprobabilitydrive_app_menu'); + Hook::unregister('app_menu', 'addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php', 'infiniteimprobabilitydrive_app_menu'); } function infiniteimprobabilitydrive_app_menu($a, &$b) diff --git a/irc/irc.php b/irc/irc.php index 2677dc75..eab755c8 100644 --- a/irc/irc.php +++ b/irc/irc.php @@ -6,21 +6,21 @@ * Author: tony baldwin * Author: Tobias Diekershoff */ -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\Renderer; function irc_install() { - Addon::registerHook('app_menu', 'addon/irc/irc.php', 'irc_app_menu'); - Addon::registerHook('addon_settings', 'addon/irc/irc.php', 'irc_addon_settings'); - Addon::registerHook('addon_settings_post', 'addon/irc/irc.php', 'irc_addon_settings_post'); + Hook::register('app_menu', 'addon/irc/irc.php', 'irc_app_menu'); + Hook::register('addon_settings', 'addon/irc/irc.php', 'irc_addon_settings'); + Hook::register('addon_settings_post', 'addon/irc/irc.php', 'irc_addon_settings_post'); } function irc_uninstall() { - Addon::unregisterHook('app_menu', 'addon/irc/irc.php', 'irc_app_menu'); - Addon::unregisterHook('addon_settings', 'addon/irc/irc.php', 'irc_addon_settings'); + Hook::unregister('app_menu', 'addon/irc/irc.php', 'irc_app_menu'); + Hook::unregister('addon_settings', 'addon/irc/irc.php', 'irc_addon_settings'); } diff --git a/jappixmini/jappixmini.php b/jappixmini/jappixmini.php index 45305565..13e0cf42 100644 --- a/jappixmini/jappixmini.php +++ b/jappixmini/jappixmini.php @@ -63,8 +63,8 @@ */ use Friendica\App; -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -75,16 +75,16 @@ use Friendica\Util\Network; function jappixmini_install() { - Addon::registerHook('addon_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings'); - Addon::registerHook('addon_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post'); + Hook::register('addon_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings'); + Hook::register('addon_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post'); - Addon::registerHook('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script'); - Addon::registerHook('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login'); + Hook::register('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script'); + Hook::register('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login'); - Addon::registerHook('cron', 'addon/jappixmini/jappixmini.php', 'jappixmini_cron'); + Hook::register('cron', 'addon/jappixmini/jappixmini.php', 'jappixmini_cron'); // Jappix source download as required by AGPL - Addon::registerHook('about_hook', 'addon/jappixmini/jappixmini.php', 'jappixmini_download_source'); + Hook::register('about_hook', 'addon/jappixmini/jappixmini.php', 'jappixmini_download_source'); // set standard configuration $info_text = Config::get("jappixmini", "infotext"); @@ -109,15 +109,15 @@ function jappixmini_install() function jappixmini_uninstall() { - Addon::unregisterHook('addon_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post'); + Hook::unregister('addon_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings'); + Hook::unregister('addon_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post'); - Addon::unregisterHook('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script'); - Addon::unregisterHook('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login'); + Hook::unregister('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script'); + Hook::unregister('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login'); - Addon::unregisterHook('cron', 'addon/jappixmini/jappixmini.php', 'jappixmini_cron'); + Hook::unregister('cron', 'addon/jappixmini/jappixmini.php', 'jappixmini_cron'); - Addon::unregisterHook('about_hook', 'addon/jappixmini/jappixmini.php', 'jappixmini_download_source'); + Hook::unregister('about_hook', 'addon/jappixmini/jappixmini.php', 'jappixmini_download_source'); } function jappixmini_addon_admin(App $a, &$o) diff --git a/js_upload/js_upload.php b/js_upload/js_upload.php index 705d47d9..b115e961 100644 --- a/js_upload/js_upload.php +++ b/js_upload/js_upload.php @@ -14,24 +14,24 @@ * Module Author: Chris Case * */ -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; function js_upload_install() { - Addon::registerHook('photo_upload_form', 'addon/js_upload/js_upload.php', 'js_upload_form'); - Addon::registerHook('photo_post_init', 'addon/js_upload/js_upload.php', 'js_upload_post_init'); - Addon::registerHook('photo_post_file', 'addon/js_upload/js_upload.php', 'js_upload_post_file'); - Addon::registerHook('photo_post_end', 'addon/js_upload/js_upload.php', 'js_upload_post_end'); + Hook::register('photo_upload_form', 'addon/js_upload/js_upload.php', 'js_upload_form'); + Hook::register('photo_post_init', 'addon/js_upload/js_upload.php', 'js_upload_post_init'); + Hook::register('photo_post_file', 'addon/js_upload/js_upload.php', 'js_upload_post_file'); + Hook::register('photo_post_end', 'addon/js_upload/js_upload.php', 'js_upload_post_end'); } function js_upload_uninstall() { - Addon::unregisterHook('photo_upload_form', 'addon/js_upload/js_upload.php', 'js_upload_form'); - Addon::unregisterHook('photo_post_init', 'addon/js_upload/js_upload.php', 'js_upload_post_init'); - Addon::unregisterHook('photo_post_file', 'addon/js_upload/js_upload.php', 'js_upload_post_file'); - Addon::unregisterHook('photo_post_end', 'addon/js_upload/js_upload.php', 'js_upload_post_end'); + Hook::unregister('photo_upload_form', 'addon/js_upload/js_upload.php', 'js_upload_form'); + Hook::unregister('photo_post_init', 'addon/js_upload/js_upload.php', 'js_upload_post_init'); + Hook::unregister('photo_post_file', 'addon/js_upload/js_upload.php', 'js_upload_post_file'); + Hook::unregister('photo_post_end', 'addon/js_upload/js_upload.php', 'js_upload_post_end'); } diff --git a/krynn/krynn.php b/krynn/krynn.php index 97871c3a..8f92daf7 100644 --- a/krynn/krynn.php +++ b/krynn/krynn.php @@ -9,7 +9,7 @@ * *"My body was my sacrifice... for my magic. This damage is permanent." - Raistlin Majere */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -23,7 +23,7 @@ function krynn_install() { * */ - Addon::registerHook('post_local', 'addon/krynn/krynn.php', 'krynn_post_hook'); + Hook::register('post_local', 'addon/krynn/krynn.php', 'krynn_post_hook'); /** * @@ -33,8 +33,8 @@ function krynn_install() { * */ - Addon::registerHook('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings'); - Addon::registerHook('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post'); + Hook::register('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings'); + Hook::register('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post'); Logger::log("installed krynn"); } @@ -50,9 +50,9 @@ function krynn_uninstall() { * */ - Addon::unregisterHook('post_local', 'addon/krynn/krynn.php', 'krynn_post_hook'); - Addon::unregisterHook('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post'); + Hook::unregister('post_local', 'addon/krynn/krynn.php', 'krynn_post_hook'); + Hook::unregister('addon_settings', 'addon/krynn/krynn.php', 'krynn_settings'); + Hook::unregister('addon_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post'); Logger::log("removed krynn"); diff --git a/langfilter/langfilter.php b/langfilter/langfilter.php index 512ac840..95021969 100644 --- a/langfilter/langfilter.php +++ b/langfilter/langfilter.php @@ -9,7 +9,7 @@ use Friendica\App; use Friendica\Content\Text\BBCode; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\Renderer; @@ -21,17 +21,17 @@ use Friendica\Core\Renderer; function langfilter_install() { - Addon::registerHook('prepare_body_content_filter', 'addon/langfilter/langfilter.php', 'langfilter_prepare_body_content_filter', 10); - Addon::registerHook('addon_settings', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings'); - Addon::registerHook('addon_settings_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post'); + Hook::register('prepare_body_content_filter', 'addon/langfilter/langfilter.php', 'langfilter_prepare_body_content_filter', 10); + Hook::register('addon_settings', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings'); + Hook::register('addon_settings_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post'); } function langfilter_uninstall() { - Addon::unregisterHook('prepare_body_content_filter', 'addon/langfilter/langfilter.php', 'langfilter_prepare_body_content_filter'); - Addon::unregisterHook('prepare_body', 'addon/langfilter/langfilter.php', 'langfilter_prepare_body'); - Addon::unregisterHook('addon_settings', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post'); + Hook::unregister('prepare_body_content_filter', 'addon/langfilter/langfilter.php', 'langfilter_prepare_body_content_filter'); + Hook::unregister('prepare_body', 'addon/langfilter/langfilter.php', 'langfilter_prepare_body'); + Hook::unregister('addon_settings', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings'); + Hook::unregister('addon_settings_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post'); } /* The settings diff --git a/ldapauth/ldapauth.php b/ldapauth/ldapauth.php index 77d963c0..e564bbe6 100644 --- a/ldapauth/ldapauth.php +++ b/ldapauth/ldapauth.php @@ -53,21 +53,21 @@ * * ...etc. */ -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Model\User; function ldapauth_install() { - Addon::registerHook('load_config', 'addon/ldapauth/ldapauth.php', 'ldapauth_load_config'); - Addon::registerHook('authenticate', 'addon/ldapauth/ldapauth.php', 'ldapauth_hook_authenticate'); + Hook::register('load_config', 'addon/ldapauth/ldapauth.php', 'ldapauth_load_config'); + Hook::register('authenticate', 'addon/ldapauth/ldapauth.php', 'ldapauth_hook_authenticate'); } function ldapauth_uninstall() { - Addon::unregisterHook('load_config', 'addon/ldapauth/ldapauth.php', 'ldapauth_load_config'); - Addon::unregisterHook('authenticate', 'addon/ldapauth/ldapauth.php', 'ldapauth_hook_authenticate'); + Hook::unregister('load_config', 'addon/ldapauth/ldapauth.php', 'ldapauth_load_config'); + Hook::unregister('authenticate', 'addon/ldapauth/ldapauth.php', 'ldapauth_hook_authenticate'); } function ldapauth_load_config(\Friendica\App $a) diff --git a/leistungsschutzrecht/leistungsschutzrecht.php b/leistungsschutzrecht/leistungsschutzrecht.php index 020c3af3..b4c9488f 100644 --- a/leistungsschutzrecht/leistungsschutzrecht.php +++ b/leistungsschutzrecht/leistungsschutzrecht.php @@ -5,22 +5,22 @@ * Version: 0.1 * Author: Michael Vogel */ -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Util\Network; function leistungsschutzrecht_install() { - Addon::registerHook('cron', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_cron'); - Addon::registerHook('getsiteinfo', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_getsiteinfo'); - Addon::registerHook('page_info_data', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_getsiteinfo'); + Hook::register('cron', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_cron'); + Hook::register('getsiteinfo', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_getsiteinfo'); + Hook::register('page_info_data', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_getsiteinfo'); } function leistungsschutzrecht_uninstall() { - Addon::unregisterHook('cron', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_cron'); - Addon::unregisterHook('getsiteinfo', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_getsiteinfo'); - Addon::unregisterHook('page_info_data', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_getsiteinfo'); + Hook::unregister('cron', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_cron'); + Hook::unregister('getsiteinfo', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_getsiteinfo'); + Hook::unregister('page_info_data', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_getsiteinfo'); } function leistungsschutzrecht_getsiteinfo($a, &$siteinfo) { diff --git a/libertree/libertree.php b/libertree/libertree.php index d5aa97e5..a864b9eb 100644 --- a/libertree/libertree.php +++ b/libertree/libertree.php @@ -8,7 +8,7 @@ use Friendica\App; use Friendica\Content\Text\BBCode; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -17,22 +17,22 @@ use Friendica\Util\Network; function libertree_install() { - Addon::registerHook('hook_fork', 'addon/libertree/libertree.php', 'libertree_hook_fork'); - Addon::registerHook('post_local', 'addon/libertree/libertree.php', 'libertree_post_local'); - Addon::registerHook('notifier_normal', 'addon/libertree/libertree.php', 'libertree_send'); - Addon::registerHook('jot_networks', 'addon/libertree/libertree.php', 'libertree_jot_nets'); - Addon::registerHook('connector_settings', 'addon/libertree/libertree.php', 'libertree_settings'); - Addon::registerHook('connector_settings_post', 'addon/libertree/libertree.php', 'libertree_settings_post'); + Hook::register('hook_fork', 'addon/libertree/libertree.php', 'libertree_hook_fork'); + Hook::register('post_local', 'addon/libertree/libertree.php', 'libertree_post_local'); + Hook::register('notifier_normal', 'addon/libertree/libertree.php', 'libertree_send'); + Hook::register('jot_networks', 'addon/libertree/libertree.php', 'libertree_jot_nets'); + Hook::register('connector_settings', 'addon/libertree/libertree.php', 'libertree_settings'); + Hook::register('connector_settings_post', 'addon/libertree/libertree.php', 'libertree_settings_post'); } function libertree_uninstall() { - Addon::unregisterHook('hook_fork', 'addon/libertree/libertree.php', 'libertree_hook_fork'); - Addon::unregisterHook('post_local', 'addon/libertree/libertree.php', 'libertree_post_local'); - Addon::unregisterHook('notifier_normal', 'addon/libertree/libertree.php', 'libertree_send'); - Addon::unregisterHook('jot_networks', 'addon/libertree/libertree.php', 'libertree_jot_nets'); - Addon::unregisterHook('connector_settings', 'addon/libertree/libertree.php', 'libertree_settings'); - Addon::unregisterHook('connector_settings_post', 'addon/libertree/libertree.php', 'libertree_settings_post'); + Hook::unregister('hook_fork', 'addon/libertree/libertree.php', 'libertree_hook_fork'); + Hook::unregister('post_local', 'addon/libertree/libertree.php', 'libertree_post_local'); + Hook::unregister('notifier_normal', 'addon/libertree/libertree.php', 'libertree_send'); + Hook::unregister('jot_networks', 'addon/libertree/libertree.php', 'libertree_jot_nets'); + Hook::unregister('connector_settings', 'addon/libertree/libertree.php', 'libertree_settings'); + Hook::unregister('connector_settings_post', 'addon/libertree/libertree.php', 'libertree_settings_post'); } function libertree_jot_nets(&$a,&$b) { diff --git a/libravatar/libravatar.php b/libravatar/libravatar.php index d6ccb718..232278a9 100644 --- a/libravatar/libravatar.php +++ b/libravatar/libravatar.php @@ -8,13 +8,12 @@ use Friendica\App; use Friendica\BaseModule; -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\Database\DBA; -use Friendica\Util\Security; use Friendica\Util\Strings; /** @@ -22,8 +21,8 @@ use Friendica\Util\Strings; */ function libravatar_install() { - Addon::registerHook('load_config', 'addon/libravatar/libravatar.php', 'libravatar_load_config'); - Addon::registerHook('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup'); + Hook::register('load_config', 'addon/libravatar/libravatar.php', 'libravatar_load_config'); + Hook::register('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup'); Logger::log("registered libravatar in avatar_lookup hook"); } @@ -32,8 +31,8 @@ function libravatar_install() */ function libravatar_uninstall() { - Addon::unregisterHook('load_config', 'addon/libravatar/libravatar.php', 'libravatar_load_config'); - Addon::unregisterHook('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup'); + Hook::unregister('load_config', 'addon/libravatar/libravatar.php', 'libravatar_load_config'); + Hook::unregister('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup'); Logger::log("unregistered libravatar in avatar_lookup hook"); } diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index dc0c0fd6..e8977b51 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -9,7 +9,7 @@ */ use Friendica\Content\Text\BBCode; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -18,19 +18,19 @@ use Friendica\Util\Network; use Friendica\Util\XML; function ljpost_install() { - Addon::registerHook('post_local', 'addon/ljpost/ljpost.php', 'ljpost_post_local'); - Addon::registerHook('notifier_normal', 'addon/ljpost/ljpost.php', 'ljpost_send'); - Addon::registerHook('jot_networks', 'addon/ljpost/ljpost.php', 'ljpost_jot_nets'); - Addon::registerHook('connector_settings', 'addon/ljpost/ljpost.php', 'ljpost_settings'); - Addon::registerHook('connector_settings_post', 'addon/ljpost/ljpost.php', 'ljpost_settings_post'); + Hook::register('post_local', 'addon/ljpost/ljpost.php', 'ljpost_post_local'); + Hook::register('notifier_normal', 'addon/ljpost/ljpost.php', 'ljpost_send'); + Hook::register('jot_networks', 'addon/ljpost/ljpost.php', 'ljpost_jot_nets'); + Hook::register('connector_settings', 'addon/ljpost/ljpost.php', 'ljpost_settings'); + Hook::register('connector_settings_post', 'addon/ljpost/ljpost.php', 'ljpost_settings_post'); } function ljpost_uninstall() { - Addon::unregisterHook('post_local', 'addon/ljpost/ljpost.php', 'ljpost_post_local'); - Addon::unregisterHook('notifier_normal', 'addon/ljpost/ljpost.php', 'ljpost_send'); - Addon::unregisterHook('jot_networks', 'addon/ljpost/ljpost.php', 'ljpost_jot_nets'); - Addon::unregisterHook('connector_settings', 'addon/ljpost/ljpost.php', 'ljpost_settings'); - Addon::unregisterHook('connector_settings_post', 'addon/ljpost/ljpost.php', 'ljpost_settings_post'); + Hook::unregister('post_local', 'addon/ljpost/ljpost.php', 'ljpost_post_local'); + Hook::unregister('notifier_normal', 'addon/ljpost/ljpost.php', 'ljpost_send'); + Hook::unregister('jot_networks', 'addon/ljpost/ljpost.php', 'ljpost_jot_nets'); + Hook::unregister('connector_settings', 'addon/ljpost/ljpost.php', 'ljpost_settings'); + Hook::unregister('connector_settings_post', 'addon/ljpost/ljpost.php', 'ljpost_settings_post'); } diff --git a/mahjongg/mahjongg.php b/mahjongg/mahjongg.php index 6d772a93..d9772037 100644 --- a/mahjongg/mahjongg.php +++ b/mahjongg/mahjongg.php @@ -6,14 +6,14 @@ * Version: 1.0 * Author: Holger Froese */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; function mahjongg_install() { - Addon::registerHook('app_menu', 'addon/mahjongg/mahjongg.php', 'mahjongg_app_menu'); + Hook::register('app_menu', 'addon/mahjongg/mahjongg.php', 'mahjongg_app_menu'); } function mahjongg_uninstall() { - Addon::unregisterHook('app_menu', 'addon/mahjongg/mahjongg.php', 'mahjongg_app_menu'); + Hook::unregister('app_menu', 'addon/mahjongg/mahjongg.php', 'mahjongg_app_menu'); } diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index 6b693f6c..b00c72ed 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -7,8 +7,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\PConfig; @@ -18,11 +18,11 @@ use Friendica\Util\Network; use Friendica\Model\Item; function mailstream_install() { - Addon::registerHook('addon_settings', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings'); - Addon::registerHook('addon_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings_post'); - Addon::registerHook('post_local_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook'); - Addon::registerHook('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook'); - Addon::registerHook('cron', 'addon/mailstream/mailstream.php', 'mailstream_cron'); + Hook::register('addon_settings', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings'); + Hook::register('addon_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings_post'); + Hook::register('post_local_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook'); + Hook::register('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook'); + Hook::register('cron', 'addon/mailstream/mailstream.php', 'mailstream_cron'); if (Config::get('mailstream', 'dbversion') == '0.1') { q('ALTER TABLE `mailstream_item` DROP INDEX `uid`'); @@ -59,16 +59,16 @@ function mailstream_install() { } function mailstream_uninstall() { - Addon::unregisterHook('addon_settings', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings_post'); - Addon::unregisterHook('post_local', 'addon/mailstream/mailstream.php', 'mailstream_post_local_hook'); - Addon::unregisterHook('post_remote', 'addon/mailstream/mailstream.php', 'mailstream_post_remote_hook'); - Addon::unregisterHook('post_local_end', 'addon/mailstream/mailstream.php', 'mailstream_post_local_hook'); - Addon::unregisterHook('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_remote_hook'); - Addon::unregisterHook('post_local_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook'); - Addon::unregisterHook('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook'); - Addon::unregisterHook('cron', 'addon/mailstream/mailstream.php', 'mailstream_cron'); - Addon::unregisterHook('incoming_mail', 'addon/mailstream/mailstream.php', 'mailstream_incoming_mail'); + Hook::unregister('addon_settings', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings'); + Hook::unregister('addon_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings_post'); + Hook::unregister('post_local', 'addon/mailstream/mailstream.php', 'mailstream_post_local_hook'); + Hook::unregister('post_remote', 'addon/mailstream/mailstream.php', 'mailstream_post_remote_hook'); + Hook::unregister('post_local_end', 'addon/mailstream/mailstream.php', 'mailstream_post_local_hook'); + Hook::unregister('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_remote_hook'); + Hook::unregister('post_local_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook'); + Hook::unregister('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook'); + Hook::unregister('cron', 'addon/mailstream/mailstream.php', 'mailstream_cron'); + Hook::unregister('incoming_mail', 'addon/mailstream/mailstream.php', 'mailstream_incoming_mail'); } function mailstream_module() {} diff --git a/mastodoncustomemojis/mastodoncustomemojis.php b/mastodoncustomemojis/mastodoncustomemojis.php index 1da12dc8..c7e9df60 100644 --- a/mastodoncustomemojis/mastodoncustomemojis.php +++ b/mastodoncustomemojis/mastodoncustomemojis.php @@ -11,31 +11,31 @@ use Friendica\App; use Friendica\Content\Smilies; -use Friendica\Core\Addon; use Friendica\Core\Cache; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\Protocol; use Friendica\Util\Network; use Friendica\Util\Proxy as ProxyUtils; function mastodoncustomemojis_install() { - Addon::registerHook('put_item_in_cache', __FILE__, 'mastodoncustomemojis_put_item_in_cache'); - Addon::registerHook('network_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); - Addon::registerHook('display_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); - Addon::registerHook('search_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); - Addon::registerHook('community_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); - Addon::registerHook('contacts_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); + Hook::register('put_item_in_cache', __FILE__, 'mastodoncustomemojis_put_item_in_cache'); + Hook::register('network_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); + Hook::register('display_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); + Hook::register('search_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); + Hook::register('community_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); + Hook::register('contacts_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); } function mastodoncustomemojis_uninstall() { - Addon::unregisterHook('put_item_in_cache', __FILE__, 'mastodoncustomemojis_put_item_in_cache'); - Addon::unregisterHook('network_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); - Addon::unregisterHook('display_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); - Addon::unregisterHook('search_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); - Addon::unregisterHook('community_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); - Addon::unregisterHook('contacts_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); + Hook::unregister('put_item_in_cache', __FILE__, 'mastodoncustomemojis_put_item_in_cache'); + Hook::unregister('network_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); + Hook::unregister('display_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); + Hook::unregister('search_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); + Hook::unregister('community_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); + Hook::unregister('contacts_mod_init', __FILE__, 'mastodoncustomemojis_css_hook'); } function mastodoncustomemojis_css_hook(App $a) diff --git a/mathjax/mathjax.php b/mathjax/mathjax.php index ca073e53..6e80d68f 100644 --- a/mathjax/mathjax.php +++ b/mathjax/mathjax.php @@ -9,28 +9,28 @@ */ use Friendica\App; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\Renderer; function mathjax_install() { - Addon::registerHook('footer' , __FILE__, 'mathjax_footer'); - Addon::registerHook('addon_settings' , __FILE__, 'mathjax_settings'); - Addon::registerHook('addon_settings_post', __FILE__, 'mathjax_settings_post'); + Hook::register('footer' , __FILE__, 'mathjax_footer'); + Hook::register('addon_settings' , __FILE__, 'mathjax_settings'); + Hook::register('addon_settings_post', __FILE__, 'mathjax_settings_post'); } function mathjax_uninstall() { - Addon::unregisterHook('footer' , __FILE__, 'mathjax_footer'); - Addon::unregisterHook('addon_settings' , __FILE__, 'mathjax_settings'); - Addon::unregisterHook('addon_settings_post', __FILE__, 'mathjax_settings_post'); + Hook::unregister('footer' , __FILE__, 'mathjax_footer'); + Hook::unregister('addon_settings' , __FILE__, 'mathjax_settings'); + Hook::unregister('addon_settings_post', __FILE__, 'mathjax_settings_post'); // Legacy hooks - Addon::unregisterHook('load_config' , __FILE__, 'mathjax_load_config'); - Addon::unregisterHook('page_header' , __FILE__, 'mathjax_page_header'); - Addon::unregisterHook('template_vars' , __FILE__, 'mathjax_template_vars'); + Hook::unregister('load_config' , __FILE__, 'mathjax_load_config'); + Hook::unregister('page_header' , __FILE__, 'mathjax_page_header'); + Hook::unregister('template_vars' , __FILE__, 'mathjax_template_vars'); } function mathjax_settings_post($a) diff --git a/membersince/membersince.php b/membersince/membersince.php index c11f9b53..32edac27 100644 --- a/membersince/membersince.php +++ b/membersince/membersince.php @@ -7,18 +7,18 @@ * Status: Unsupported */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Util\DateTimeFormat; function membersince_install() { - Addon::registerHook('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display'); + Hook::register('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display'); } function membersince_uninstall() { - Addon::unregisterHook('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display'); + Hook::unregister('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display'); } function membersince_display(Friendica\App $a, &$b) diff --git a/morechoice/morechoice.php b/morechoice/morechoice.php index 3ab7eac1..dea8be15 100644 --- a/morechoice/morechoice.php +++ b/morechoice/morechoice.php @@ -8,26 +8,25 @@ * */ -use Friendica\Core\Addon; -use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; function morechoice_install() { - Addon::registerHook('gender_selector', 'addon/morechoice/morechoice.php', 'morechoice_gender_selector'); - Addon::registerHook('sexpref_selector', 'addon/morechoice/morechoice.php', 'morechoice_sexpref_selector'); - Addon::registerHook('marital_selector', 'addon/morechoice/morechoice.php', 'morechoice_marital_selector'); + Hook::register('gender_selector', 'addon/morechoice/morechoice.php', 'morechoice_gender_selector'); + Hook::register('sexpref_selector', 'addon/morechoice/morechoice.php', 'morechoice_sexpref_selector'); + Hook::register('marital_selector', 'addon/morechoice/morechoice.php', 'morechoice_marital_selector'); } function morechoice_uninstall() { - Addon::unregisterHook('gender_selector', 'addon/morechoice/morechoice.php', 'morechoice_gender_selector'); - Addon::unregisterHook('sexpref_selector', 'addon/morechoice/morechoice.php', 'morechoice_sexpref_selector'); - Addon::unregisterHook('marital_selector', 'addon/morechoice/morechoice.php', 'morechoice_marital_selector'); + Hook::unregister('gender_selector', 'addon/morechoice/morechoice.php', 'morechoice_gender_selector'); + Hook::unregister('sexpref_selector', 'addon/morechoice/morechoice.php', 'morechoice_sexpref_selector'); + Hook::unregister('marital_selector', 'addon/morechoice/morechoice.php', 'morechoice_marital_selector'); // We need to leave this here for a while, because we now have a situation where people can end up with an orphaned hook. - Addon::unregisterHook('poke_verbs', 'addon/morechoice/morechoice.php', 'morechoice_poke_verbs'); + Hook::unregister('poke_verbs', 'addon/morechoice/morechoice.php', 'morechoice_poke_verbs'); } diff --git a/morepokes/morepokes.php b/morepokes/morepokes.php index e0caaa52..32c9c03f 100644 --- a/morepokes/morepokes.php +++ b/morepokes/morepokes.php @@ -6,17 +6,17 @@ * Author: Thomas Willingham * */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; function morepokes_install() { - Addon::registerHook('poke_verbs', 'addon/morepokes/morepokes.php', 'morepokes_poke_verbs'); + Hook::register('poke_verbs', 'addon/morepokes/morepokes.php', 'morepokes_poke_verbs'); } function morepokes_uninstall() { - Addon::unregisterHook('poke_verbs', 'addon/morepokes/morepokes.php', 'morepokes_poke_verbs'); + Hook::unregister('poke_verbs', 'addon/morepokes/morepokes.php', 'morepokes_poke_verbs'); } function morepokes_poke_verbs($a, &$b) diff --git a/namethingy/namethingy.php b/namethingy/namethingy.php index f6a717fc..cb330981 100644 --- a/namethingy/namethingy.php +++ b/namethingy/namethingy.php @@ -7,14 +7,14 @@ * Author: Mike Macgirvin * Status: Unsupported */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; function namethingy_install() { - Addon::registerHook('app_menu', 'addon/namethingy/namethingy.php', 'namethingy_app_menu'); + Hook::register('app_menu', 'addon/namethingy/namethingy.php', 'namethingy_app_menu'); } function namethingy_uninstall() { - Addon::unregisterHook('app_menu', 'addon/namethingy/namethingy.php', 'namethingy_app_menu'); + Hook::unregister('app_menu', 'addon/namethingy/namethingy.php', 'namethingy_app_menu'); } diff --git a/newmemberwidget/newmemberwidget.php b/newmemberwidget/newmemberwidget.php index 4c0cfc3b..c8d1ccf9 100644 --- a/newmemberwidget/newmemberwidget.php +++ b/newmemberwidget/newmemberwidget.php @@ -7,8 +7,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; @@ -16,13 +16,13 @@ use Friendica\Util\Strings; function newmemberwidget_install() { - Addon::registerHook( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init'); + Hook::register( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init'); Logger::log('newmemberwidget installed'); } function newmemberwidget_uninstall() { - Addon::unregisterHook( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init'); + Hook::unregister( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init'); } function newmemberwidget_network_mod_init ($a, $b) diff --git a/notimeline/notimeline.php b/notimeline/notimeline.php index adba95c5..d8d6b2ac 100644 --- a/notimeline/notimeline.php +++ b/notimeline/notimeline.php @@ -7,20 +7,20 @@ * Status: Unsupported * */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig; function notimeline_install() { - Addon::registerHook('addon_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings'); - Addon::registerHook('addon_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post'); + Hook::register('addon_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings'); + Hook::register('addon_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post'); } function notimeline_uninstall() { - Addon::unregisterHook('addon_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post'); + Hook::unregister('addon_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings'); + Hook::unregister('addon_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post'); } function notimeline_settings_post($a, $post) diff --git a/nsfw/nsfw.php b/nsfw/nsfw.php index 9836a056..b9240103 100644 --- a/nsfw/nsfw.php +++ b/nsfw/nsfw.php @@ -7,23 +7,23 @@ * Author: Mike Macgirvin * */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig; function nsfw_install() { - Addon::registerHook('prepare_body_content_filter', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body_content_filter', 10); - Addon::registerHook('addon_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings'); - Addon::registerHook('addon_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post'); + Hook::register('prepare_body_content_filter', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body_content_filter', 10); + Hook::register('addon_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings'); + Hook::register('addon_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post'); } function nsfw_uninstall() { - Addon::unregisterHook('prepare_body_content_filter', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body_content_filter'); - Addon::unregisterHook('prepare_body', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body'); - Addon::unregisterHook('addon_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post'); + Hook::unregister('prepare_body_content_filter', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body_content_filter'); + Hook::unregister('prepare_body', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body'); + Hook::unregister('addon_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings'); + Hook::unregister('addon_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post'); } // This function isn't perfect and isn't trying to preserve the html structure - it's just a diff --git a/numfriends/numfriends.php b/numfriends/numfriends.php index 5bdc264c..8bb4e747 100644 --- a/numfriends/numfriends.php +++ b/numfriends/numfriends.php @@ -5,15 +5,15 @@ * Version: 1.0 * Author: Mike Macgirvin */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; function numfriends_install() { - Addon::registerHook('addon_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings'); - Addon::registerHook('addon_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post'); + Hook::register('addon_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings'); + Hook::register('addon_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post'); Logger::log("installed numfriends"); } @@ -21,8 +21,8 @@ function numfriends_install() { function numfriends_uninstall() { - Addon::unregisterHook('addon_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post'); + Hook::unregister('addon_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings'); + Hook::unregister('addon_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post'); Logger::log("removed numfriends"); diff --git a/openstreetmap/openstreetmap.php b/openstreetmap/openstreetmap.php index e4863e9b..c3982ec5 100644 --- a/openstreetmap/openstreetmap.php +++ b/openstreetmap/openstreetmap.php @@ -8,9 +8,9 @@ * Author: Klaus Weidenbach * */ -use Friendica\Core\Addon; use Friendica\Core\Cache; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Renderer; @@ -25,24 +25,24 @@ const OSM_MARKER = 0; function openstreetmap_install() { - Addon::registerHook('load_config', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_load_config'); - Addon::registerHook('render_location', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_location'); - Addon::registerHook('generate_map', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_generate_map'); - Addon::registerHook('generate_named_map', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_generate_named_map'); - Addon::registerHook('Map::getCoordinates', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_get_coordinates'); - Addon::registerHook('page_header', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_alterheader'); + Hook::register('load_config', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_load_config'); + Hook::register('render_location', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_location'); + Hook::register('generate_map', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_generate_map'); + Hook::register('generate_named_map', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_generate_named_map'); + Hook::register('Map::getCoordinates', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_get_coordinates'); + Hook::register('page_header', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_alterheader'); Logger::log("installed openstreetmap"); } function openstreetmap_uninstall() { - Addon::unregisterHook('load_config', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_load_config'); - Addon::unregisterHook('render_location', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_location'); - Addon::unregisterHook('generate_map', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_generate_map'); - Addon::unregisterHook('generate_named_map', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_generate_named_map'); - Addon::unregisterHook('Map::getCoordinates', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_get_coordinates'); - Addon::unregisterHook('page_header', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_alterheader'); + Hook::unregister('load_config', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_load_config'); + Hook::unregister('render_location', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_location'); + Hook::unregister('generate_map', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_generate_map'); + Hook::unregister('generate_named_map', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_generate_named_map'); + Hook::unregister('Map::getCoordinates', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_get_coordinates'); + Hook::unregister('page_header', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_alterheader'); Logger::log("removed openstreetmap"); } diff --git a/pageheader/pageheader.php b/pageheader/pageheader.php index 5b59064a..2ec92509 100644 --- a/pageheader/pageheader.php +++ b/pageheader/pageheader.php @@ -9,24 +9,25 @@ */ use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Renderer; function pageheader_install() { - Addon::registerHook('page_content_top', 'addon/pageheader/pageheader.php', 'pageheader_fetch'); - Addon::registerHook('addon_settings', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings'); - Addon::registerHook('addon_settings_post', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings_post'); + Hook::register('page_content_top', 'addon/pageheader/pageheader.php', 'pageheader_fetch'); + Hook::register('addon_settings', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings'); + Hook::register('addon_settings_post', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings_post'); } function pageheader_uninstall() { - Addon::unregisterHook('page_content_top', 'addon/pageheader/pageheader.php', 'pageheader_fetch'); - Addon::unregisterHook('addon_settings', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings_post'); + Hook::unregister('page_content_top', 'addon/pageheader/pageheader.php', 'pageheader_fetch'); + Hook::unregister('addon_settings', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings'); + Hook::unregister('addon_settings_post', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings_post'); // hook moved, uninstall the old one if still there. - Addon::unregisterHook('page_header', 'addon/pageheader/pageheader.php', 'pageheader_fetch'); + Hook::unregister('page_header', 'addon/pageheader/pageheader.php', 'pageheader_fetch'); } diff --git a/piwik/piwik.php b/piwik/piwik.php index 3e3144fb..fa04413e 100644 --- a/piwik/piwik.php +++ b/piwik/piwik.php @@ -30,23 +30,23 @@ * about http/https but beware to put the trailing / at the end of your * setting. */ -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\Util\Strings; function piwik_install() { - Addon::registerHook('load_config', 'addon/piwik/piwik.php', 'piwik_load_config'); - Addon::registerHook('page_end', 'addon/piwik/piwik.php', 'piwik_analytics'); + Hook::register('load_config', 'addon/piwik/piwik.php', 'piwik_load_config'); + Hook::register('page_end', 'addon/piwik/piwik.php', 'piwik_analytics'); Logger::log("installed piwik addon"); } function piwik_uninstall() { - Addon::unregisterHook('load_config', 'addon/piwik/piwik.php', 'piwik_load_config'); - Addon::unregisterHook('page_end', 'addon/piwik/piwik.php', 'piwik_analytics'); + Hook::unregister('load_config', 'addon/piwik/piwik.php', 'piwik_load_config'); + Hook::unregister('page_end', 'addon/piwik/piwik.php', 'piwik_analytics'); Logger::log("uninstalled piwik addon"); } diff --git a/planets/planets.php b/planets/planets.php index 90b14726..48ba5767 100644 --- a/planets/planets.php +++ b/planets/planets.php @@ -6,7 +6,7 @@ * Author: Mike Macgirvin * Author: Tony Baldwin */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -20,7 +20,7 @@ function planets_install() { * */ - Addon::registerHook('post_local', 'addon/planets/planets.php', 'planets_post_hook'); + Hook::register('post_local', 'addon/planets/planets.php', 'planets_post_hook'); /** * @@ -30,8 +30,8 @@ function planets_install() { * */ - Addon::registerHook('addon_settings', 'addon/planets/planets.php', 'planets_settings'); - Addon::registerHook('addon_settings_post', 'addon/planets/planets.php', 'planets_settings_post'); + Hook::register('addon_settings', 'addon/planets/planets.php', 'planets_settings'); + Hook::register('addon_settings_post', 'addon/planets/planets.php', 'planets_settings_post'); Logger::log("installed planets"); } @@ -47,9 +47,9 @@ function planets_uninstall() { * */ - Addon::unregisterHook('post_local', 'addon/planets/planets.php', 'planets_post_hook'); - Addon::unregisterHook('addon_settings', 'addon/planets/planets.php', 'planets_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/planets/planets.php', 'planets_settings_post'); + Hook::unregister('post_local', 'addon/planets/planets.php', 'planets_post_hook'); + Hook::unregister('addon_settings', 'addon/planets/planets.php', 'planets_settings'); + Hook::unregister('addon_settings_post', 'addon/planets/planets.php', 'planets_settings_post'); Logger::log("removed planets"); diff --git a/pledgie/pledgie.php b/pledgie/pledgie.php index 4fd5a6c3..8a4378bc 100644 --- a/pledgie/pledgie.php +++ b/pledgie/pledgie.php @@ -7,20 +7,20 @@ * Hauke Altmann * */ -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; function pledgie_install() { - Addon::registerHook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active'); - Addon::registerHook('addon_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings'); - Addon::registerHook('addon_settings_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post'); + Hook::register('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active'); + Hook::register('addon_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings'); + Hook::register('addon_settings_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post'); } function pledgie_uninstall() { - Addon::unregisterHook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active'); - Addon::unregisterHook('addon_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post'); + Hook::unregister('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active'); + Hook::unregister('addon_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings'); + Hook::unregister('addon_settings_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post'); } function pledgie_addon_settings(&$a,&$s) { diff --git a/public_server/public_server.php b/public_server/public_server.php index 7e09806e..52d9c6e0 100644 --- a/public_server/public_server.php +++ b/public_server/public_server.php @@ -10,6 +10,7 @@ use Friendica\App; use Friendica\BaseModule; use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Renderer; @@ -19,20 +20,20 @@ use Friendica\Util\Strings; function public_server_install() { - Addon::registerHook('load_config', 'addon/public_server/public_server.php', 'public_server_load_config'); - Addon::registerHook('register_account', 'addon/public_server/public_server.php', 'public_server_register_account'); - Addon::registerHook('cron', 'addon/public_server/public_server.php', 'public_server_cron'); - Addon::registerHook('enotify', 'addon/public_server/public_server.php', 'public_server_enotify'); - Addon::registerHook('logged_in', 'addon/public_server/public_server.php', 'public_server_login'); + Hook::register('load_config', 'addon/public_server/public_server.php', 'public_server_load_config'); + Hook::register('register_account', 'addon/public_server/public_server.php', 'public_server_register_account'); + Hook::register('cron', 'addon/public_server/public_server.php', 'public_server_cron'); + Hook::register('enotify', 'addon/public_server/public_server.php', 'public_server_enotify'); + Hook::register('logged_in', 'addon/public_server/public_server.php', 'public_server_login'); } function public_server_uninstall() { - Addon::unregisterHook('load_config', 'addon/public_server/public_server.php', 'public_server_load_config'); - Addon::unregisterHook('register_account', 'addon/public_server/public_server.php', 'public_server_register_account'); - Addon::unregisterHook('cron', 'addon/public_server/public_server.php', 'public_server_cron'); - Addon::unregisterHook('enotify', 'addon/public_server/public_server.php', 'public_server_enotify'); - Addon::unregisterHook('logged_in', 'addon/public_server/public_server.php', 'public_server_login'); + Hook::unregister('load_config', 'addon/public_server/public_server.php', 'public_server_load_config'); + Hook::unregister('register_account', 'addon/public_server/public_server.php', 'public_server_register_account'); + Hook::unregister('cron', 'addon/public_server/public_server.php', 'public_server_cron'); + Hook::unregister('enotify', 'addon/public_server/public_server.php', 'public_server_enotify'); + Hook::unregister('logged_in', 'addon/public_server/public_server.php', 'public_server_login'); } function public_server_load_config(App $a) diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index fa0365ed..87583358 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -9,8 +9,8 @@ use Friendica\App; 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\PConfig; @@ -37,30 +37,30 @@ define('PUMPIO_DEFAULT_POLL_INTERVAL', 5); // given in minutes function pumpio_install() { - Addon::registerHook('load_config', 'addon/pumpio/pumpio.php', 'pumpio_load_config'); - Addon::registerHook('hook_fork', 'addon/pumpio/pumpio.php', 'hook_fork'); - Addon::registerHook('post_local', 'addon/pumpio/pumpio.php', 'pumpio_post_local'); - Addon::registerHook('notifier_normal', 'addon/pumpio/pumpio.php', 'pumpio_send'); - Addon::registerHook('jot_networks', 'addon/pumpio/pumpio.php', 'pumpio_jot_nets'); - Addon::registerHook('connector_settings', 'addon/pumpio/pumpio.php', 'pumpio_settings'); - Addon::registerHook('connector_settings_post', 'addon/pumpio/pumpio.php', 'pumpio_settings_post'); - Addon::registerHook('cron', 'addon/pumpio/pumpio.php', 'pumpio_cron'); - Addon::registerHook('queue_predeliver', 'addon/pumpio/pumpio.php', 'pumpio_queue_hook'); - Addon::registerHook('check_item_notification', 'addon/pumpio/pumpio.php', 'pumpio_check_item_notification'); + Hook::register('load_config', 'addon/pumpio/pumpio.php', 'pumpio_load_config'); + Hook::register('hook_fork', 'addon/pumpio/pumpio.php', 'hook_fork'); + Hook::register('post_local', 'addon/pumpio/pumpio.php', 'pumpio_post_local'); + Hook::register('notifier_normal', 'addon/pumpio/pumpio.php', 'pumpio_send'); + Hook::register('jot_networks', 'addon/pumpio/pumpio.php', 'pumpio_jot_nets'); + Hook::register('connector_settings', 'addon/pumpio/pumpio.php', 'pumpio_settings'); + Hook::register('connector_settings_post', 'addon/pumpio/pumpio.php', 'pumpio_settings_post'); + Hook::register('cron', 'addon/pumpio/pumpio.php', 'pumpio_cron'); + Hook::register('queue_predeliver', 'addon/pumpio/pumpio.php', 'pumpio_queue_hook'); + Hook::register('check_item_notification', 'addon/pumpio/pumpio.php', 'pumpio_check_item_notification'); } function pumpio_uninstall() { - Addon::unregisterHook('load_config', 'addon/pumpio/pumpio.php', 'pumpio_load_config'); - Addon::unregisterHook('hook_fork', 'addon/pumpio/pumpio.php', 'pumpio_hook_fork'); - Addon::unregisterHook('post_local', 'addon/pumpio/pumpio.php', 'pumpio_post_local'); - Addon::unregisterHook('notifier_normal', 'addon/pumpio/pumpio.php', 'pumpio_send'); - Addon::unregisterHook('jot_networks', 'addon/pumpio/pumpio.php', 'pumpio_jot_nets'); - Addon::unregisterHook('connector_settings', 'addon/pumpio/pumpio.php', 'pumpio_settings'); - Addon::unregisterHook('connector_settings_post', 'addon/pumpio/pumpio.php', 'pumpio_settings_post'); - Addon::unregisterHook('cron', 'addon/pumpio/pumpio.php', 'pumpio_cron'); - Addon::unregisterHook('queue_predeliver', 'addon/pumpio/pumpio.php', 'pumpio_queue_hook'); - Addon::unregisterHook('check_item_notification', 'addon/pumpio/pumpio.php', 'pumpio_check_item_notification'); + Hook::unregister('load_config', 'addon/pumpio/pumpio.php', 'pumpio_load_config'); + Hook::unregister('hook_fork', 'addon/pumpio/pumpio.php', 'pumpio_hook_fork'); + Hook::unregister('post_local', 'addon/pumpio/pumpio.php', 'pumpio_post_local'); + Hook::unregister('notifier_normal', 'addon/pumpio/pumpio.php', 'pumpio_send'); + Hook::unregister('jot_networks', 'addon/pumpio/pumpio.php', 'pumpio_jot_nets'); + Hook::unregister('connector_settings', 'addon/pumpio/pumpio.php', 'pumpio_settings'); + Hook::unregister('connector_settings_post', 'addon/pumpio/pumpio.php', 'pumpio_settings_post'); + Hook::unregister('cron', 'addon/pumpio/pumpio.php', 'pumpio_cron'); + Hook::unregister('queue_predeliver', 'addon/pumpio/pumpio.php', 'pumpio_queue_hook'); + Hook::unregister('check_item_notification', 'addon/pumpio/pumpio.php', 'pumpio_check_item_notification'); } function pumpio_module() {} diff --git a/qcomment/qcomment.php b/qcomment/qcomment.php index 16c5a44c..7c5e0358 100644 --- a/qcomment/qcomment.php +++ b/qcomment/qcomment.php @@ -17,20 +17,20 @@ * them to open the comment window fully and insert the qcomment. Then "Submit" will submit it. * */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Util\XML; function qcomment_install() { - Addon::registerHook('addon_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings'); - Addon::registerHook('addon_settings_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post'); + Hook::register('addon_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings'); + Hook::register('addon_settings_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post'); } function qcomment_uninstall() { - Addon::unregisterHook('addon_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post'); + Hook::unregister('addon_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings'); + Hook::unregister('addon_settings_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post'); } diff --git a/randplace/randplace.php b/randplace/randplace.php index 7784d80b..ffc3237c 100644 --- a/randplace/randplace.php +++ b/randplace/randplace.php @@ -18,7 +18,7 @@ * system will call the name_uninstall() function. * */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -32,7 +32,7 @@ function randplace_install() { * */ - Addon::registerHook('post_local', 'addon/randplace/randplace.php', 'randplace_post_hook'); + Hook::register('post_local', 'addon/randplace/randplace.php', 'randplace_post_hook'); /** * @@ -42,8 +42,8 @@ function randplace_install() { * */ - Addon::registerHook('addon_settings', 'addon/randplace/randplace.php', 'randplace_settings'); - Addon::registerHook('addon_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post'); + Hook::register('addon_settings', 'addon/randplace/randplace.php', 'randplace_settings'); + Hook::register('addon_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post'); Logger::log("installed randplace"); } @@ -59,9 +59,9 @@ function randplace_uninstall() { * */ - Addon::unregisterHook('post_local', 'addon/randplace/randplace.php', 'randplace_post_hook'); - Addon::unregisterHook('addon_settings', 'addon/randplace/randplace.php', 'randplace_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post'); + Hook::unregister('post_local', 'addon/randplace/randplace.php', 'randplace_post_hook'); + Hook::unregister('addon_settings', 'addon/randplace/randplace.php', 'randplace_settings'); + Hook::unregister('addon_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post'); Logger::log("removed randplace"); diff --git a/remote_permissions/remote_permissions.php b/remote_permissions/remote_permissions.php index 093053e4..5adfc028 100644 --- a/remote_permissions/remote_permissions.php +++ b/remote_permissions/remote_permissions.php @@ -7,8 +7,8 @@ * Status: Unsupported */ -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\Renderer; @@ -16,15 +16,15 @@ use Friendica\Database\DBA; use Friendica\Util\Strings; function remote_permissions_install() { - Addon::registerHook('lockview_content', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_content'); - Addon::registerHook('addon_settings', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings'); - Addon::registerHook('addon_settings_post', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings_post'); + Hook::register('lockview_content', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_content'); + Hook::register('addon_settings', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings'); + Hook::register('addon_settings_post', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings_post'); } function remote_permissions_uninstall() { - Addon::unregisterHook('lockview_content', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_content'); - Addon::unregisterHook('addon_settings', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings_post'); + Hook::unregister('lockview_content', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_content'); + Hook::unregister('addon_settings', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings'); + Hook::unregister('addon_settings_post', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings_post'); } function remote_permissions_settings(&$a,&$o) { diff --git a/rendertime/rendertime.php b/rendertime/rendertime.php index 3bb8892b..6a323d68 100644 --- a/rendertime/rendertime.php +++ b/rendertime/rendertime.php @@ -6,18 +6,18 @@ * Author: Michael Vogel * */ -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; function rendertime_install() { - Addon::registerHook('page_end', 'addon/rendertime/rendertime.php', 'rendertime_page_end'); + Hook::register('page_end', 'addon/rendertime/rendertime.php', 'rendertime_page_end'); } function rendertime_uninstall() { - Addon::unregisterHook('init_1', 'addon/rendertime/rendertime.php', 'rendertime_init_1'); - Addon::unregisterHook('page_end', 'addon/rendertime/rendertime.php', 'rendertime_page_end'); + Hook::unregister('init_1', 'addon/rendertime/rendertime.php', 'rendertime_init_1'); + Hook::unregister('page_end', 'addon/rendertime/rendertime.php', 'rendertime_page_end'); } function rendertime_init_1(&$a) { diff --git a/securemail/securemail.php b/securemail/securemail.php index 10a2b298..a0ec211a 100644 --- a/securemail/securemail.php +++ b/securemail/securemail.php @@ -7,8 +7,8 @@ */ use Friendica\App; -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -28,19 +28,19 @@ require_once 'openpgp_crypt_symmetric.php'; function securemail_install() { - Addon::registerHook('addon_settings', 'addon/securemail/securemail.php', 'securemail_settings'); - Addon::registerHook('addon_settings_post', 'addon/securemail/securemail.php', 'securemail_settings_post'); + Hook::register('addon_settings', 'addon/securemail/securemail.php', 'securemail_settings'); + Hook::register('addon_settings_post', 'addon/securemail/securemail.php', 'securemail_settings_post'); - Addon::registerHook('emailer_send_prepare', 'addon/securemail/securemail.php', 'securemail_emailer_send_prepare'); + Hook::register('emailer_send_prepare', 'addon/securemail/securemail.php', 'securemail_emailer_send_prepare'); Logger::log('installed securemail'); } function securemail_uninstall() { - Addon::unregisterHook('addon_settings', 'addon/securemail/securemail.php', 'securemail_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/securemail/securemail.php', 'securemail_settings_post'); + Hook::unregister('addon_settings', 'addon/securemail/securemail.php', 'securemail_settings'); + Hook::unregister('addon_settings_post', 'addon/securemail/securemail.php', 'securemail_settings_post'); - Addon::unregisterHook('emailer_send_prepare', 'addon/securemail/securemail.php', 'securemail_emailer_send_prepare'); + Hook::unregister('emailer_send_prepare', 'addon/securemail/securemail.php', 'securemail_emailer_send_prepare'); Logger::log('removed securemail'); } diff --git a/showmore/showmore.php b/showmore/showmore.php index a7b5979b..f7bb0c50 100644 --- a/showmore/showmore.php +++ b/showmore/showmore.php @@ -7,23 +7,23 @@ * based upon NSFW from Mike Macgirvin * */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Util\Strings; function showmore_install() { - Addon::registerHook('prepare_body', 'addon/showmore/showmore.php', 'showmore_prepare_body'); - Addon::registerHook('addon_settings', 'addon/showmore/showmore.php', 'showmore_addon_settings'); - Addon::registerHook('addon_settings_post', 'addon/showmore/showmore.php', 'showmore_addon_settings_post'); + Hook::register('prepare_body', 'addon/showmore/showmore.php', 'showmore_prepare_body'); + Hook::register('addon_settings', 'addon/showmore/showmore.php', 'showmore_addon_settings'); + Hook::register('addon_settings_post', 'addon/showmore/showmore.php', 'showmore_addon_settings_post'); } function showmore_uninstall() { - Addon::unregisterHook('prepare_body', 'addon/showmore/showmore.php', 'showmore_prepare_body'); - Addon::unregisterHook('addon_settings', 'addon/showmore/showmore.php', 'showmore_addon_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/showmore/showmore.php', 'showmore_addon_settings_post'); + Hook::unregister('prepare_body', 'addon/showmore/showmore.php', 'showmore_prepare_body'); + Hook::unregister('addon_settings', 'addon/showmore/showmore.php', 'showmore_addon_settings'); + Hook::unregister('addon_settings_post', 'addon/showmore/showmore.php', 'showmore_addon_settings_post'); } function showmore_addon_settings(&$a, &$s) diff --git a/smiley_pack/lang/smiley_pack_es/smiley_pack_es.php b/smiley_pack/lang/smiley_pack_es/smiley_pack_es.php index c832fbba..febdd41c 100644 --- a/smiley_pack/lang/smiley_pack_es/smiley_pack_es.php +++ b/smiley_pack/lang/smiley_pack_es/smiley_pack_es.php @@ -6,14 +6,14 @@ * Author: Thomas Willingham (based on Mike Macgirvin's Adult Smile template) * All smileys from sites offering them as Public Domain */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; function smiley_pack_es_install() { - Addon::registerHook('smilie', 'addon/smiley_pack_es/smiley_pack_es.php', 'smiley_pack_smilies_es'); + Hook::register('smilie', 'addon/smiley_pack_es/smiley_pack_es.php', 'smiley_pack_smilies_es'); } function smiley_pack_es_uninstall() { - Addon::unregisterHook('smilie', 'addon/smiley_pack_es/smiley_pack_es.php', 'smiley_pack_smilies'); + Hook::unregister('smilie', 'addon/smiley_pack_es/smiley_pack_es.php', 'smiley_pack_smilies'); } diff --git a/smiley_pack/lang/smiley_pack_fr/smiley_pack_fr.php b/smiley_pack/lang/smiley_pack_fr/smiley_pack_fr.php index 08ddb034..5f10a5b1 100644 --- a/smiley_pack/lang/smiley_pack_fr/smiley_pack_fr.php +++ b/smiley_pack/lang/smiley_pack_fr/smiley_pack_fr.php @@ -8,14 +8,14 @@ * * */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; function smiley_pack_fr_install() { - Addon::registerHook('smilie', 'addon/smiley_pack_fr/smiley_pack_fr.php', 'smiley_pack_fr_smilies'); + Hook::register('smilie', 'addon/smiley_pack_fr/smiley_pack_fr.php', 'smiley_pack_fr_smilies'); } function smiley_pack_fr_uninstall() { - Addon::unregisterHook('smilie', 'addon/smiley_pack_fr/smiley_pack_fr.php', 'smiley_pack_fr_smilies'); + Hook::unregister('smilie', 'addon/smiley_pack_fr/smiley_pack_fr.php', 'smiley_pack_fr_smilies'); } diff --git a/smiley_pack/smiley_pack.php b/smiley_pack/smiley_pack.php index a373c625..607f3557 100644 --- a/smiley_pack/smiley_pack.php +++ b/smiley_pack/smiley_pack.php @@ -7,14 +7,14 @@ * All smileys from sites offering them as Public Domain */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; function smiley_pack_install() { - Addon::registerHook('smilie', 'addon/smiley_pack/smiley_pack.php', 'smiley_pack_smilies'); + Hook::register('smilie', 'addon/smiley_pack/smiley_pack.php', 'smiley_pack_smilies'); } function smiley_pack_uninstall() { - Addon::unregisterHook('smilie', 'addon/smiley_pack/smiley_pack.php', 'smiley_pack_smilies'); + Hook::unregister('smilie', 'addon/smiley_pack/smiley_pack.php', 'smiley_pack_smilies'); } diff --git a/smileybutton/smileybutton.php b/smileybutton/smileybutton.php index fd779bac..593eed8b 100644 --- a/smileybutton/smileybutton.php +++ b/smileybutton/smileybutton.php @@ -5,13 +5,12 @@ * Version: 0.2 * Author: Johannes Schwab */ -use Friendica\Core\Addon; use Friendica\Core\Hook; use Friendica\Core\Logger; function smileybutton_install() { //Register hooks - Addon::registerHook('jot_tool', 'addon/smileybutton/smileybutton.php', 'show_button'); + Hook::register('jot_tool', 'addon/smileybutton/smileybutton.php', 'show_button'); Logger::log("installed smileybutton"); } @@ -19,7 +18,7 @@ function smileybutton_install() { function smileybutton_uninstall() { //Delet registered hooks - Addon::unregisterHook('jot_tool', 'addon/smileybutton/smileybutton.php', 'show_button'); + Hook::unregister('jot_tool', 'addon/smileybutton/smileybutton.php', 'show_button'); Logger::log("removed smileybutton"); } diff --git a/smilies_adult/smilies_adult.php b/smilies_adult/smilies_adult.php index b12cf615..c0095923 100644 --- a/smilies_adult/smilies_adult.php +++ b/smilies_adult/smilies_adult.php @@ -8,14 +8,14 @@ * This is a template for how to extend the "smily" code. * */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; function smilies_adult_install() { - Addon::registerHook('smilie', 'addon/smilies_adult/smilies_adult.php', 'smilies_adult_smilies'); + Hook::register('smilie', 'addon/smilies_adult/smilies_adult.php', 'smilies_adult_smilies'); } function smilies_adult_uninstall() { - Addon::unregisterHook('smilie', 'addon/smilies_adult/smilies_adult.php', 'smilies_adult_smilies'); + Hook::unregister('smilie', 'addon/smilies_adult/smilies_adult.php', 'smilies_adult_smilies'); } diff --git a/sniper/sniper.php b/sniper/sniper.php index 751aa53b..72300838 100644 --- a/sniper/sniper.php +++ b/sniper/sniper.php @@ -9,14 +9,14 @@ * Version: 1.0 * Author: Mike Macgirvin */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; function sniper_install() { - Addon::registerHook('app_menu', 'addon/sniper/sniper.php', 'sniper_app_menu'); + Hook::register('app_menu', 'addon/sniper/sniper.php', 'sniper_app_menu'); } function sniper_uninstall() { - Addon::unregisterHook('app_menu', 'addon/sniper/sniper.php', 'sniper_app_menu'); + Hook::unregister('app_menu', 'addon/sniper/sniper.php', 'sniper_app_menu'); } diff --git a/startpage/startpage.php b/startpage/startpage.php index b955161b..82ae1eb0 100644 --- a/startpage/startpage.php +++ b/startpage/startpage.php @@ -6,21 +6,21 @@ * Author: Mike Macgirvin * */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig; function startpage_install() { - Addon::registerHook('home_init', 'addon/startpage/startpage.php', 'startpage_home_init'); - Addon::registerHook('addon_settings', 'addon/startpage/startpage.php', 'startpage_settings'); - Addon::registerHook('addon_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post'); + Hook::register('home_init', 'addon/startpage/startpage.php', 'startpage_home_init'); + Hook::register('addon_settings', 'addon/startpage/startpage.php', 'startpage_settings'); + Hook::register('addon_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post'); } function startpage_uninstall() { - Addon::unregisterHook('home_init', 'addon/startpage/startpage.php', 'startpage_home_init'); - Addon::unregisterHook('addon_settings', 'addon/startpage/startpage.php', 'startpage_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post'); + Hook::unregister('home_init', 'addon/startpage/startpage.php', 'startpage_home_init'); + Hook::unregister('addon_settings', 'addon/startpage/startpage.php', 'startpage_settings'); + Hook::unregister('addon_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post'); } function startpage_home_init($a, $b) diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 28920dd6..9b50111a 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -43,8 +43,8 @@ use Friendica\App; use Friendica\Content\OEmbed; use Friendica\Content\Text\HTML; use Friendica\Content\Text\Plaintext; -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -65,34 +65,34 @@ use Friendica\Util\Strings; function statusnet_install() { // we need some hooks, for the configuration and for sending tweets - Addon::registerHook('connector_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings'); - Addon::registerHook('connector_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post'); - Addon::registerHook('notifier_normal', 'addon/statusnet/statusnet.php', 'statusnet_post_hook'); - Addon::registerHook('hook_fork', 'addon/statusnet/statusnet.php', 'statusnet_hook_fork'); - Addon::registerHook('post_local', 'addon/statusnet/statusnet.php', 'statusnet_post_local'); - Addon::registerHook('jot_networks', 'addon/statusnet/statusnet.php', 'statusnet_jot_nets'); - Addon::registerHook('cron', 'addon/statusnet/statusnet.php', 'statusnet_cron'); - Addon::registerHook('prepare_body', 'addon/statusnet/statusnet.php', 'statusnet_prepare_body'); - Addon::registerHook('check_item_notification', 'addon/statusnet/statusnet.php', 'statusnet_check_item_notification'); + Hook::register('connector_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings'); + Hook::register('connector_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post'); + Hook::register('notifier_normal', 'addon/statusnet/statusnet.php', 'statusnet_post_hook'); + Hook::register('hook_fork', 'addon/statusnet/statusnet.php', 'statusnet_hook_fork'); + Hook::register('post_local', 'addon/statusnet/statusnet.php', 'statusnet_post_local'); + Hook::register('jot_networks', 'addon/statusnet/statusnet.php', 'statusnet_jot_nets'); + Hook::register('cron', 'addon/statusnet/statusnet.php', 'statusnet_cron'); + Hook::register('prepare_body', 'addon/statusnet/statusnet.php', 'statusnet_prepare_body'); + Hook::register('check_item_notification', 'addon/statusnet/statusnet.php', 'statusnet_check_item_notification'); Logger::log("installed GNU Social"); } function statusnet_uninstall() { - Addon::unregisterHook('connector_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings'); - Addon::unregisterHook('connector_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post'); - Addon::unregisterHook('notifier_normal', 'addon/statusnet/statusnet.php', 'statusnet_post_hook'); - Addon::unregisterHook('hook_fork', 'addon/statusnet/statusnet.php', 'statusnet_hook_fork'); - Addon::unregisterHook('post_local', 'addon/statusnet/statusnet.php', 'statusnet_post_local'); - Addon::unregisterHook('jot_networks', 'addon/statusnet/statusnet.php', 'statusnet_jot_nets'); - Addon::unregisterHook('cron', 'addon/statusnet/statusnet.php', 'statusnet_cron'); - Addon::unregisterHook('prepare_body', 'addon/statusnet/statusnet.php', 'statusnet_prepare_body'); - Addon::unregisterHook('check_item_notification', 'addon/statusnet/statusnet.php', 'statusnet_check_item_notification'); + Hook::unregister('connector_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings'); + Hook::unregister('connector_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post'); + Hook::unregister('notifier_normal', 'addon/statusnet/statusnet.php', 'statusnet_post_hook'); + Hook::unregister('hook_fork', 'addon/statusnet/statusnet.php', 'statusnet_hook_fork'); + Hook::unregister('post_local', 'addon/statusnet/statusnet.php', 'statusnet_post_local'); + Hook::unregister('jot_networks', 'addon/statusnet/statusnet.php', 'statusnet_jot_nets'); + Hook::unregister('cron', 'addon/statusnet/statusnet.php', 'statusnet_cron'); + Hook::unregister('prepare_body', 'addon/statusnet/statusnet.php', 'statusnet_prepare_body'); + Hook::unregister('check_item_notification', 'addon/statusnet/statusnet.php', 'statusnet_check_item_notification'); // old setting - remove only - Addon::unregisterHook('post_local_end', 'addon/statusnet/statusnet.php', 'statusnet_post_hook'); - Addon::unregisterHook('addon_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post'); + Hook::unregister('post_local_end', 'addon/statusnet/statusnet.php', 'statusnet_post_hook'); + Hook::unregister('addon_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings'); + Hook::unregister('addon_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post'); } function statusnet_check_item_notification(App $a, &$notification_data) diff --git a/superblock/superblock.php b/superblock/superblock.php index 9d40509e..da4260d0 100644 --- a/superblock/superblock.php +++ b/superblock/superblock.php @@ -6,27 +6,27 @@ * Author: Mike Macgirvin * */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Util\Strings; function superblock_install() { - Addon::registerHook('addon_settings', 'addon/superblock/superblock.php', 'superblock_addon_settings'); - Addon::registerHook('addon_settings_post', 'addon/superblock/superblock.php', 'superblock_addon_settings_post'); - Addon::registerHook('conversation_start', 'addon/superblock/superblock.php', 'superblock_conversation_start'); - Addon::registerHook('item_photo_menu', 'addon/superblock/superblock.php', 'superblock_item_photo_menu'); - Addon::registerHook('enotify_store', 'addon/superblock/superblock.php', 'superblock_enotify_store'); + Hook::register('addon_settings', 'addon/superblock/superblock.php', 'superblock_addon_settings'); + Hook::register('addon_settings_post', 'addon/superblock/superblock.php', 'superblock_addon_settings_post'); + Hook::register('conversation_start', 'addon/superblock/superblock.php', 'superblock_conversation_start'); + Hook::register('item_photo_menu', 'addon/superblock/superblock.php', 'superblock_item_photo_menu'); + Hook::register('enotify_store', 'addon/superblock/superblock.php', 'superblock_enotify_store'); } function superblock_uninstall() { - Addon::unregisterHook('addon_settings', 'addon/superblock/superblock.php', 'superblock_addon_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/superblock/superblock.php', 'superblock_addon_settings_post'); - Addon::unregisterHook('conversation_start', 'addon/superblock/superblock.php', 'superblock_conversation_start'); - Addon::unregisterHook('item_photo_menu', 'addon/superblock/superblock.php', 'superblock_item_photo_menu'); - Addon::unregisterHook('enotify_store', 'addon/superblock/superblock.php', 'superblock_enotify_store'); + Hook::unregister('addon_settings', 'addon/superblock/superblock.php', 'superblock_addon_settings'); + Hook::unregister('addon_settings_post', 'addon/superblock/superblock.php', 'superblock_addon_settings_post'); + Hook::unregister('conversation_start', 'addon/superblock/superblock.php', 'superblock_conversation_start'); + Hook::unregister('item_photo_menu', 'addon/superblock/superblock.php', 'superblock_item_photo_menu'); + Hook::unregister('enotify_store', 'addon/superblock/superblock.php', 'superblock_enotify_store'); } function superblock_addon_settings(&$a, &$s) diff --git a/testdrive/testdrive.php b/testdrive/testdrive.php index 6daf136e..f15acc26 100644 --- a/testdrive/testdrive.php +++ b/testdrive/testdrive.php @@ -7,8 +7,8 @@ */ use Friendica\App; -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Database\DBA; use Friendica\Model\User; @@ -16,22 +16,22 @@ use Friendica\Util\DateTimeFormat; function testdrive_install() { - Addon::registerHook('load_config', 'addon/testdrive/testdrive.php', 'testdrive_load_config'); - Addon::registerHook('register_account', 'addon/testdrive/testdrive.php', 'testdrive_register_account'); - Addon::registerHook('cron', 'addon/testdrive/testdrive.php', 'testdrive_cron'); - Addon::registerHook('enotify','addon/testdrive/testdrive.php', 'testdrive_enotify'); - Addon::registerHook('globaldir_update','addon/testdrive/testdrive.php', 'testdrive_globaldir_update'); + Hook::register('load_config', 'addon/testdrive/testdrive.php', 'testdrive_load_config'); + Hook::register('register_account', 'addon/testdrive/testdrive.php', 'testdrive_register_account'); + Hook::register('cron', 'addon/testdrive/testdrive.php', 'testdrive_cron'); + Hook::register('enotify','addon/testdrive/testdrive.php', 'testdrive_enotify'); + Hook::register('globaldir_update','addon/testdrive/testdrive.php', 'testdrive_globaldir_update'); } function testdrive_uninstall() { - Addon::unregisterHook('load_config', 'addon/testdrive/testdrive.php', 'testdrive_load_config'); - Addon::unregisterHook('register_account', 'addon/testdrive/testdrive.php', 'testdrive_register_account'); - Addon::unregisterHook('cron', 'addon/testdrive/testdrive.php', 'testdrive_cron'); - Addon::unregisterHook('enotify','addon/testdrive/testdrive.php', 'testdrive_enotify'); - Addon::unregisterHook('globaldir_update','addon/testdrive/testdrive.php', 'testdrive_globaldir_update'); + Hook::unregister('load_config', 'addon/testdrive/testdrive.php', 'testdrive_load_config'); + Hook::unregister('register_account', 'addon/testdrive/testdrive.php', 'testdrive_register_account'); + Hook::unregister('cron', 'addon/testdrive/testdrive.php', 'testdrive_cron'); + Hook::unregister('enotify','addon/testdrive/testdrive.php', 'testdrive_enotify'); + Hook::unregister('globaldir_update','addon/testdrive/testdrive.php', 'testdrive_globaldir_update'); } diff --git a/tictac/tictac.php b/tictac/tictac.php index fe2c5cf1..ad0a6077 100644 --- a/tictac/tictac.php +++ b/tictac/tictac.php @@ -6,14 +6,15 @@ * Author: Mike Macgirvin */ use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; function tictac_install() { - Addon::registerHook('app_menu', 'addon/tictac/tictac.php', 'tictac_app_menu'); + Hook::register('app_menu', 'addon/tictac/tictac.php', 'tictac_app_menu'); } function tictac_uninstall() { - Addon::unregisterHook('app_menu', 'addon/tictac/tictac.php', 'tictac_app_menu'); + Hook::unregister('app_menu', 'addon/tictac/tictac.php', 'tictac_app_menu'); } diff --git a/tumblr/tumblr.php b/tumblr/tumblr.php index 2d4bd1a3..62f71132 100644 --- a/tumblr/tumblr.php +++ b/tumblr/tumblr.php @@ -11,8 +11,8 @@ require_once __DIR__ . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . ' use Friendica\App; 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; @@ -22,22 +22,22 @@ use Friendica\Util\Strings; function tumblr_install() { - Addon::registerHook('hook_fork', 'addon/tumblr/tumblr.php', 'tumblr_hook_fork'); - Addon::registerHook('post_local', 'addon/tumblr/tumblr.php', 'tumblr_post_local'); - Addon::registerHook('notifier_normal', 'addon/tumblr/tumblr.php', 'tumblr_send'); - Addon::registerHook('jot_networks', 'addon/tumblr/tumblr.php', 'tumblr_jot_nets'); - Addon::registerHook('connector_settings', 'addon/tumblr/tumblr.php', 'tumblr_settings'); - Addon::registerHook('connector_settings_post', 'addon/tumblr/tumblr.php', 'tumblr_settings_post'); + Hook::register('hook_fork', 'addon/tumblr/tumblr.php', 'tumblr_hook_fork'); + Hook::register('post_local', 'addon/tumblr/tumblr.php', 'tumblr_post_local'); + Hook::register('notifier_normal', 'addon/tumblr/tumblr.php', 'tumblr_send'); + Hook::register('jot_networks', 'addon/tumblr/tumblr.php', 'tumblr_jot_nets'); + Hook::register('connector_settings', 'addon/tumblr/tumblr.php', 'tumblr_settings'); + Hook::register('connector_settings_post', 'addon/tumblr/tumblr.php', 'tumblr_settings_post'); } function tumblr_uninstall() { - Addon::unregisterHook('hook_fork', 'addon/tumblr/tumblr.php', 'tumblr_hook_fork'); - Addon::unregisterHook('post_local', 'addon/tumblr/tumblr.php', 'tumblr_post_local'); - Addon::unregisterHook('notifier_normal', 'addon/tumblr/tumblr.php', 'tumblr_send'); - Addon::unregisterHook('jot_networks', 'addon/tumblr/tumblr.php', 'tumblr_jot_nets'); - Addon::unregisterHook('connector_settings', 'addon/tumblr/tumblr.php', 'tumblr_settings'); - Addon::unregisterHook('connector_settings_post', 'addon/tumblr/tumblr.php', 'tumblr_settings_post'); + Hook::unregister('hook_fork', 'addon/tumblr/tumblr.php', 'tumblr_hook_fork'); + Hook::unregister('post_local', 'addon/tumblr/tumblr.php', 'tumblr_post_local'); + Hook::unregister('notifier_normal', 'addon/tumblr/tumblr.php', 'tumblr_send'); + Hook::unregister('jot_networks', 'addon/tumblr/tumblr.php', 'tumblr_jot_nets'); + Hook::unregister('connector_settings', 'addon/tumblr/tumblr.php', 'tumblr_settings'); + Hook::unregister('connector_settings_post', 'addon/tumblr/tumblr.php', 'tumblr_settings_post'); } function tumblr_module() diff --git a/twitter/twitter.php b/twitter/twitter.php index 43269a87..64b8f409 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -68,8 +68,8 @@ use Friendica\App; use Friendica\Content\OEmbed; use Friendica\Content\Text\BBCode; use Friendica\Content\Text\Plaintext; -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -102,42 +102,42 @@ define('TWITTER_DEFAULT_POLL_INTERVAL', 5); // given in minutes function twitter_install() { // we need some hooks, for the configuration and for sending tweets - Addon::registerHook('load_config' , __FILE__, 'twitter_load_config'); - Addon::registerHook('connector_settings' , __FILE__, 'twitter_settings'); - Addon::registerHook('connector_settings_post', __FILE__, 'twitter_settings_post'); - Addon::registerHook('hook_fork' , __FILE__, 'twitter_hook_fork'); - Addon::registerHook('post_local' , __FILE__, 'twitter_post_local'); - Addon::registerHook('notifier_normal' , __FILE__, 'twitter_post_hook'); - Addon::registerHook('jot_networks' , __FILE__, 'twitter_jot_nets'); - Addon::registerHook('cron' , __FILE__, 'twitter_cron'); - Addon::registerHook('queue_predeliver' , __FILE__, 'twitter_queue_hook'); - Addon::registerHook('follow' , __FILE__, 'twitter_follow'); - Addon::registerHook('expire' , __FILE__, 'twitter_expire'); - Addon::registerHook('prepare_body' , __FILE__, 'twitter_prepare_body'); - Addon::registerHook('check_item_notification', __FILE__, 'twitter_check_item_notification'); + Hook::register('load_config' , __FILE__, 'twitter_load_config'); + Hook::register('connector_settings' , __FILE__, 'twitter_settings'); + Hook::register('connector_settings_post', __FILE__, 'twitter_settings_post'); + Hook::register('hook_fork' , __FILE__, 'twitter_hook_fork'); + Hook::register('post_local' , __FILE__, 'twitter_post_local'); + Hook::register('notifier_normal' , __FILE__, 'twitter_post_hook'); + Hook::register('jot_networks' , __FILE__, 'twitter_jot_nets'); + Hook::register('cron' , __FILE__, 'twitter_cron'); + Hook::register('queue_predeliver' , __FILE__, 'twitter_queue_hook'); + Hook::register('follow' , __FILE__, 'twitter_follow'); + Hook::register('expire' , __FILE__, 'twitter_expire'); + Hook::register('prepare_body' , __FILE__, 'twitter_prepare_body'); + Hook::register('check_item_notification', __FILE__, 'twitter_check_item_notification'); Logger::log("installed twitter"); } function twitter_uninstall() { - Addon::unregisterHook('load_config' , __FILE__, 'twitter_load_config'); - Addon::unregisterHook('connector_settings' , __FILE__, 'twitter_settings'); - Addon::unregisterHook('connector_settings_post', __FILE__, 'twitter_settings_post'); - Addon::unregisterHook('hook_fork' , __FILE__, 'twitter_hook_fork'); - Addon::unregisterHook('post_local' , __FILE__, 'twitter_post_local'); - Addon::unregisterHook('notifier_normal' , __FILE__, 'twitter_post_hook'); - Addon::unregisterHook('jot_networks' , __FILE__, 'twitter_jot_nets'); - Addon::unregisterHook('cron' , __FILE__, 'twitter_cron'); - Addon::unregisterHook('queue_predeliver' , __FILE__, 'twitter_queue_hook'); - Addon::unregisterHook('follow' , __FILE__, 'twitter_follow'); - Addon::unregisterHook('expire' , __FILE__, 'twitter_expire'); - Addon::unregisterHook('prepare_body' , __FILE__, 'twitter_prepare_body'); - Addon::unregisterHook('check_item_notification', __FILE__, 'twitter_check_item_notification'); + Hook::unregister('load_config' , __FILE__, 'twitter_load_config'); + Hook::unregister('connector_settings' , __FILE__, 'twitter_settings'); + Hook::unregister('connector_settings_post', __FILE__, 'twitter_settings_post'); + Hook::unregister('hook_fork' , __FILE__, 'twitter_hook_fork'); + Hook::unregister('post_local' , __FILE__, 'twitter_post_local'); + Hook::unregister('notifier_normal' , __FILE__, 'twitter_post_hook'); + Hook::unregister('jot_networks' , __FILE__, 'twitter_jot_nets'); + Hook::unregister('cron' , __FILE__, 'twitter_cron'); + Hook::unregister('queue_predeliver' , __FILE__, 'twitter_queue_hook'); + Hook::unregister('follow' , __FILE__, 'twitter_follow'); + Hook::unregister('expire' , __FILE__, 'twitter_expire'); + Hook::unregister('prepare_body' , __FILE__, 'twitter_prepare_body'); + Hook::unregister('check_item_notification', __FILE__, 'twitter_check_item_notification'); // old setting - remove only - Addon::unregisterHook('post_local_end' , __FILE__, 'twitter_post_hook'); - Addon::unregisterHook('addon_settings' , __FILE__, 'twitter_settings'); - Addon::unregisterHook('addon_settings_post', __FILE__, 'twitter_settings_post'); + Hook::unregister('post_local_end' , __FILE__, 'twitter_post_hook'); + Hook::unregister('addon_settings' , __FILE__, 'twitter_settings'); + Hook::unregister('addon_settings_post', __FILE__, 'twitter_settings_post'); } function twitter_load_config(App $a) diff --git a/unicode_smilies/unicode_smilies.php b/unicode_smilies/unicode_smilies.php index faa553cc..f212dc75 100644 --- a/unicode_smilies/unicode_smilies.php +++ b/unicode_smilies/unicode_smilies.php @@ -5,15 +5,15 @@ * Version: 1.0 * Author: Michael Vogel */ -use Friendica\Core\Addon; use Friendica\Content\Smilies; +use Friendica\Core\Hook; function unicode_smilies_install() { - Addon::registerHook('smilie', 'addon/unicode_smilies/unicode_smilies.php', 'unicode_smilies_smilies'); + Hook::register('smilie', 'addon/unicode_smilies/unicode_smilies.php', 'unicode_smilies_smilies'); } function unicode_smilies_uninstall() { - Addon::unregisterHook('smilie', 'addon/unicode_smilies/unicode_smilies.php', 'unicode_smilies_smilies'); + Hook::unregister('smilie', 'addon/unicode_smilies/unicode_smilies.php', 'unicode_smilies_smilies'); } function unicode_smilies_smilies(&$a,&$b) { diff --git a/viewsrc/viewsrc.php b/viewsrc/viewsrc.php index 5d00888b..a890be2a 100644 --- a/viewsrc/viewsrc.php +++ b/viewsrc/viewsrc.php @@ -6,20 +6,20 @@ * Author: Mike Macgirvin * */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Model\Item; use Friendica\Database\DBA; function viewsrc_install() { - Addon::registerHook('item_photo_menu', 'addon/viewsrc/viewsrc.php', 'viewsrc_item_photo_menu'); - Addon::registerHook('page_end', 'addon/viewsrc/viewsrc.php', 'viewsrc_page_end'); + Hook::register('item_photo_menu', 'addon/viewsrc/viewsrc.php', 'viewsrc_item_photo_menu'); + Hook::register('page_end', 'addon/viewsrc/viewsrc.php', 'viewsrc_page_end'); } function viewsrc_uninstall() { - Addon::unregisterHook('item_photo_menu', 'addon/viewsrc/viewsrc.php', 'viewsrc_item_photo_menu'); - Addon::unregisterHook('page_end', 'addon/viewsrc/viewsrc.php', 'viewsrc_page_end'); + Hook::unregister('item_photo_menu', 'addon/viewsrc/viewsrc.php', 'viewsrc_item_photo_menu'); + Hook::unregister('page_end', 'addon/viewsrc/viewsrc.php', 'viewsrc_page_end'); } diff --git a/webrtc/webrtc.php b/webrtc/webrtc.php index 61bacfcd..026e3cc3 100644 --- a/webrtc/webrtc.php +++ b/webrtc/webrtc.php @@ -6,18 +6,18 @@ * Author: Stephen Mahood * Author: Tobias Diekershoff */ -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Renderer; use Friendica\Util\Strings; function webrtc_install() { - Addon::registerHook('app_menu', 'addon/webrtc/webrtc.php', 'webrtc_app_menu'); + Hook::register('app_menu', 'addon/webrtc/webrtc.php', 'webrtc_app_menu'); } function webrtc_uninstall() { - Addon::unregisterHook('app_menu', 'addon/webrtc/webrtc.php', 'webrtc_app_menu'); + Hook::unregister('app_menu', 'addon/webrtc/webrtc.php', 'webrtc_app_menu'); } diff --git a/widgets/widgets.php b/widgets/widgets.php index 48d32653..4cb28cd7 100644 --- a/widgets/widgets.php +++ b/widgets/widgets.php @@ -7,7 +7,7 @@ * Status: Unsupported */ -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -15,14 +15,14 @@ use Friendica\Core\Renderer; use Friendica\Database\DBA; function widgets_install() { - Addon::registerHook('addon_settings', 'addon/widgets/widgets.php', 'widgets_settings'); - Addon::registerHook('addon_settings_post', 'addon/widgets/widgets.php', 'widgets_settings_post'); + Hook::register('addon_settings', 'addon/widgets/widgets.php', 'widgets_settings'); + Hook::register('addon_settings_post', 'addon/widgets/widgets.php', 'widgets_settings_post'); Logger::log("installed widgets"); } function widgets_uninstall() { - Addon::unregisterHook('addon_settings', 'addon/widgets/widgets.php', 'widgets_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/widgets/widgets.php', 'widgets_settings_post'); + Hook::unregister('addon_settings', 'addon/widgets/widgets.php', 'widgets_settings'); + Hook::unregister('addon_settings_post', 'addon/widgets/widgets.php', 'widgets_settings_post'); } function widgets_settings_post(){ diff --git a/windowsphonepush/windowsphonepush.php b/windowsphonepush/windowsphonepush.php index 29501191..65fcc357 100644 --- a/windowsphonepush/windowsphonepush.php +++ b/windowsphonepush/windowsphonepush.php @@ -29,7 +29,6 @@ use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Content\Text\HTML; -use Friendica\Core\Addon; use Friendica\Core\Authentication; use Friendica\Core\Hook; use Friendica\Core\L10n; @@ -45,15 +44,15 @@ function windowsphonepush_install() * The first is within cron - so the push notifications will be * sent every 10 minutes (or whatever is set in crontab). */ - Addon::registerHook('cron', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_cron'); + Hook::register('cron', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_cron'); /* Then we'll attach into the addon settings page, and also the * settings post hook so that we can create and update * user preferences. User shall be able to activate the addon and * define whether he allows pushing first characters of item text */ - Addon::registerHook('addon_settings', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings'); - Addon::registerHook('addon_settings_post', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings_post'); + Hook::register('addon_settings', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings'); + Hook::register('addon_settings_post', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings_post'); Logger::log("installed windowsphonepush"); } @@ -63,9 +62,9 @@ function windowsphonepush_uninstall() /* uninstall unregisters any hooks created with register_hook * during install. Don't delete data in table `pconfig`. */ - Addon::unregisterHook('cron', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_cron'); - Addon::unregisterHook('addon_settings', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings_post'); + Hook::unregister('cron', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_cron'); + Hook::unregister('addon_settings', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings'); + Hook::unregister('addon_settings_post', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings_post'); Logger::log("removed windowsphonepush"); } diff --git a/wppost/wppost.php b/wppost/wppost.php index 1cc27976..0e95fcdd 100644 --- a/wppost/wppost.php +++ b/wppost/wppost.php @@ -6,10 +6,9 @@ * Author: Mike Macgirvin */ -use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Content\Text\HTML; -use Friendica\Core\Addon; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\PConfig; @@ -20,27 +19,27 @@ use Friendica\Util\XML; function wppost_install() { - Addon::registerHook('hook_fork', 'addon/wppost/wppost.php', 'wppost_hook_fork'); - Addon::registerHook('post_local', 'addon/wppost/wppost.php', 'wppost_post_local'); - Addon::registerHook('notifier_normal', 'addon/wppost/wppost.php', 'wppost_send'); - Addon::registerHook('jot_networks', 'addon/wppost/wppost.php', 'wppost_jot_nets'); - Addon::registerHook('connector_settings', 'addon/wppost/wppost.php', 'wppost_settings'); - Addon::registerHook('connector_settings_post', 'addon/wppost/wppost.php', 'wppost_settings_post'); + Hook::register('hook_fork', 'addon/wppost/wppost.php', 'wppost_hook_fork'); + Hook::register('post_local', 'addon/wppost/wppost.php', 'wppost_post_local'); + Hook::register('notifier_normal', 'addon/wppost/wppost.php', 'wppost_send'); + Hook::register('jot_networks', 'addon/wppost/wppost.php', 'wppost_jot_nets'); + Hook::register('connector_settings', 'addon/wppost/wppost.php', 'wppost_settings'); + Hook::register('connector_settings_post', 'addon/wppost/wppost.php', 'wppost_settings_post'); } function wppost_uninstall() { - Addon::unregisterHook('hook_fork', 'addon/wppost/wppost.php', 'wppost_hook_fork'); - Addon::unregisterHook('post_local', 'addon/wppost/wppost.php', 'wppost_post_local'); - Addon::unregisterHook('notifier_normal', 'addon/wppost/wppost.php', 'wppost_send'); - Addon::unregisterHook('jot_networks', 'addon/wppost/wppost.php', 'wppost_jot_nets'); - Addon::unregisterHook('connector_settings', 'addon/wppost/wppost.php', 'wppost_settings'); - Addon::unregisterHook('connector_settings_post', 'addon/wppost/wppost.php', 'wppost_settings_post'); + Hook::unregister('hook_fork', 'addon/wppost/wppost.php', 'wppost_hook_fork'); + Hook::unregister('post_local', 'addon/wppost/wppost.php', 'wppost_post_local'); + Hook::unregister('notifier_normal', 'addon/wppost/wppost.php', 'wppost_send'); + Hook::unregister('jot_networks', 'addon/wppost/wppost.php', 'wppost_jot_nets'); + Hook::unregister('connector_settings', 'addon/wppost/wppost.php', 'wppost_settings'); + Hook::unregister('connector_settings_post', 'addon/wppost/wppost.php', 'wppost_settings_post'); // obsolete - remove - Addon::unregisterHook('post_local_end', 'addon/wppost/wppost.php', 'wppost_send'); - Addon::unregisterHook('addon_settings', 'addon/wppost/wppost.php', 'wppost_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/wppost/wppost.php', 'wppost_settings_post'); + Hook::unregister('post_local_end', 'addon/wppost/wppost.php', 'wppost_send'); + Hook::unregister('addon_settings', 'addon/wppost/wppost.php', 'wppost_settings'); + Hook::unregister('addon_settings_post', 'addon/wppost/wppost.php', 'wppost_settings_post'); } diff --git a/xmpp/xmpp.php b/xmpp/xmpp.php index 51ad2c90..6b88ac04 100644 --- a/xmpp/xmpp.php +++ b/xmpp/xmpp.php @@ -7,8 +7,8 @@ */ use Friendica\App; -use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\Renderer; @@ -16,18 +16,18 @@ use Friendica\Util\Strings; function xmpp_install() { - Addon::registerHook('addon_settings', 'addon/xmpp/xmpp.php', 'xmpp_addon_settings'); - Addon::registerHook('addon_settings_post', 'addon/xmpp/xmpp.php', 'xmpp_addon_settings_post'); - Addon::registerHook('page_end', 'addon/xmpp/xmpp.php', 'xmpp_script'); - Addon::registerHook('logged_in', 'addon/xmpp/xmpp.php', 'xmpp_login'); + Hook::register('addon_settings', 'addon/xmpp/xmpp.php', 'xmpp_addon_settings'); + Hook::register('addon_settings_post', 'addon/xmpp/xmpp.php', 'xmpp_addon_settings_post'); + Hook::register('page_end', 'addon/xmpp/xmpp.php', 'xmpp_script'); + Hook::register('logged_in', 'addon/xmpp/xmpp.php', 'xmpp_login'); } function xmpp_uninstall() { - Addon::unregisterHook('addon_settings', 'addon/xmpp/xmpp.php', 'xmpp_addon_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/xmpp/xmpp.php', 'xmpp_addon_settings_post'); - Addon::unregisterHook('page_end', 'addon/xmpp/xmpp.php', 'xmpp_script'); - Addon::unregisterHook('logged_in', 'addon/xmpp/xmpp.php', 'xmpp_login'); + Hook::unregister('addon_settings', 'addon/xmpp/xmpp.php', 'xmpp_addon_settings'); + Hook::unregister('addon_settings_post', 'addon/xmpp/xmpp.php', 'xmpp_addon_settings_post'); + Hook::unregister('page_end', 'addon/xmpp/xmpp.php', 'xmpp_script'); + Hook::unregister('logged_in', 'addon/xmpp/xmpp.php', 'xmpp_login'); } function xmpp_addon_settings_post()