]> git.mxchange.org Git - friendica-addons.git/commitdiff
Addon class
authorAdam Magness <adam.magness@gmail.com>
Wed, 17 Jan 2018 00:51:12 +0000 (19:51 -0500)
committerAdam Magness <adam.magness@gmail.com>
Fri, 19 Jan 2018 12:20:17 +0000 (07:20 -0500)
plugin moved to Addon src class

81 files changed:
blackout/blackout.php
blockem/blockem.php
blogger/blogger.php
buffer/buffer.php
buglink/buglink.php
calc/calc.php
communityhome/communityhome.php
convert/convert.php
curweather/curweather.php
dav/friendica/main.php
diaspora/diaspora.php
dwpost/dwpost.php
fortunate/fortunate.php
forumdirectory/forumdirectory.php
fromapp/fromapp.php
fromgplus/fromgplus.php
geocoordinates/geocoordinates.php
geonames/geonames.php
gnot/gnot.php
googlemaps/googlemaps.php
gravatar/gravatar.php
group_text/group_text.php
ifttt/ifttt.php
ijpost/ijpost.php
impressum/impressum.php
infiniteimprobabilitydrive/infiniteimprobabilitydrive.php
irc/irc.php
jappixmini/jappixmini.php
js_upload/js_upload.php
krynn/krynn.php
langfilter/langfilter.php
ldapauth/ldapauth.php
leistungsschutzrecht/leistungsschutzrecht.php
libertree/libertree.php
libravatar/libravatar.php
ljpost/ljpost.php
mahjongg/mahjongg.php
mailstream/mailstream.php
mathjax/mathjax.php
membersince/membersince.php
morechoice/morechoice.php
morepokes/morepokes.php
namethingy/namethingy.php
newmemberwidget/newmemberwidget.php
notimeline/notimeline.php
nsfw/nsfw.php
numfriends/numfriends.php
openstreetmap/openstreetmap.php
pageheader/pageheader.php
piwik/piwik.php
planets/planets.php
pledgie/pledgie.php
public_server/public_server.php
pumpio/pumpio.php
qcomment/qcomment.php
randplace/randplace.php
remote_permissions/remote_permissions.php
rendertime/rendertime.php
securemail/securemail.php
showmore/showmore.php
smiley_pack/lang/smiley_pack_es/smiley_pack_es.php
smiley_pack/lang/smiley_pack_fr/smiley_pack_fr.php
smiley_pack/smiley_pack.php
smileybutton/smileybutton.php
smilies_adult/smilies_adult.php
sniper/sniper.php
startpage/startpage.php
statusnet/statusnet.php
superblock/superblock.php
testdrive/testdrive.php
tictac/tictac.php
tumblr/tumblr.php
twitter/twitter.php
unicode_smilies/unicode_smilies.php
viewsrc/viewsrc.php
webrtc/webrtc.php
widgets/widgets.php
windowsphonepush/windowsphonepush.php
wppost/wppost.php
xmpp/xmpp.php
yourls/yourls.php

index 2693db5a5fe5bb7a2b3508b82bc73ad1edbc5394..94e081ce3cf95cf3ad12de06a2af931612b47530 100644 (file)
  */
 
 use Friendica\Core\Config;
+use Friendica\Core\Addon;
 
 function blackout_install() {
-    register_hook('page_header', 'addon/blackout/blackout.php', 'blackout_redirect');
+    Addon::registerHook('page_header', 'addon/blackout/blackout.php', 'blackout_redirect');
 }
 
 function blackout_uninstall() {
-    unregister_hook('page_header', 'addon/blackout/blackout.php', 'blackout_redirect');
+    Addon::unregisterHook('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
index 2c91373f441f64ba4aef941dcaed73ae68a61b6c..2a2cd3d265b1a47d373fa09bef617ede73077701 100644 (file)
@@ -1,6 +1,4 @@
 <?php
-
-
 /**
  * Name: blockem
  * Description: block people
@@ -8,28 +6,28 @@
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
  *
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function blockem_install() {
-       register_hook('prepare_body', 'addon/blockem/blockem.php', 'blockem_prepare_body');
-       register_hook('display_item', 'addon/blockem/blockem.php', 'blockem_display_item');
-       register_hook('plugin_settings', 'addon/blockem/blockem.php', 'blockem_addon_settings');
-       register_hook('plugin_settings_post', 'addon/blockem/blockem.php', 'blockem_addon_settings_post');
-       register_hook('conversation_start', 'addon/blockem/blockem.php', 'blockem_conversation_start');
-       register_hook('item_photo_menu', 'addon/blockem/blockem.php', 'blockem_item_photo_menu');
-       register_hook('enotify_store', 'addon/blockem/blockem.php', 'blockem_enotify_store' );
+       Addon::registerHook('prepare_body', 'addon/blockem/blockem.php', 'blockem_prepare_body');
+       Addon::registerHook('display_item', 'addon/blockem/blockem.php', 'blockem_display_item');
+       Addon::registerHook('plugin_settings', 'addon/blockem/blockem.php', 'blockem_addon_settings');
+       Addon::registerHook('plugin_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' );
 }
 
 
 function blockem_uninstall() {
-       unregister_hook('prepare_body', 'addon/blockem/blockem.php', 'blockem_prepare_body');
-       unregister_hook('display_item', 'addon/blockem/blockem.php', 'blockem_display_item');
-       unregister_hook('plugin_settings', 'addon/blockem/blockem.php', 'blockem_addon_settings');
-       unregister_hook('plugin_settings_post', 'addon/blockem/blockem.php', 'blockem_addon_settings_post');
-       unregister_hook('conversation_start', 'addon/blockem/blockem.php', 'blockem_conversation_start');
-       unregister_hook('item_photo_menu', 'addon/blockem/blockem.php', 'blockem_item_photo_menu');
-       unregister_hook('enotify_store', 'addon/blockem/blockem.php', 'blockem_enotify_store' );
+       Addon::unregisterHook('prepare_body', 'addon/blockem/blockem.php', 'blockem_prepare_body');
+       Addon::unregisterHook('display_item', 'addon/blockem/blockem.php', 'blockem_display_item');
+       Addon::unregisterHook('plugin_settings', 'addon/blockem/blockem.php', 'blockem_addon_settings');
+       Addon::unregisterHook('plugin_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' );
 
 }
 
index 093d9049c934beac5491234f310b359c300b74d2..7c9e1c5d0b24d37ac3312933320d8784af52fd70 100644 (file)
@@ -1,33 +1,32 @@
 <?php
-
 /**
  * Name: Blogger Post Connector
  * Description: Post to Blogger (or anything else which uses blogger XMLRPC API)
  * Version: 1.0
  *
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function blogger_install() {
-       register_hook('post_local',           'addon/blogger/blogger.php', 'blogger_post_local');
-       register_hook('notifier_normal',      'addon/blogger/blogger.php', 'blogger_send');
-       register_hook('jot_networks',         'addon/blogger/blogger.php', 'blogger_jot_nets');
-       register_hook('connector_settings',      'addon/blogger/blogger.php', 'blogger_settings');
-       register_hook('connector_settings_post', 'addon/blogger/blogger.php', 'blogger_settings_post');
+       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');
 }
 
 function blogger_uninstall() {
-       unregister_hook('post_local',       'addon/blogger/blogger.php', 'blogger_post_local');
-       unregister_hook('notifier_normal',  'addon/blogger/blogger.php', 'blogger_send');
-       unregister_hook('jot_networks',     'addon/blogger/blogger.php', 'blogger_jot_nets');
-       unregister_hook('connector_settings',      'addon/blogger/blogger.php', 'blogger_settings');
-       unregister_hook('connector_settings_post', 'addon/blogger/blogger.php', 'blogger_settings_post');
+       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');
 
        // obsolete - remove
-       unregister_hook('post_local_end',   'addon/blogger/blogger.php', 'blogger_send');
-       unregister_hook('plugin_settings',  'addon/blogger/blogger.php', 'blogger_settings');
-       unregister_hook('plugin_settings_post',  'addon/blogger/blogger.php', 'blogger_settings_post');
+       Addon::unregisterHook('post_local_end',   'addon/blogger/blogger.php', 'blogger_send');
+       Addon::unregisterHook('plugin_settings',  'addon/blogger/blogger.php', 'blogger_settings');
+       Addon::unregisterHook('plugin_settings_post',  'addon/blogger/blogger.php', 'blogger_settings_post');
 }
 
 
index b90d90908364b199a42e16bb30068cbb7dff89c8..c788d4aa0817ea042c9f41e9bdef42b730411961 100644 (file)
@@ -8,23 +8,24 @@
 require 'addon/buffer/bufferapp.php';
 
 use Friendica\App;
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 
 function buffer_install() {
-       register_hook('post_local',           'addon/buffer/buffer.php', 'buffer_post_local');
-       register_hook('notifier_normal',      'addon/buffer/buffer.php', 'buffer_send');
-       register_hook('jot_networks',         'addon/buffer/buffer.php', 'buffer_jot_nets');
-       register_hook('connector_settings',      'addon/buffer/buffer.php', 'buffer_settings');
-       register_hook('connector_settings_post', 'addon/buffer/buffer.php', 'buffer_settings_post');
+       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');
 }
 
 function buffer_uninstall() {
-       unregister_hook('post_local',       'addon/buffer/buffer.php', 'buffer_post_local');
-       unregister_hook('notifier_normal',  'addon/buffer/buffer.php', 'buffer_send');
-       unregister_hook('jot_networks',     'addon/buffer/buffer.php', 'buffer_jot_nets');
-       unregister_hook('connector_settings',      'addon/buffer/buffer.php', 'buffer_settings');
-       unregister_hook('connector_settings_post', 'addon/buffer/buffer.php', 'buffer_settings_post');
+       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');
 }
 
 function buffer_module() {}
index 06eaddbb6a939032b66252759b23877449d3c1b2..5ffa68db461e5fb781989116f70a32e96721c332 100644 (file)
@@ -5,11 +5,11 @@
  * Version: 1.0
  * Author: Mike Macgirvin <mike@macgirvin.com>
  */
+use Friendica\Core\Addon;
 
+function buglink_install() { Addon::registerHook('page_end', 'addon/buglink/buglink.php', 'buglink_active'); }
 
-function buglink_install() { register_hook('page_end', 'addon/buglink/buglink.php', 'buglink_active'); }
 
-
-function buglink_uninstall() { unregister_hook('page_end', 'addon/buglink/buglink.php', 'buglink_active'); }
+function buglink_uninstall() { Addon::unregisterHook('page_end', 'addon/buglink/buglink.php', 'buglink_active'); }
 
 function buglink_active(&$a,&$b) { $b .= '<div id="buglink_wrapper" style="position: fixed; bottom: 5px; left: 5px;"><a href="https://github.com/friendica/friendica/issues" target="_blank" title="' . t('Report Bug') . '"><img src="addon/buglink/bug-x.gif" alt="' . t('Report Bug') . '" /></a></div>'; } 
index a299d45e94b518a5f9005d75f8e2ca2f9e0b270e..176ade85730e60ca58b73c84175aa946fbdd4fb3 100644 (file)
@@ -5,14 +5,14 @@
  * Version: 1.0\r
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>\r
  */\r
-\r
+use Friendica\Core\Addon;\r
 \r
 function calc_install() {\r
-       register_hook('app_menu', 'addon/calc/calc.php', 'calc_app_menu');\r
+       Addon::registerHook('app_menu', 'addon/calc/calc.php', 'calc_app_menu');\r
 }\r
 \r
 function calc_uninstall() {\r
-       unregister_hook('app_menu', 'addon/calc/calc.php', 'calc_app_menu');\r
+       Addon::unregisterHook('app_menu', 'addon/calc/calc.php', 'calc_app_menu');\r
 \r
 }\r
 \r
index 8364392bd2402726cf4c7562539db9647584b4ff..f3e4783edb73eb9cb6ee24df775bf3ba6cc4c326 100644 (file)
@@ -5,7 +5,7 @@
  * Version: 2.0
  * Author: Fabio Comuni <http://kirgroup.com/profile/fabrixxm>
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Module\Login;
 
@@ -13,12 +13,12 @@ require_once('mod/community.php');
 
 
 function communityhome_install() {
-       register_hook('home_content', 'addon/communityhome/communityhome.php', 'communityhome_home');
+       Addon::registerHook('home_content', 'addon/communityhome/communityhome.php', 'communityhome_home');
        logger("installed communityhome");
 }
 
 function communityhome_uninstall() {
-       unregister_hook('home_content', 'addon/communityhome/communityhome.php', 'communityhome_home');
+       Addon::unregisterHook('home_content', 'addon/communityhome/communityhome.php', 'communityhome_home');
        logger("removed communityhome");
 }
 
index 03b1e9d5a6fbde3effd817c1333df5a20761ebe8..1ddd29781e8864232429d433552ae375ab623d76 100644 (file)
@@ -5,13 +5,14 @@
  * Version: 1.0\r
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>\r
  */\r
+use Friendica\Core\Addon;\r
 \r
 function convert_install() {\r
-       register_hook('app_menu', 'addon/convert/convert.php', 'convert_app_menu');\r
+       Addon::registerHook('app_menu', 'addon/convert/convert.php', 'convert_app_menu');\r
 }\r
 \r
 function convert_uninstall() {\r
-       unregister_hook('app_menu', 'addon/convert/convert.php', 'convert_app_menu');\r
+       Addon::unregisterHook('app_menu', 'addon/convert/convert.php', 'convert_app_menu');\r
 }\r
 \r
 function convert_app_menu($a,&$b) {\r
index 7b8b89e3dc21bb6e4621c81fdce7ca7e0d7804bb..bcbba91d83981872f75a0b5614bfa3d655619620 100644 (file)
@@ -13,6 +13,7 @@ require_once('include/network.php');
 require_once("mod/proxy.php");
 require_once('include/text.php');
 
+use Friendica\Core\Addon;
 use Friendica\Core\Cache;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
@@ -66,15 +67,15 @@ function getWeather( $loc, $units='metric', $lang='en', $appid='', $cachetime=0)
 }
 
 function curweather_install() {
-       register_hook('network_mod_init', 'addon/curweather/curweather.php', 'curweather_network_mod_init');
-       register_hook('plugin_settings', 'addon/curweather/curweather.php', 'curweather_plugin_settings');
-       register_hook('plugin_settings_post', 'addon/curweather/curweather.php', 'curweather_plugin_settings_post');
+       Addon::registerHook('network_mod_init', 'addon/curweather/curweather.php', 'curweather_network_mod_init');
+       Addon::registerHook('plugin_settings', 'addon/curweather/curweather.php', 'curweather_plugin_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/curweather/curweather.php', 'curweather_plugin_settings_post');
 }
 
 function curweather_uninstall() {
-       unregister_hook('network_mod_init', 'addon/curweather/curweather.php', 'curweather_network_mod_init');
-       unregister_hook('plugin_settings', 'addon/curweather/curweather.php', 'curweather_plugin_settings');
-       unregister_hook('plugin_settings_post', 'addon/curweather/curweather.php', 'curweather_plugin_settings_post');
+       Addon::unregisterHook('network_mod_init', 'addon/curweather/curweather.php', 'curweather_network_mod_init');
+       Addon::unregisterHook('plugin_settings', 'addon/curweather/curweather.php', 'curweather_plugin_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/curweather/curweather.php', 'curweather_plugin_settings_post');
 }
 
 function curweather_network_mod_init(&$fk_app,&$b) {
index e1dfe84f8d884ee3143091423080ec3c23cf2771..afeadcf013cbfe27acebcd9af064563c57fc4ad6 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+use Friendica\Core\Addon;
 use Friendica\Module\Login;
 use Friendica\Util\Emailer;
 
@@ -7,19 +8,19 @@ require_once('include/security.php');
 
 function dav_install()
 {
-       register_hook('event_created', 'addon/dav/dav.php', 'dav_event_created_hook');
-       register_hook('event_updated', 'addon/dav/dav.php', 'dav_event_updated_hook');
-       register_hook('profile_tabs', 'addon/dav/dav.php', 'dav_profile_tabs_hook');
-       register_hook('cron', 'addon/dav/dav.php', 'dav_cron');
+       Addon::registerHook('event_created', 'addon/dav/dav.php', 'dav_event_created_hook');
+       Addon::registerHook('event_updated', 'addon/dav/dav.php', 'dav_event_updated_hook');
+       Addon::registerHook('profile_tabs', 'addon/dav/dav.php', 'dav_profile_tabs_hook');
+       Addon::registerHook('cron', 'addon/dav/dav.php', 'dav_cron');
 }
 
 
 function dav_uninstall()
 {
-       unregister_hook('event_created', 'addon/dav/dav.php', 'dav_event_created_hook');
-       unregister_hook('event_updated', 'addon/dav/dav.php', 'dav_event_updated_hook');
-       unregister_hook('profile_tabs', 'addon/dav/dav.php', 'dav_profile_tabs_hook');
-       unregister_hook('cron', 'addon/dav/dav.php', 'dav_cron');
+       Addon::unregisterHook('event_created', 'addon/dav/dav.php', 'dav_event_created_hook');
+       Addon::unregisterHook('event_updated', 'addon/dav/dav.php', 'dav_event_updated_hook');
+       Addon::unregisterHook('profile_tabs', 'addon/dav/dav.php', 'dav_profile_tabs_hook');
+       Addon::unregisterHook('cron', 'addon/dav/dav.php', 'dav_cron');
 }
 
 
index 3c4a30d2f7f5c77d9db6a8b5f51041175a08dfbf..7deb2b72a4878b192618863c28f5e57ed7672046 100644 (file)
@@ -9,24 +9,25 @@
 
 require_once("addon/diaspora/Diaspora_Connection.php");
 
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 use Friendica\Database\DBM;
 
 function diaspora_install() {
-       register_hook('post_local',           'addon/diaspora/diaspora.php', 'diaspora_post_local');
-       register_hook('notifier_normal',      'addon/diaspora/diaspora.php', 'diaspora_send');
-       register_hook('jot_networks',         'addon/diaspora/diaspora.php', 'diaspora_jot_nets');
-       register_hook('connector_settings',      'addon/diaspora/diaspora.php', 'diaspora_settings');
-       register_hook('connector_settings_post', 'addon/diaspora/diaspora.php', 'diaspora_settings_post');
-       register_hook('queue_predeliver', 'addon/diaspora/diaspora.php', 'diaspora_queue_hook');
+       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');
 }
 function diaspora_uninstall() {
-       unregister_hook('post_local',       'addon/diaspora/diaspora.php', 'diaspora_post_local');
-       unregister_hook('notifier_normal',  'addon/diaspora/diaspora.php', 'diaspora_send');
-       unregister_hook('jot_networks',     'addon/diaspora/diaspora.php', 'diaspora_jot_nets');
-       unregister_hook('connector_settings',      'addon/diaspora/diaspora.php', 'diaspora_settings');
-       unregister_hook('connector_settings_post', 'addon/diaspora/diaspora.php', 'diaspora_settings_post');
-       unregister_hook('queue_predeliver', 'addon/diaspora/diaspora.php', 'diaspora_queue_hook');
+       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');
 }
 
 
index b268d02ebce24604572c2e7a49bd042beba915ae..94d7937c8553b699af87b639d9f2215ed2c18108 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 /**
  * Name: Dreamwidth Post Connector
  * Description: Post to dreamwidth
@@ -8,23 +7,23 @@
  * Author: Michael Johnston
  * Author: Cat Gray <https://free-haven.org/profile/catness>
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function dwpost_install() {
-    register_hook('post_local',           'addon/dwpost/dwpost.php', 'dwpost_post_local');
-    register_hook('notifier_normal',      'addon/dwpost/dwpost.php', 'dwpost_send');
-    register_hook('jot_networks',         'addon/dwpost/dwpost.php', 'dwpost_jot_nets');
-    register_hook('connector_settings',      'addon/dwpost/dwpost.php', 'dwpost_settings');
-    register_hook('connector_settings_post', 'addon/dwpost/dwpost.php', 'dwpost_settings_post');
+       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');
 
 }
 function dwpost_uninstall() {
-    unregister_hook('post_local',       'addon/dwpost/dwpost.php', 'dwpost_post_local');
-    unregister_hook('notifier_normal',  'addon/dwpost/dwpost.php', 'dwpost_send');
-    unregister_hook('jot_networks',     'addon/dwpost/dwpost.php', 'dwpost_jot_nets');
-    unregister_hook('connector_settings',      'addon/dwpost/dwpost.php', 'dwpost_settings');
-    unregister_hook('connector_settings_post', 'addon/dwpost/dwpost.php', 'dwpost_settings_post');
+       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');
 
 }
 
index 427d620c20661a2f92ce8507c834f38d95d2b95d..8e28879c2624d4a82a42affb55d871dcb0b439e2 100644 (file)
@@ -5,20 +5,21 @@
  * Version: 1.0
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
  */
+use Friendica\Core\Addon;
 
 // IMPORTANT: SET THIS to your fortunate server
 
 define ('FORTUNATE_SERVER', 'hostname.com');
 
 function fortunate_install() {
-       register_hook('page_end', 'addon/fortunate/fortunate.php', 'fortunate_fetch');
+       Addon::registerHook('page_end', 'addon/fortunate/fortunate.php', 'fortunate_fetch');
        if(FORTUNATE_SERVER == 'hostname.com' && is_site_admin()) {
                notice('Fortunate plugin requires configuration. See README');
        }
 }
 
 function fortunate_uninstall() {
-       unregister_hook('page_end', 'addon/fortunate/fortunate.php', 'fortunate_fetch');
+       Addon::unregisterHook('page_end', 'addon/fortunate/fortunate.php', 'fortunate_fetch');
 }
 
 
index 393063cb03bd6a72681149ec6d18f22580429e27..186697f26a90835103c03e90bf1358adde58b320 100644 (file)
@@ -9,17 +9,16 @@
 
 use Friendica\Content\Nav;
 use Friendica\Content\Widget;
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Database\DBM;
 
-function forumdirectory_install()
-{
-       register_hook('app_menu', 'addon/forumdirectory/forumdirectory.php', 'forumdirectory_app_menu');
+function forumdirectory_install() {
+Addon::registerHook('app_menu', 'addon/forumdirectory/forumdirectory.php', 'forumdirectory_app_menu');
 }
 
-function forumdirectory_uninstall()
-{
-       unregister_hook('app_menu', 'addon/forumdirectory/forumdirectory.php', 'forumdirectory_app_menu');
+function forumdirectory_uninstall() {
+Addon::unregisterHook('app_menu', 'addon/forumdirectory/forumdirectory.php', 'forumdirectory_app_menu');
 }
 
 function forumdirectory_module()
index 51392ff57ba5500ffa0438ec15894983e9b20df0..4872e2a08aaad26e01edbc0740729fcf0b05c398 100644 (file)
@@ -6,14 +6,14 @@
  * Author: Commander Zot
  *
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function fromapp_install() {
 
-       register_hook('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook');
-       register_hook('plugin_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings');
-       register_hook('plugin_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post');
+       Addon::registerHook('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook');
+       Addon::registerHook('plugin_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post');
 
        logger("installed fromapp");
 }
@@ -21,9 +21,9 @@ function fromapp_install() {
 
 function fromapp_uninstall() {
 
-       unregister_hook('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook');
-       unregister_hook('plugin_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings');
-       unregister_hook('plugin_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post');
+       Addon::unregisterHook('post_local', 'addon/fromapp/fromapp.php', 'fromapp_post_hook');
+       Addon::unregisterHook('plugin_settings', 'addon/fromapp/fromapp.php', 'fromapp_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/fromapp/fromapp.php', 'fromapp_settings_post');
 
 
        logger("removed fromapp");
index 464829a4953a66e63a67418796a67c3b08475218..b8910d5df98aff349ea80971b7db672a38c66dff 100644 (file)
@@ -9,6 +9,7 @@
 
 define('FROMGPLUS_DEFAULT_POLL_INTERVAL', 30); // given in minutes
 
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Object\Image;
@@ -18,19 +19,19 @@ require_once 'mod/parse_url.php';
 require_once 'include/text.php';
 
 function fromgplus_install() {
-       register_hook('connector_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings');
-       register_hook('connector_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post');
-       register_hook('cron', 'addon/fromgplus/fromgplus.php', 'fromgplus_cron');
+       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');
 }
 
 function fromgplus_uninstall() {
-       unregister_hook('connector_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings');
-       unregister_hook('connector_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post');
-       unregister_hook('cron', 'addon/fromgplus/fromgplus.php', 'fromgplus_cron');
+       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');
 
        // Old hooks
-       unregister_hook('plugin_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings');
-       unregister_hook('plugin_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post');
+       Addon::unregisterHook('plugin_settings', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/fromgplus/fromgplus.php', 'fromgplus_addon_settings_post');
 }
 
 function fromgplus_addon_settings(&$a,&$s) {
index 0171f7c29390438dfc065549973831c1d7239d8e..714b8d81cbfca0d0a491979bf52518e7dc8bcb6c 100644 (file)
@@ -5,21 +5,21 @@
  * Version: 0.1
  * Author: Michael Vogel <https://pirati.ca/profile/heluecht>
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Cache;
 use Friendica\Core\Config;
 
 function geocoordinates_install()
 {
-       register_hook('post_local', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook');
-       register_hook('post_remote', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook');
+       Addon::registerHook('post_local', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook');
+       Addon::registerHook('post_remote', 'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook');
 }
 
 
 function geocoordinates_uninstall()
 {
-       unregister_hook('post_local',    'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook');
-       unregister_hook('post_remote',    'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook');
+       Addon::unregisterHook('post_local',    'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook');
+       Addon::unregisterHook('post_remote',    'addon/geocoordinates/geocoordinates.php', 'geocoordinates_post_hook');
 }
 
 function geocoordinates_resolve_item(&$item)
index 71e05c8b617553b8905b124c05483eaf254d3a75..55ae1920ba62c3309c1ca25e5ae36d186b62c835 100644 (file)
@@ -19,7 +19,7 @@
  * system will call the name_uninstall() function.
  *
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 
@@ -32,7 +32,7 @@ function geonames_install() {
         *
         */
 
-       register_hook('post_local', 'addon/geonames/geonames.php', 'geonames_post_hook');
+       Addon::registerHook('post_local', 'addon/geonames/geonames.php', 'geonames_post_hook');
 
        /**
         *
@@ -42,8 +42,8 @@ function geonames_install() {
         *
         */
 
-       register_hook('plugin_settings', 'addon/geonames/geonames.php', 'geonames_plugin_admin');
-       register_hook('plugin_settings_post', 'addon/geonames/geonames.php', 'geonames_plugin_admin_post');
+       Addon::registerHook('plugin_settings', 'addon/geonames/geonames.php', 'geonames_plugin_admin');
+       Addon::registerHook('plugin_settings_post', 'addon/geonames/geonames.php', 'geonames_plugin_admin_post');
 
        logger("installed geonames");
 }
@@ -59,9 +59,9 @@ function geonames_uninstall() {
         *
         */
 
-       unregister_hook('post_local',    'addon/geonames/geonames.php', 'geonames_post_hook');
-       unregister_hook('plugin_settings', 'addon/geonames/geonames.php', 'geonames_plugin_admin');
-       unregister_hook('plugin_settings_post', 'addon/geonames/geonames.php', 'geonames_plugin_admin_post');
+       Addon::unregisterHook('post_local',    'addon/geonames/geonames.php', 'geonames_post_hook');
+       Addon::unregisterHook('plugin_settings', 'addon/geonames/geonames.php', 'geonames_plugin_admin');
+       Addon::unregisterHook('plugin_settings_post', 'addon/geonames/geonames.php', 'geonames_plugin_admin_post');
 
 
        logger("removed geonames");
index bbdf9d80ebae83e6db5a175e8f1d278986d2470b..70f422b6a5c584b7a604955c20ac9a1d32cad41d 100644 (file)
@@ -7,14 +7,14 @@
  * 
  *
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function gnot_install() {
 
-       register_hook('plugin_settings', 'addon/gnot/gnot.php', 'gnot_settings');
-       register_hook('plugin_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post');
-       register_hook('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail');
+       Addon::registerHook('plugin_settings', 'addon/gnot/gnot.php', 'gnot_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post');
+       Addon::registerHook('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail');
 
        logger("installed gnot");
 }
@@ -22,9 +22,9 @@ function gnot_install() {
 
 function gnot_uninstall() {
 
-       unregister_hook('plugin_settings', 'addon/gnot/gnot.php', 'gnot_settings');
-       unregister_hook('plugin_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post');
-       unregister_hook('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail');
+       Addon::unregisterHook('plugin_settings', 'addon/gnot/gnot.php', 'gnot_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post');
+       Addon::unregisterHook('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail');
 
 
        logger("removed gnot");
index f5b573ac5a29787d68e1fc74e6bb482e71171950..e294c8e0e4e16a7155d6697a050df36f92d86e40 100644 (file)
@@ -6,19 +6,19 @@
  * Author: Michael Vogel <https://pirati.ca/profile/heluecht>
  *
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Cache;
 
 function googlemaps_install()
 {
-       register_hook('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location');
+       Addon::registerHook('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location');
 
        logger("installed googlemaps");
 }
 
 function googlemaps_uninstall()
 {
-       unregister_hook('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location');
+       Addon::unregisterHook('render_location', 'addon/googlemaps/googlemaps.php', 'googlemaps_location');
 
        logger("removed googlemaps");
 }
index e38fb613609665826038316dc4e7e1b8b5b10441..731129c0754e50d2c0c79b8e3ac5e0203717de6c 100644 (file)
@@ -5,14 +5,14 @@
  * Version: 1.1
  * Author: Klaus Weidenbach <http://friendica.dszdw.net/profile/klaus>
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 
 /**
  * Installs the plugin hook
  */
 function gravatar_install() {
-       register_hook('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup');
+       Addon::registerHook('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup');
 
        logger("registered gravatar in avatar_lookup hook");
 }
@@ -21,7 +21,7 @@ function gravatar_install() {
  * Removes the plugin hook
  */
 function gravatar_uninstall() {
-       unregister_hook('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup');
+       Addon::unregisterHook('avatar_lookup', 'addon/gravatar/gravatar.php', 'gravatar_lookup');
 
        logger("unregistered gravatar in avatar_lookup hook");
 }
index febb87a7a5748a81c28aa0ae8c1bd9a985e53fbb..27bd173bb4166cc606994c34aa9b5f98c01aeaeb 100644 (file)
@@ -4,16 +4,14 @@
  * Description: Disable images in group edit menu
  * Version: 1.0
  * Author: Thomas Willingham <https://kakste.com/profile/beardyunixer>
- * 
- *
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function group_text_install() {
 
-       register_hook('plugin_settings', 'addon/group_text/group_text.php', 'group_text_settings');
-       register_hook('plugin_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post');
+       Addon::registerHook('plugin_settings', 'addon/group_text/group_text.php', 'group_text_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post');
 
        logger("installed group_text");
 }
@@ -21,8 +19,8 @@ function group_text_install() {
 
 function group_text_uninstall() {
 
-       unregister_hook('plugin_settings', 'addon/group_text/group_text.php', 'group_text_settings');
-       unregister_hook('plugin_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post');
+       Addon::unregisterHook('plugin_settings', 'addon/group_text/group_text.php', 'group_text_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post');
 
 
        logger("removed group_text");
index 8a457df37aad16708a3b2e1790a2aae1e4a198ee..40cc5250c4f434af428c19ab7ef581f883358d04 100644 (file)
@@ -11,19 +11,20 @@ require_once 'include/items.php';
 require_once 'include/text.php';
 
 use Friendica\App;
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 use Friendica\Database\DBM;
 
 function ifttt_install()
 {
-       register_hook('connector_settings', 'addon/ifttt/ifttt.php', 'ifttt_settings');
-       register_hook('connector_settings_post', 'addon/ifttt/ifttt.php', 'ifttt_settings_post');
+       Addon::registerHook('connector_settings', 'addon/ifttt/ifttt.php', 'ifttt_settings');
+       Addon::registerHook('connector_settings_post', 'addon/ifttt/ifttt.php', 'ifttt_settings_post');
 }
 
 function ifttt_uninstall()
 {
-       unregister_hook('connector_settings', 'addon/ifttt/ifttt.php', 'ifttt_settings');
-       unregister_hook('connector_settings_post', 'addon/ifttt/ifttt.php', 'ifttt_settings_post');
+       Addon::unregisterHook('connector_settings', 'addon/ifttt/ifttt.php', 'ifttt_settings');
+       Addon::unregisterHook('connector_settings_post', 'addon/ifttt/ifttt.php', 'ifttt_settings_post');
 }
 
 function ifttt_module()
index ccd45fcaff436919dc107610bf04d04311ab2870..16c14a79126a479e6d86d63d5ee3664f6302b202 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 /**
  * Name: Insanejournal Post Connector
  * Description: Post to Insanejournal
@@ -8,23 +7,23 @@
  * Author: Michael Johnston
  * Author: Cat Gray <https://free-haven.org/profile/catness>
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function ijpost_install() {
-    register_hook('post_local',           'addon/ijpost/ijpost.php', 'ijpost_post_local');
-    register_hook('notifier_normal',      'addon/ijpost/ijpost.php', 'ijpost_send');
-    register_hook('jot_networks',         'addon/ijpost/ijpost.php', 'ijpost_jot_nets');
-    register_hook('connector_settings',      'addon/ijpost/ijpost.php', 'ijpost_settings');
-    register_hook('connector_settings_post', 'addon/ijpost/ijpost.php', 'ijpost_settings_post');
+    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');
 
 }
 function ijpost_uninstall() {
-    unregister_hook('post_local',       'addon/ijpost/ijpost.php', 'ijpost_post_local');
-    unregister_hook('notifier_normal',  'addon/ijpost/ijpost.php', 'ijpost_send');
-    unregister_hook('jot_networks',     'addon/ijpost/ijpost.php', 'ijpost_jot_nets');
-    unregister_hook('connector_settings',      'addon/ijpost/ijpost.php', 'ijpost_settings');
-    unregister_hook('connector_settings_post', 'addon/ijpost/ijpost.php', 'ijpost_settings_post');
+    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');
 
 }
 
index 75103dd1e644be3415e056556ce08f75f3fe73ef..15e338696836b05f9cc5882540f835968d6bbe91 100644 (file)
 require_once('include/bbcode.php');
 require_once('mod/proxy.php');
 
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 
 function impressum_install() {
-    register_hook('about_hook', 'addon/impressum/impressum.php', 'impressum_show');
-    register_hook('page_end', 'addon/impressum/impressum.php', 'impressum_footer');
+    Addon::registerHook('about_hook', 'addon/impressum/impressum.php', 'impressum_show');
+    Addon::registerHook('page_end', 'addon/impressum/impressum.php', 'impressum_footer');
     logger("installed impressum plugin");
 }
 
 function impressum_uninstall() {
-    unregister_hook('about_hook', 'addon/impressum/impressum.php', 'impressum_show');
-    unregister_hook('page_end', 'addon/impressum/impressum.php', 'impressum_footer');
+    Addon::unregisterHook('about_hook', 'addon/impressum/impressum.php', 'impressum_show');
+    Addon::unregisterHook('page_end', 'addon/impressum/impressum.php', 'impressum_footer');
     logger("uninstalled impressum plugin");
 }
 
index 5e46b3b7b6837b5df906896dbc208738ba932097..cdadf030c812dde338f626992899ecffce40bdb3 100644 (file)
@@ -5,13 +5,14 @@
 * Version: 1.0
 * Author: Thomas Willingham <https://kakste.com/profile/beardyunixer>
 */
+use Friendica\Core\Addon;
 
 function infiniteimprobabilitydrive_install() {
-register_hook('app_menu', 'addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php', 'infiniteimprobabilitydrive_app_menu');
+Addon::registerHook('app_menu', 'addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php', 'infiniteimprobabilitydrive_app_menu');
 }
 
 function infiniteimprobabilitydrive_uninstall() {
-unregister_hook('app_menu', 'addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php', 'infiniteimprobabilitydrive_app_menu');
+Addon::unregisterHook('app_menu', 'addon/infiniteimprobabilitydrive/infiniteimprobabilitydrive.php', 'infiniteimprobabilitydrive_app_menu');
 
 }
 
index cfede034dd8481fea9ba4f0902112b8729638273..e2fd50ba263b22d674b80b6bbc95b19636c10cd6 100644 (file)
@@ -6,19 +6,19 @@
 * Author: tony baldwin <https://free-haven.org/profile/tony>
 * Author: Tobias Diekershoff <https://f.diekershoff.de/u/tobias>
 */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 
 function irc_install() {
-       register_hook('app_menu', 'addon/irc/irc.php', 'irc_app_menu');
-       register_hook('plugin_settings', 'addon/irc/irc.php', 'irc_addon_settings');
-       register_hook('plugin_settings_post', 'addon/irc/irc.php', 'irc_addon_settings_post');
+       Addon::registerHook('app_menu', 'addon/irc/irc.php', 'irc_app_menu');
+       Addon::registerHook('plugin_settings', 'addon/irc/irc.php', 'irc_addon_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/irc/irc.php', 'irc_addon_settings_post');
 }
 
 function irc_uninstall() {
-       unregister_hook('app_menu', 'addon/irc/irc.php', 'irc_app_menu');
-       unregister_hook('plugin_settings', 'addon/irc/irc.php', 'irc_addon_settings');
+       Addon::unregisterHook('app_menu', 'addon/irc/irc.php', 'irc_app_menu');
+       Addon::unregisterHook('plugin_settings', 'addon/irc/irc.php', 'irc_addon_settings');
 
 }
 
index f42155fc8112955921a7189908942c50055d8b84..2e3cbc77f5fb100234f4fc1734caa391a4c007ee 100644 (file)
  */
 
 use Friendica\App;
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Model\User;
 
 function jappixmini_install()
 {
-       register_hook('plugin_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings');
-       register_hook('plugin_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post');
+       Addon::registerHook('plugin_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post');
 
-       register_hook('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script');
-       register_hook('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login');
+       Addon::registerHook('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script');
+       Addon::registerHook('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login');
 
-       register_hook('cron', 'addon/jappixmini/jappixmini.php', 'jappixmini_cron');
+       Addon::registerHook('cron', 'addon/jappixmini/jappixmini.php', 'jappixmini_cron');
 
        // Jappix source download as required by AGPL
-       register_hook('about_hook', 'addon/jappixmini/jappixmini.php', 'jappixmini_download_source');
+       Addon::registerHook('about_hook', 'addon/jappixmini/jappixmini.php', 'jappixmini_download_source');
 
        // set standard configuration
        $info_text = Config::get("jappixmini", "infotext");
@@ -103,15 +104,15 @@ function jappixmini_install()
 
 function jappixmini_uninstall()
 {
-       unregister_hook('plugin_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings');
-       unregister_hook('plugin_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post');
+       Addon::unregisterHook('plugin_settings', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/jappixmini/jappixmini.php', 'jappixmini_settings_post');
 
-       unregister_hook('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script');
-       unregister_hook('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login');
+       Addon::unregisterHook('page_end', 'addon/jappixmini/jappixmini.php', 'jappixmini_script');
+       Addon::unregisterHook('authenticate', 'addon/jappixmini/jappixmini.php', 'jappixmini_login');
 
-       unregister_hook('cron', 'addon/jappixmini/jappixmini.php', 'jappixmini_cron');
+       Addon::unregisterHook('cron', 'addon/jappixmini/jappixmini.php', 'jappixmini_cron');
 
-       unregister_hook('about_hook', 'addon/jappixmini/jappixmini.php', 'jappixmini_download_source');
+       Addon::unregisterHook('about_hook', 'addon/jappixmini/jappixmini.php', 'jappixmini_download_source');
 }
 
 function jappixmini_plugin_admin(App $a, &$o)
index cc3778cd85cc954890dd82bef81d646047f1f9c4..15393e8c5d3f5f0fbe762ebf1cf7a0818f999de1 100644 (file)
  * Module Author: Chris Case
  *
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 
 
 function js_upload_install() {
-       register_hook('photo_upload_form', 'addon/js_upload/js_upload.php', 'js_upload_form');
-       register_hook('photo_post_init',   'addon/js_upload/js_upload.php', 'js_upload_post_init');
-       register_hook('photo_post_file',   'addon/js_upload/js_upload.php', 'js_upload_post_file');
-       register_hook('photo_post_end',    'addon/js_upload/js_upload.php', 'js_upload_post_end');
+       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');
 }
 
 
 function js_upload_uninstall() {
-       unregister_hook('photo_upload_form', 'addon/js_upload/js_upload.php', 'js_upload_form');
-       unregister_hook('photo_post_init',   'addon/js_upload/js_upload.php', 'js_upload_post_init');
-       unregister_hook('photo_post_file',   'addon/js_upload/js_upload.php', 'js_upload_post_file');
-       unregister_hook('photo_post_end',    'addon/js_upload/js_upload.php', 'js_upload_post_end');
+       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');
 }
 
 
index 17e7d2b485cb9f6b3f6b0cc13e827b6fdde27caf..93082419c3535b4cd2dd4f121be002ffeaa92acf 100644 (file)
@@ -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\PConfig;
 
 function krynn_install() {
@@ -21,7 +21,7 @@ function krynn_install() {
         *
         */
 
-       register_hook('post_local', 'addon/krynn/krynn.php', 'krynn_post_hook');
+       Addon::registerHook('post_local', 'addon/krynn/krynn.php', 'krynn_post_hook');
 
        /**
         *
@@ -31,8 +31,8 @@ function krynn_install() {
         *
         */
 
-       register_hook('plugin_settings', 'addon/krynn/krynn.php', 'krynn_settings');
-       register_hook('plugin_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
+       Addon::registerHook('plugin_settings', 'addon/krynn/krynn.php', 'krynn_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
 
        logger("installed krynn");
 }
@@ -48,9 +48,9 @@ function krynn_uninstall() {
         *
         */
 
-       unregister_hook('post_local',    'addon/krynn/krynn.php', 'krynn_post_hook');
-       unregister_hook('plugin_settings', 'addon/krynn/krynn.php', 'krynn_settings');
-       unregister_hook('plugin_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
+       Addon::unregisterHook('post_local',    'addon/krynn/krynn.php', 'krynn_post_hook');
+       Addon::unregisterHook('plugin_settings', 'addon/krynn/krynn.php', 'krynn_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/krynn/krynn.php', 'krynn_settings_post');
 
 
        logger("removed krynn");
index e8e9097542bf83ffef35af9eb11908bbe9b9dd4d..4bc1b23200d699ec1c5254f5203f80c2f622a225 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 use Friendica\App;
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 /* Define the hooks we want to use
@@ -18,16 +19,16 @@ use Friendica\Core\PConfig;
 
 function langfilter_install()
 {
-       register_hook('prepare_body', 'addon/langfilter/langfilter.php', 'langfilter_prepare_body', 10);
-       register_hook('plugin_settings', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings');
-       register_hook('plugin_settings_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post');
+       Addon::registerHook('prepare_body', 'addon/langfilter/langfilter.php', 'langfilter_prepare_body', 10);
+       Addon::registerHook('plugin_settings', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post');
 }
 
 function langfilter_uninstall()
 {
-       unregister_hook('prepare_body', 'addon/langfilter/langfilter.php', 'langfilter_prepare_body');
-       unregister_hook('plugin_settings', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings');
-       unregister_hook('plugin_settings_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post');
+       Addon::unregisterHook('prepare_body', 'addon/langfilter/langfilter.php', 'langfilter_prepare_body');
+       Addon::unregisterHook('plugin_settings', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/langfilter/langfilter.php', 'langfilter_addon_settings_post');
 }
 
 /* The settings
index f6cb42b6107d3e68805b97844593490e337e1f70..d06874b7cbfaf1696e7a0416a4ee0c7ee28c2573 100644 (file)
  *
  * ...etc.
  */
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Model\User;
 
 function ldapauth_install()
 {
-       register_hook('authenticate', 'addon/ldapauth/ldapauth.php', 'ldapauth_hook_authenticate');
+       Addon::registerHook('authenticate', 'addon/ldapauth/ldapauth.php', 'ldapauth_hook_authenticate');
 }
 
 function ldapauth_uninstall()
 {
-       unregister_hook('authenticate', 'addon/ldapauth/ldapauth.php', 'ldapauth_hook_authenticate');
+       Addon::unregisterHook('authenticate', 'addon/ldapauth/ldapauth.php', 'ldapauth_hook_authenticate');
 }
 
 function ldapauth_hook_authenticate($a, &$b)
index 91d35834939058a6e6ec3b160a642f79e4b66ba6..f5cee1170bba5d89a8e70ee58ec0ee23572cf44f 100644 (file)
@@ -5,20 +5,20 @@
  * Version: 0.1
  * Author: Michael Vogel <https://pirati.ca/profile/heluecht>
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 
 function leistungsschutzrecht_install() {
-       register_hook('cron', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_cron');
-       register_hook('getsiteinfo', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_getsiteinfo');
-       register_hook('page_info_data', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_getsiteinfo');
+       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');
 }
 
 
 function leistungsschutzrecht_uninstall() {
-       unregister_hook('cron', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_cron');
-       unregister_hook('getsiteinfo', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_getsiteinfo');
-       unregister_hook('page_info_data', 'addon/leistungsschutzrecht/leistungsschutzrecht.php', 'leistungsschutzrecht_getsiteinfo');
+       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');
 }
 
 function leistungsschutzrecht_getsiteinfo($a, &$siteinfo) {
index 0b9f839b72b408d11d6e3f3a354ab225e2986175..2909a8efb991054e37332b39af6f0f285a5f70ef 100644 (file)
@@ -6,23 +6,23 @@
  * Version: 1.0
  * Author: Tony Baldwin <https://free-haven.org/u/tony>
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function libertree_install() {
-    register_hook('post_local',           'addon/libertree/libertree.php', 'libertree_post_local');
-    register_hook('notifier_normal',      'addon/libertree/libertree.php', 'libertree_send');
-    register_hook('jot_networks',         'addon/libertree/libertree.php', 'libertree_jot_nets');
-    register_hook('connector_settings',      'addon/libertree/libertree.php', 'libertree_settings');
-    register_hook('connector_settings_post', 'addon/libertree/libertree.php', 'libertree_settings_post');
+    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');
 
 }
 function libertree_uninstall() {
-    unregister_hook('post_local',       'addon/libertree/libertree.php', 'libertree_post_local');
-    unregister_hook('notifier_normal',  'addon/libertree/libertree.php', 'libertree_send');
-    unregister_hook('jot_networks',     'addon/libertree/libertree.php', 'libertree_jot_nets');
-    unregister_hook('connector_settings',      'addon/libertree/libertree.php', 'libertree_settings');
-    unregister_hook('connector_settings_post', 'addon/libertree/libertree.php', 'libertree_settings_post');
+    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');
 }
 
 
index 891b0b47289a6b9add407352ae92355263f89af0..3979416f154f8ee74d6c549c2e20dec77b049a11 100644 (file)
@@ -5,7 +5,7 @@
  * Version: 1.1
  * Author: Klaus Weidenbach <http://friendica.dszdw.net/profile/klaus>
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 
 /**
@@ -17,7 +17,7 @@ function libravatar_install() {
                // avoid registering the hook
                return false;
        }
-       register_hook('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup');
+       Addon::registerHook('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup');
 
        logger("registered libravatar in avatar_lookup hook");
 }
@@ -26,7 +26,7 @@ function libravatar_install() {
  * Removes the plugin hook
  */
 function libravatar_uninstall() {
-       unregister_hook('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup');
+       Addon::unregisterHook('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup');
 
        logger("unregistered libravatar in avatar_lookup hook");
 }
index 1d5703e1571a432c1dee2d75d75fb0892c54e78a..6f3585305096eeb05c37bc0851dd9b955d25463d 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 /**
  * Name: LiveJournal Post Connector
  * Description: Post to LiveJournal
@@ -8,23 +7,23 @@
  * Author: Michael Johnston
  * Author: Cat Gray <https://free-haven.org/profile/catness>
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function ljpost_install() {
-    register_hook('post_local',           'addon/ljpost/ljpost.php', 'ljpost_post_local');
-    register_hook('notifier_normal',      'addon/ljpost/ljpost.php', 'ljpost_send');
-    register_hook('jot_networks',         'addon/ljpost/ljpost.php', 'ljpost_jot_nets');
-    register_hook('connector_settings',      'addon/ljpost/ljpost.php', 'ljpost_settings');
-    register_hook('connector_settings_post', 'addon/ljpost/ljpost.php', 'ljpost_settings_post');
+    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');
 
 }
 function ljpost_uninstall() {
-    unregister_hook('post_local',       'addon/ljpost/ljpost.php', 'ljpost_post_local');
-    unregister_hook('notifier_normal',  'addon/ljpost/ljpost.php', 'ljpost_send');
-    unregister_hook('jot_networks',     'addon/ljpost/ljpost.php', 'ljpost_jot_nets');
-    unregister_hook('connector_settings',      'addon/ljpost/ljpost.php', 'ljpost_settings');
-    unregister_hook('connector_settings_post', 'addon/ljpost/ljpost.php', 'ljpost_settings_post');
+    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');
 
 }
 
index 977c693d765d4c510528a1ba66654a199d02dab0..3567792b4df645f35878dd817778678c7d2181d0 100644 (file)
@@ -6,14 +6,14 @@
  * Version: 1.0\r
  * Author: Holger Froese\r
  */\r
-\r
+use Friendica\Core\Addon;\r
 \r
 function mahjongg_install() {\r
-    register_hook('app_menu', 'addon/mahjongg/mahjongg.php', 'mahjongg_app_menu');\r
+    Addon::registerHook('app_menu', 'addon/mahjongg/mahjongg.php', 'mahjongg_app_menu');\r
 }\r
 \r
 function mahjongg_uninstall() {\r
-    unregister_hook('app_menu', 'addon/mahjongg/mahjongg.php', 'mahjongg_app_menu');\r
+    Addon::unregisterHook('app_menu', 'addon/mahjongg/mahjongg.php', 'mahjongg_app_menu');\r
 \r
 }\r
 \r
index 673643659f626c1e3cd88949e75f4e5eb5fde306..c427ae76158b1181072a773c9b7a8143bc0110bf 100644 (file)
@@ -5,17 +5,17 @@
  * Version: 1.1
  * Author: Matthew Exon <http://mat.exon.name>
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Database\DBM;
 
 function mailstream_install() {
-       register_hook('plugin_settings', 'addon/mailstream/mailstream.php', 'mailstream_plugin_settings');
-       register_hook('plugin_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_plugin_settings_post');
-       register_hook('post_local_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook');
-       register_hook('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook');
-       register_hook('cron', 'addon/mailstream/mailstream.php', 'mailstream_cron');
+       Addon::registerHook('plugin_settings', 'addon/mailstream/mailstream.php', 'mailstream_plugin_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_plugin_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');
 
        if (Config::get('mailstream', 'dbversion') == '0.1') {
                q('ALTER TABLE `mailstream_item` DROP INDEX `uid`');
@@ -52,16 +52,16 @@ function mailstream_install() {
 }
 
 function mailstream_uninstall() {
-       unregister_hook('plugin_settings', 'addon/mailstream/mailstream.php', 'mailstream_plugin_settings');
-       unregister_hook('plugin_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_plugin_settings_post');
-       unregister_hook('post_local', 'addon/mailstream/mailstream.php', 'mailstream_post_local_hook');
-       unregister_hook('post_remote', 'addon/mailstream/mailstream.php', 'mailstream_post_remote_hook');
-       unregister_hook('post_local_end', 'addon/mailstream/mailstream.php', 'mailstream_post_local_hook');
-       unregister_hook('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_remote_hook');
-       unregister_hook('post_local_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook');
-       unregister_hook('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook');
-       unregister_hook('cron', 'addon/mailstream/mailstream.php', 'mailstream_cron');
-       unregister_hook('incoming_mail', 'addon/mailstream/mailstream.php', 'mailstream_incoming_mail');
+       Addon::unregisterHook('plugin_settings', 'addon/mailstream/mailstream.php', 'mailstream_plugin_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_plugin_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');
 }
 
 function mailstream_module() {}
index 2a7bc89c221281160a4c2ef667e3e9dc156c660b..fc18b51d7e0654ba84904e9c27bdad07b193dc41 100644 (file)
@@ -7,20 +7,20 @@
  * Author: Tobias Diekershoff <https://f.diekershoff.de/profile/tobias>
  * License: 3-clause BSD license
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 
 function mathjax_install() {
-    register_hook('page_header', 'addon/mathjax/mathjax.php', 'mathjax_page_header');
-    register_hook('plugin_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings');
-    register_hook('plugin_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post');
+    Addon::registerHook('page_header', 'addon/mathjax/mathjax.php', 'mathjax_page_header');
+    Addon::registerHook('plugin_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings');
+    Addon::registerHook('plugin_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post');
     logger('installed js_math plugin');
 }
 function mathjax_uninstall() {
-    unregister_hook('page_header', 'addon/mathjax/mathjax.php', 'mathjax_page_header');
-    unregister_hook('plugin_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings');
-    unregister_hook('plugin_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post');
+    Addon::unregisterHook('page_header', 'addon/mathjax/mathjax.php', 'mathjax_page_header');
+    Addon::unregisterHook('plugin_settings', 'addon/mathjax/mathjax.php', 'mathjax_settings');
+    Addon::unregisterHook('plugin_settings_post', 'addon/mathjax/mathjax.php', 'mathjax_settings_post');
 }
 function mathjax_settings_post ($a, $post) {
     if (! local_user())
index c995c54bf9281d29014b5d9b36150816a6aeec57..3b454fa3df41961952fd49d1f37c6ef4b9ade60c 100644 (file)
@@ -7,12 +7,13 @@
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
  * 
  */
+use Friendica\Core\Addon;
 
 require_once('include/datetime.php');
 
-function membersince_install(){ register_hook('profile_advanced','addon/membersince/membersince.php','membersince_display'); }
+function membersince_install(){ Addon::registerHook('profile_advanced','addon/membersince/membersince.php','membersince_display'); }
 
-function membersince_uninstall(){ unregister_hook('profile_advanced','addon/membersince/membersince.php','membersince_display'); }
+function membersince_uninstall(){ Addon::unregisterHook('profile_advanced','addon/membersince/membersince.php','membersince_display'); }
 
 function membersince_display(&$a,&$b) { 
 $b = preg_replace('/<\/dl>/',"</dl>\n\n\n<dl id=\"aprofile-membersince\" class=\"aprofile\">\n<dt>" . t('Member since:') . "</dt>\n<dd>" . datetime_convert('UTC',date_default_timezone_get(),$a->profile['register_date']) . "</dd>\n</dl>" ,$b, 1); 
index d22ec3aaf1dbfe3ab7e8e7c629e3d4303d996fb9..b8a170a1b4678cc5f1fa18ba7daeb8bb015f42af 100644 (file)
@@ -7,24 +7,24 @@
  *    - who takes no responsibility for any additional content which may appear herein
  *
  */
-
+use Friendica\Core\Addon;
 
 function morechoice_install() {
 
-       register_hook('gender_selector', 'addon/morechoice/morechoice.php', 'morechoice_gender_selector');
-       register_hook('sexpref_selector', 'addon/morechoice/morechoice.php', 'morechoice_sexpref_selector');
-       register_hook('marital_selector', 'addon/morechoice/morechoice.php', 'morechoice_marital_selector');
+       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');
 }
 
 
 function morechoice_uninstall() {
 
-       unregister_hook('gender_selector', 'addon/morechoice/morechoice.php', 'morechoice_gender_selector');
-       unregister_hook('sexpref_selector', 'addon/morechoice/morechoice.php', 'morechoice_sexpref_selector');
-       unregister_hook('marital_selector', 'addon/morechoice/morechoice.php', 'morechoice_marital_selector');
+       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');
 
 // We need to leave this here for a while, because we now have a situation where people can end up with an orphaned hook.
-       unregister_hook('poke_verbs', 'addon/morechoice/morechoice.php', 'morechoice_poke_verbs');
+       Addon::unregisterHook('poke_verbs', 'addon/morechoice/morechoice.php', 'morechoice_poke_verbs');
 
 }
 
index 9fd1a43e8a2d36baede00fe2e00b0a9323653cc1..946a486ac50284189e5640de73f9079ed4984768 100644 (file)
@@ -6,13 +6,14 @@
  * Author: Thomas Willingham <https://kakste.com/profile/beardyunixer>
  *
  */
+use Friendica\Core\Addon;
 
 function morepokes_install() {
-         register_hook('poke_verbs', 'addon/morepokes/morepokes.php', 'morepokes_poke_verbs');
+         Addon::registerHook('poke_verbs', 'addon/morepokes/morepokes.php', 'morepokes_poke_verbs');
 }
 
 function morepokes_uninstall() {
-         unregister_hook('poke_verbs', 'addon/morepokes/morepokes.php', 'morepokes_poke_verbs');
+         Addon::unregisterHook('poke_verbs', 'addon/morepokes/morepokes.php', 'morepokes_poke_verbs');
 }
 
 function morepokes_poke_verbs($a,&$b) {
index 0ccf106c0c265bec55bf72efe05129928a68c31c..b5faf9fd2854d8173c347d2d5c42c9e5cce4dfe9 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 /**
  *
  * Name: NameThingy
@@ -7,14 +6,14 @@
  * Version: 1.0
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
  */
-
+use Friendica\Core\Addon;
 
 function namethingy_install() {
-    register_hook('app_menu', 'addon/namethingy/namethingy.php', 'namethingy_app_menu');
+    Addon::registerHook('app_menu', 'addon/namethingy/namethingy.php', 'namethingy_app_menu');
 }
 
 function namethingy_uninstall() {
-    unregister_hook('app_menu', 'addon/namethingy/namethingy.php', 'namethingy_app_menu');
+    Addon::unregisterHook('app_menu', 'addon/namethingy/namethingy.php', 'namethingy_app_menu');
 
 }
 
index 41e4e0d595257c1de9052b656e8825c0e7b4259a..b912b0744ab49c41e73dda6434d3402e82fbc6b5 100644 (file)
@@ -9,14 +9,15 @@
 
 require_once('include/bbcode.php');
 
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 
 function newmemberwidget_install () {
-    register_hook( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init');
+    Addon::registerHook( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init');
     logger('newmemberwidget installed');
 }
 function newmemberwidget_uninstall () {
-    unregister_hook( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init');
+    Addon::unregisterHook( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init');
 }
 
 function newmemberwidget_network_mod_init ( $a, $b) {
index dcf9693542f38cd065a8932ad9695bb9b98d0b22..bc06f78bd36e5ae971abf11d0649e05106ee38fd 100644 (file)
@@ -7,20 +7,20 @@
  * 
  *
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function notimeline_install() {
 
-       register_hook('plugin_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings');
-       register_hook('plugin_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post');
+       Addon::registerHook('plugin_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post');
 
 }
 
 
 function notimeline_uninstall() {
-       unregister_hook('plugin_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings');
-       unregister_hook('plugin_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post');
+       Addon::unregisterHook('plugin_settings', 'addon/notimeline/notimeline.php', 'notimeline_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/notimeline/notimeline.php', 'notimeline_settings_post');
 
 }
 
index 6592738de2daf5055641c4defceac6ac404c0456..7c37fc2e87cdc23a3d5a91a86da615642373286e 100644 (file)
@@ -1,6 +1,4 @@
 <?php
-
-
 /**
  * Name: NSFW
  * Description: Collapse posts with inappropriate content
@@ -8,21 +6,21 @@
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
  *
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function nsfw_install() {
-       register_hook('prepare_body', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body', 10);
-       register_hook('plugin_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings');
-       register_hook('plugin_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post');
+       Addon::registerHook('prepare_body', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body', 10);
+       Addon::registerHook('plugin_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post');
 
 }
 
 
 function nsfw_uninstall() {
-       unregister_hook('prepare_body', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body');
-       unregister_hook('plugin_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings');
-       unregister_hook('plugin_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post');
+       Addon::unregisterHook('prepare_body', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body');
+       Addon::unregisterHook('plugin_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post');
 
 }
 
index 98295bfbb2e332b8cdc3d298c1ddf8ad01cebaf0..9e3463c377e2c1854e93e076c0ecbd253041e5d2 100644 (file)
@@ -4,16 +4,14 @@
  * Description: Change number of contacts shown of profile sidebar
  * Version: 1.0
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
- * 
- *
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function numfriends_install() {
 
-       register_hook('plugin_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings');
-       register_hook('plugin_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post');
+       Addon::registerHook('plugin_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post');
 
        logger("installed numfriends");
 }
@@ -21,8 +19,8 @@ function numfriends_install() {
 
 function numfriends_uninstall() {
 
-       unregister_hook('plugin_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings');
-       unregister_hook('plugin_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post');
+       Addon::unregisterHook('plugin_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post');
 
 
        logger("removed numfriends");
index ae9cb4802381fcac756bbd7613881512a9888dc1..d61d0020ddfa2cdc636dce3493f2b64695a3c430 100644 (file)
@@ -8,27 +8,27 @@
  * Author: Klaus Weidenbach
  *
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Cache;
 use Friendica\Core\Config;
 
 
 function openstreetmap_install()
 {
-       register_hook('render_location', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_location');
-       register_hook('generate_map', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_generate_map');
-       register_hook('generate_named_map', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_generate_named_map');
-       register_hook('page_header', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_alterheader');
+       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('page_header', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_alterheader');
 
        logger("installed openstreetmap");
 }
 
 function openstreetmap_uninstall()
 {
-       unregister_hook('render_location', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_location');
-       unregister_hook('generate_map', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_generate_map');
-       unregister_hook('generate_named_map', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_generate_named_map');
-       unregister_hook('page_header', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_alterheader');
+       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('page_header', 'addon/openstreetmap/openstreetmap.php', 'openstreetmap_alterheader');
 
        logger("removed openstreetmap");
 }
index 977bee4ede99a9fa931c1dc39f4629de2f597d74..0a29310397e2a2247eaa95c6b8ab06c81174fd60 100644 (file)
@@ -1,6 +1,4 @@
 <?php
-
-
 /**
  * Name: Page Header
  * Description: Inserts a page header
@@ -9,24 +7,24 @@
  *         Hauke Altmann <https://snarl.de/profile/tugelblend>
  * 
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 
 function pageheader_install() {
-    register_hook('page_content_top', 'addon/pageheader/pageheader.php', 'pageheader_fetch');
-       register_hook('plugin_settings', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings');
-       register_hook('plugin_settings_post', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings_post');
+    Addon::registerHook('page_content_top', 'addon/pageheader/pageheader.php', 'pageheader_fetch');
+       Addon::registerHook('plugin_settings', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings_post');
 
 }
 
 
 function pageheader_uninstall() {
-    unregister_hook('page_content_top', 'addon/pageheader/pageheader.php', 'pageheader_fetch');
-       unregister_hook('plugin_settings', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings');
-       unregister_hook('plugin_settings_post', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings_post');
+    Addon::unregisterHook('page_content_top', 'addon/pageheader/pageheader.php', 'pageheader_fetch');
+       Addon::unregisterHook('plugin_settings', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/pageheader/pageheader.php', 'pageheader_addon_settings_post');
 
        // hook moved, uninstall the old one if still there. 
-    unregister_hook('page_header', 'addon/pageheader/pageheader.php', 'pageheader_fetch');
+    Addon::unregisterHook('page_header', 'addon/pageheader/pageheader.php', 'pageheader_fetch');
 
 }
 
index 8253f4a7a43346dcb89198035eb4d010feaa4e5c..ddba2dd91dd67702fff6f722f9844eb7b56bf3ba 100644 (file)
  *     about http/https but beware to put the trailing / at the end of your
  *     setting.
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 
 function piwik_install() {
-       register_hook('page_end', 'addon/piwik/piwik.php', 'piwik_analytics');
+       Addon::registerHook('page_end', 'addon/piwik/piwik.php', 'piwik_analytics');
 
        logger("installed piwik plugin");
 }
 
 function piwik_uninstall() {
-       unregister_hook('page_end', 'addon/piwik/piwik.php', 'piwik_analytics');
+       Addon::unregisterHook('page_end', 'addon/piwik/piwik.php', 'piwik_analytics');
 
        logger("uninstalled piwik plugin");
 }
index 0d88e21dc48f8a5147be4315d7a88176048cc6e7..794d1f0238bd03fb06102f95ee78c1248951d667 100644 (file)
@@ -6,7 +6,7 @@
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
  * Author: Tony Baldwin <https://free-haven.org/profile/tony>
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function planets_install() {
@@ -18,7 +18,7 @@ function planets_install() {
         *
         */
 
-       register_hook('post_local', 'addon/planets/planets.php', 'planets_post_hook');
+       Addon::registerHook('post_local', 'addon/planets/planets.php', 'planets_post_hook');
 
        /**
         *
@@ -28,8 +28,8 @@ function planets_install() {
         *
         */
 
-       register_hook('plugin_settings', 'addon/planets/planets.php', 'planets_settings');
-       register_hook('plugin_settings_post', 'addon/planets/planets.php', 'planets_settings_post');
+       Addon::registerHook('plugin_settings', 'addon/planets/planets.php', 'planets_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/planets/planets.php', 'planets_settings_post');
 
        logger("installed planets");
 }
@@ -45,9 +45,9 @@ function planets_uninstall() {
         *
         */
 
-       unregister_hook('post_local',    'addon/planets/planets.php', 'planets_post_hook');
-       unregister_hook('plugin_settings', 'addon/planets/planets.php', 'planets_settings');
-       unregister_hook('plugin_settings_post', 'addon/planets/planets.php', 'planets_settings_post');
+       Addon::unregisterHook('post_local',    'addon/planets/planets.php', 'planets_post_hook');
+       Addon::unregisterHook('plugin_settings', 'addon/planets/planets.php', 'planets_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/planets/planets.php', 'planets_settings_post');
 
 
        logger("removed planets");
index 6183c76dfa0d756f4a673670b9cf9cf13bf5b3c9..27897e52974c767927d5ac133deac7b183af7073 100644 (file)
@@ -7,19 +7,19 @@
  *         Hauke Altmann <https://snarl.de/profile/tugelblend>
  *      
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 
 function pledgie_install() { 
-       register_hook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active'); 
-       register_hook('plugin_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings');
-       register_hook('plugin_settings_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post');
+       Addon::registerHook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active'); 
+       Addon::registerHook('plugin_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post');
 }
 
 function pledgie_uninstall() { 
-       unregister_hook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active');
-       unregister_hook('plugin_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings');
-       unregister_hook('plugin_settings_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post');
+       Addon::unregisterHook('page_end', 'addon/pledgie/pledgie.php', 'pledgie_active');
+       Addon::unregisterHook('plugin_settings', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/pledgie/pledgie.php', 'pledgie_addon_settings_post');
 }
 
 function pledgie_addon_settings(&$a,&$s) {
index 0ea029b3c966bca1a4fe0528a116bbaa17cf3ef9..422746f0f0c23fa8bc79ad2287eca535c6a8fc4f 100644 (file)
@@ -1,31 +1,30 @@
 <?php
-
 /**
  * Name: public_server
  * Description: Friendica plugin/addon with functions suitable for a public server.
  * Version: 1.1
  * Author: Keith Fernie <http://friendika.me4.it/profile/keith>
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Model\User;
 
 
 function public_server_install() {
 
-       register_hook('register_account', 'addon/public_server/public_server.php', 'public_server_register_account');
-       register_hook('cron', 'addon/public_server/public_server.php', 'public_server_cron');
-        register_hook('enotify','addon/public_server/public_server.php', 'public_server_enotify');
-       register_hook('logged_in', 'addon/public_server/public_server.php', 'public_server_login');
+       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');
 }
 
 
 function public_server_uninstall() {
 
-       unregister_hook('register_account', 'addon/public_server/public_server.php', 'public_server_register_account');
-       unregister_hook('cron', 'addon/public_server/public_server.php', 'public_server_cron');
-        unregister_hook('enotify','addon/public_server/public_server.php', 'public_server_enotify');
-       unregister_hook('logged_in', 'addon/public_server/public_server.php', 'public_server_login');
+       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');
 }
 
 function public_server_register_account($a,$b) {
index 6aaa05655f04cbd5e09d389b830b6db891d6b6fe..8aa1588ac68d7d0854d3d0b0f76e6c626410780e 100644 (file)
@@ -5,6 +5,7 @@
  * Version: 0.2
  * Author: Michael Vogel <http://pirati.ca/profile/heluecht>
  */
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Core\Worker;
@@ -22,25 +23,25 @@ require_once "mod/share.php";
 define('PUMPIO_DEFAULT_POLL_INTERVAL', 5); // given in minutes
 
 function pumpio_install() {
-       register_hook('post_local',           'addon/pumpio/pumpio.php', 'pumpio_post_local');
-       register_hook('notifier_normal',      'addon/pumpio/pumpio.php', 'pumpio_send');
-       register_hook('jot_networks',         'addon/pumpio/pumpio.php', 'pumpio_jot_nets');
-       register_hook('connector_settings',      'addon/pumpio/pumpio.php', 'pumpio_settings');
-       register_hook('connector_settings_post', 'addon/pumpio/pumpio.php', 'pumpio_settings_post');
-       register_hook('cron', 'addon/pumpio/pumpio.php', 'pumpio_cron');
-       register_hook('queue_predeliver', 'addon/pumpio/pumpio.php', 'pumpio_queue_hook');
-       register_hook('check_item_notification','addon/pumpio/pumpio.php', 'pumpio_check_item_notification');
+       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');
 }
 
 function pumpio_uninstall() {
-       unregister_hook('post_local',       'addon/pumpio/pumpio.php', 'pumpio_post_local');
-       unregister_hook('notifier_normal',  'addon/pumpio/pumpio.php', 'pumpio_send');
-       unregister_hook('jot_networks',     'addon/pumpio/pumpio.php', 'pumpio_jot_nets');
-       unregister_hook('connector_settings',      'addon/pumpio/pumpio.php', 'pumpio_settings');
-       unregister_hook('connector_settings_post', 'addon/pumpio/pumpio.php', 'pumpio_settings_post');
-       unregister_hook('cron', 'addon/pumpio/pumpio.php', 'pumpio_cron');
-       unregister_hook('queue_predeliver', 'addon/pumpio/pumpio.php', 'pumpio_queue_hook');
-       unregister_hook('check_item_notification','addon/pumpio/pumpio.php', 'pumpio_check_item_notification');
+       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');
 }
 
 function pumpio_module() {}
index f4b951843a82a8db18fe65bc622c824bc3c69c6d..2e1783c09b5e32dd59d777dbbe573bfb2b268241 100644 (file)
  * them to open the comment window fully and insert the qcomment. Then "Submit" will submit it.
  *
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function qcomment_install() {
-       register_hook('plugin_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings');
-       register_hook('plugin_settings_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post');
+       Addon::registerHook('plugin_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post');
 
 }
 
 
 function qcomment_uninstall() {
-       unregister_hook('plugin_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings');
-       unregister_hook('plugin_settings_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post');
+       Addon::unregisterHook('plugin_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post');
 
 }
 
index b696bed2e7749af96bdfbfd3c470eb6581efda7f..a6a639ecf501b6b5174798dbc225b77f68aaf69b 100644 (file)
@@ -18,7 +18,7 @@
  * system will call the name_uninstall() function.
  *
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function randplace_install() {
@@ -30,7 +30,7 @@ function randplace_install() {
         *
         */
 
-       register_hook('post_local', 'addon/randplace/randplace.php', 'randplace_post_hook');
+       Addon::registerHook('post_local', 'addon/randplace/randplace.php', 'randplace_post_hook');
 
        /**
         *
@@ -40,8 +40,8 @@ function randplace_install() {
         *
         */
 
-       register_hook('plugin_settings', 'addon/randplace/randplace.php', 'randplace_settings');
-       register_hook('plugin_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
+       Addon::registerHook('plugin_settings', 'addon/randplace/randplace.php', 'randplace_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
 
        logger("installed randplace");
 }
@@ -57,9 +57,9 @@ function randplace_uninstall() {
         *
         */
 
-       unregister_hook('post_local',    'addon/randplace/randplace.php', 'randplace_post_hook');
-       unregister_hook('plugin_settings', 'addon/randplace/randplace.php', 'randplace_settings');
-       unregister_hook('plugin_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
+       Addon::unregisterHook('post_local',    'addon/randplace/randplace.php', 'randplace_post_hook');
+       Addon::unregisterHook('plugin_settings', 'addon/randplace/randplace.php', 'randplace_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/randplace/randplace.php', 'randplace_settings_post');
 
 
        logger("removed randplace");
index c7e51286e5386edb1fb21270aff7916bbf77fe0a..7c74df9f59b848740b3cc16a8ea1b94e779cac16 100644 (file)
@@ -6,20 +6,20 @@
  * Author: Zach <https://f.shmuz.in/profile/techcity>
  *
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 
 function remote_permissions_install() {
-       register_hook('lockview_content', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_content');
-       register_hook('plugin_settings', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings');
-       register_hook('plugin_settings_post', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings_post');
+       Addon::registerHook('lockview_content', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_content');
+       Addon::registerHook('plugin_settings', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings_post');
 }
 
 function remote_permissions_uninstall() {
-       unregister_hook('lockview_content', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_content');
-       unregister_hook('plugin_settings', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings');
-       unregister_hook('plugin_settings_post', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings_post');
+       Addon::unregisterHook('lockview_content', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_content');
+       Addon::unregisterHook('plugin_settings', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/remote_permissions/remote_permissions.php', 'remote_permissions_settings_post');
 }
 
 function remote_permissions_settings(&$a,&$o) {
index 1a2a962f497d32e6364ef89a9b35838f4e2b06d7..0789f54618e4d59d5b2a81e1f74fa34a38589f3d 100644 (file)
@@ -1,6 +1,4 @@
 <?php
-
-
 /**
  * Name: rendertime
  * Description: Shows the time that was needed to render the current page
@@ -8,17 +6,17 @@
  * Author: Michael Vvogel <http://pirati.ca/profile/heluecht>
  *
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 
 function rendertime_install() {
-       register_hook('page_end', 'addon/rendertime/rendertime.php', 'rendertime_page_end');
+       Addon::registerHook('page_end', 'addon/rendertime/rendertime.php', 'rendertime_page_end');
 }
 
 
 function rendertime_uninstall() {
-       unregister_hook('init_1', 'addon/rendertime/rendertime.php', 'rendertime_init_1');
-       unregister_hook('page_end', 'addon/rendertime/rendertime.php', 'rendertime_page_end');
+       Addon::unregisterHook('init_1', 'addon/rendertime/rendertime.php', 'rendertime_init_1');
+       Addon::unregisterHook('page_end', 'addon/rendertime/rendertime.php', 'rendertime_page_end');
 }
 
 function rendertime_init_1(&$a) {
index 68fc24ff845d0e19d9f95af9fce437fd048d1fb6..33bbf03030a7e6c3b76901c61aec0cd5c7bb4e95 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 use Friendica\App;
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 use Friendica\Util\Emailer;
 
@@ -23,19 +24,19 @@ require_once 'openpgp_crypt_symmetric.php';
 
 
 function securemail_install() {
-    register_hook('plugin_settings', 'addon/securemail/securemail.php', 'securemail_settings');
-    register_hook('plugin_settings_post', 'addon/securemail/securemail.php', 'securemail_settings_post');
+    Addon::registerHook('plugin_settings', 'addon/securemail/securemail.php', 'securemail_settings');
+    Addon::registerHook('plugin_settings_post', 'addon/securemail/securemail.php', 'securemail_settings_post');
 
-    register_hook('emailer_send_prepare', 'addon/securemail/securemail.php', 'securemail_emailer_send_prepare');
+    Addon::registerHook('emailer_send_prepare', 'addon/securemail/securemail.php', 'securemail_emailer_send_prepare');
 
     logger('installed securemail');
 }
 
 function securemail_uninstall() {
-    unregister_hook('plugin_settings', 'addon/securemail/securemail.php', 'securemail_settings');
-    unregister_hook('plugin_settings_post', 'addon/securemail/securemail.php', 'securemail_settings_post');
+    Addon::unregisterHook('plugin_settings', 'addon/securemail/securemail.php', 'securemail_settings');
+    Addon::unregisterHook('plugin_settings_post', 'addon/securemail/securemail.php', 'securemail_settings_post');
 
-    unregister_hook('emailer_send_prepare', 'addon/securemail/securemail.php', 'securemail_emailer_send_prepare');
+    Addon::unregisterHook('emailer_send_prepare', 'addon/securemail/securemail.php', 'securemail_emailer_send_prepare');
 
     logger('removed securemail');
 }
index 9bddab6337b66b48c20b7c21c93482c48327ce9a..8f0e6693c89c87cf647061a3ec21cd2da4a8df68 100644 (file)
@@ -7,19 +7,19 @@
  *         based upon NSFW from Mike Macgirvin <http://macgirvin.com/profile/mike>
  *
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function showmore_install() {
-       register_hook('prepare_body', 'addon/showmore/showmore.php', 'showmore_prepare_body');
-       register_hook('plugin_settings', 'addon/showmore/showmore.php', 'showmore_addon_settings');
-       register_hook('plugin_settings_post', 'addon/showmore/showmore.php', 'showmore_addon_settings_post');
+       Addon::registerHook('prepare_body', 'addon/showmore/showmore.php', 'showmore_prepare_body');
+       Addon::registerHook('plugin_settings', 'addon/showmore/showmore.php', 'showmore_addon_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/showmore/showmore.php', 'showmore_addon_settings_post');
 }
 
 function showmore_uninstall() {
-       unregister_hook('prepare_body', 'addon/showmore/showmore.php', 'showmore_prepare_body');
-       unregister_hook('plugin_settings', 'addon/showmore/showmore.php', 'showmore_addon_settings');
-       unregister_hook('plugin_settings_post', 'addon/showmore/showmore.php', 'showmore_addon_settings_post');
+       Addon::unregisterHook('prepare_body', 'addon/showmore/showmore.php', 'showmore_prepare_body');
+       Addon::unregisterHook('plugin_settings', 'addon/showmore/showmore.php', 'showmore_addon_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/showmore/showmore.php', 'showmore_addon_settings_post');
 }
 
 function showmore_addon_settings(&$a,&$s) {
index fb4bce1321300475e77cc709758a6edb096603f5..4756638002b5c1ac049725620623163d986e261e 100644 (file)
@@ -6,17 +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;
 
 function smiley_pack_es_install() {
-       register_hook('smilie', 'addon/smiley_pack_es/smiley_pack_es.php', 'smiley_pack_smilies_es');
+       Addon::registerHook('smilie', 'addon/smiley_pack_es/smiley_pack_es.php', 'smiley_pack_smilies_es');
 }
 
 function smiley_pack_es_uninstall() {
-       unregister_hook('smilie', 'addon/smiley_pack_es/smiley_pack_es.php', 'smiley_pack_smilies');
+       Addon::unregisterHook('smilie', 'addon/smiley_pack_es/smiley_pack_es.php', 'smiley_pack_smilies');
 }
 
  
index 3ae70879cb58ba7a24831f36b00be39331dac3e1..282c0dde07ae8743527cf6946fe6da09059da182 100644 (file)
@@ -8,13 +8,14 @@
  * 
  * 
  */
+use Friendica\Core\Addon;
 
 function smiley_pack_fr_install() {
-       register_hook('smilie', 'addon/smiley_pack_fr/smiley_pack_fr.php', 'smiley_pack_fr_smilies');
+       Addon::registerHook('smilie', 'addon/smiley_pack_fr/smiley_pack_fr.php', 'smiley_pack_fr_smilies');
 }
 
 function smiley_pack_fr_uninstall() {
-       unregister_hook('smilie', 'addon/smiley_pack_fr/smiley_pack_fr.php', 'smiley_pack_fr_smilies');
+       Addon::unregisterHook('smilie', 'addon/smiley_pack_fr/smiley_pack_fr.php', 'smiley_pack_fr_smilies');
 }
 
  
index 4d49b7c0275c2b5a74237553a49ebc0f83f47140..ea3490ebb3bbe21a92d63702af13bbcaea78675a 100644 (file)
@@ -7,16 +7,14 @@
  * All smileys from sites offering them as Public Domain
  */
 
-/**
-
-*/
+use Friendica\Core\Addon;
 
 function smiley_pack_install() {
-       register_hook('smilie', 'addon/smiley_pack/smiley_pack.php', 'smiley_pack_smilies');
+       Addon::registerHook('smilie', 'addon/smiley_pack/smiley_pack.php', 'smiley_pack_smilies');
 }
 
 function smiley_pack_uninstall() {
-       unregister_hook('smilie', 'addon/smiley_pack/smiley_pack.php', 'smiley_pack_smilies');
+       Addon::unregisterHook('smilie', 'addon/smiley_pack/smiley_pack.php', 'smiley_pack_smilies');
 }
 
  
index d922a6b147082f3c20262708de3925a8fccc1d0d..4aea34d87876dced8ba4da7bf1e590d1caef44df 100644 (file)
@@ -5,11 +5,11 @@
  * Version: 0.2
  * Author: Johannes Schwab <https://friendica.jschwab.org/profile/ddorian>
  */
-
+use Friendica\Core\Addon;
 
 function smileybutton_install() {
        //Register hooks
-       register_hook('jot_tool', 'addon/smileybutton/smileybutton.php', 'show_button');
+       Addon::registerHook('jot_tool', 'addon/smileybutton/smileybutton.php', 'show_button');
 
        logger("installed smileybutton");
 }
@@ -17,7 +17,7 @@ function smileybutton_install() {
 
 function smileybutton_uninstall() {
        //Delet registered hooks
-       unregister_hook('jot_tool',    'addon/smileybutton/smileybutton.php', 'show_button');
+       Addon::unregisterHook('jot_tool',    'addon/smileybutton/smileybutton.php', 'show_button');
 
        logger("removed smileybutton");
 }
index 82b30a9807e84785d8316020c0c7de6d7c5d5e04..bb673f23de8ddfe14f46f4d45d2c83b59ed41cfd 100644 (file)
@@ -8,13 +8,14 @@
  * This is a template for how to extend the "smily" code.
  * 
  */
+use Friendica\Core\Addon;
 
 function smilies_adult_install() {
-       register_hook('smilie', 'addon/smilies_adult/smilies_adult.php', 'smilies_adult_smilies');
+       Addon::registerHook('smilie', 'addon/smilies_adult/smilies_adult.php', 'smilies_adult_smilies');
 }
 
 function smilies_adult_uninstall() {
-       unregister_hook('smilie', 'addon/smilies_adult/smilies_adult.php', 'smilies_adult_smilies');
+       Addon::unregisterHook('smilie', 'addon/smilies_adult/smilies_adult.php', 'smilies_adult_smilies');
 }
 
  
index 59812cba06be0372a0c102f397cba64d92c13942..2be7165d1b178ec6c0485297e43b9b2c20592053 100644 (file)
@@ -9,14 +9,14 @@
  * Version: 1.0
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
  */
-
+use Friendica\Core\Addon;
 
 function sniper_install() {
-    register_hook('app_menu', 'addon/sniper/sniper.php', 'sniper_app_menu');
+    Addon::registerHook('app_menu', 'addon/sniper/sniper.php', 'sniper_app_menu');
 }
 
 function sniper_uninstall() {
-    unregister_hook('app_menu', 'addon/sniper/sniper.php', 'sniper_app_menu');
+    Addon::unregisterHook('app_menu', 'addon/sniper/sniper.php', 'sniper_app_menu');
 
 }
 
index b0ee04cb794be8eafc164cafd699a5a8eb8f8a94..263ec39548790705704d8bbf91ed5364dae9593d 100644 (file)
@@ -6,20 +6,20 @@
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
  *
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function startpage_install() {
-       register_hook('home_init', 'addon/startpage/startpage.php', 'startpage_home_init');
-       register_hook('plugin_settings', 'addon/startpage/startpage.php', 'startpage_settings');
-       register_hook('plugin_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post');
+       Addon::registerHook('home_init', 'addon/startpage/startpage.php', 'startpage_home_init');
+       Addon::registerHook('plugin_settings', 'addon/startpage/startpage.php', 'startpage_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post');
 }
 
 
 function startpage_uninstall() {
-       unregister_hook('home_init', 'addon/startpage/startpage.php', 'startpage_home_init');
-       unregister_hook('plugin_settings', 'addon/startpage/startpage.php', 'startpage_settings');
-       unregister_hook('plugin_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post');
+       Addon::unregisterHook('home_init', 'addon/startpage/startpage.php', 'startpage_home_init');
+       Addon::unregisterHook('plugin_settings', 'addon/startpage/startpage.php', 'startpage_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/startpage/startpage.php', 'startpage_settings_post');
 }
 
 
index 9158052a528bc0e43149fe9aaac6415565b78d00..e867ea465f3728f3d97877ba3374e44e2c74bbb9 100644 (file)
@@ -47,6 +47,7 @@ require_once 'include/enotify.php';
 
 use Friendica\App;
 use Friendica\Content\OEmbed;
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Model\GContact;
@@ -145,32 +146,32 @@ class StatusNetOAuth extends TwitterOAuth
 function statusnet_install()
 {
        //  we need some hooks, for the configuration and for sending tweets
-       register_hook('connector_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings');
-       register_hook('connector_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post');
-       register_hook('notifier_normal', 'addon/statusnet/statusnet.php', 'statusnet_post_hook');
-       register_hook('post_local', 'addon/statusnet/statusnet.php', 'statusnet_post_local');
-       register_hook('jot_networks', 'addon/statusnet/statusnet.php', 'statusnet_jot_nets');
-       register_hook('cron', 'addon/statusnet/statusnet.php', 'statusnet_cron');
-       register_hook('prepare_body', 'addon/statusnet/statusnet.php', 'statusnet_prepare_body');
-       register_hook('check_item_notification', 'addon/statusnet/statusnet.php', 'statusnet_check_item_notification');
+       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('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');
        logger("installed GNU Social");
 }
 
 function statusnet_uninstall()
 {
-       unregister_hook('connector_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings');
-       unregister_hook('connector_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post');
-       unregister_hook('notifier_normal', 'addon/statusnet/statusnet.php', 'statusnet_post_hook');
-       unregister_hook('post_local', 'addon/statusnet/statusnet.php', 'statusnet_post_local');
-       unregister_hook('jot_networks', 'addon/statusnet/statusnet.php', 'statusnet_jot_nets');
-       unregister_hook('cron', 'addon/statusnet/statusnet.php', 'statusnet_cron');
-       unregister_hook('prepare_body', 'addon/statusnet/statusnet.php', 'statusnet_prepare_body');
-       unregister_hook('check_item_notification', 'addon/statusnet/statusnet.php', 'statusnet_check_item_notification');
+       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('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');
 
        // old setting - remove only
-       unregister_hook('post_local_end', 'addon/statusnet/statusnet.php', 'statusnet_post_hook');
-       unregister_hook('plugin_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings');
-       unregister_hook('plugin_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post');
+       Addon::unregisterHook('post_local_end', 'addon/statusnet/statusnet.php', 'statusnet_post_hook');
+       Addon::unregisterHook('plugin_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post');
 }
 
 function statusnet_check_item_notification(App $a, &$notification_data)
index c33c699db45881b3b95df49fa22e83e606a6a7e3..2e1004a148142d999eb42df2d07f014e45449e20 100644 (file)
@@ -8,27 +8,27 @@
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
  *
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function superblock_install() {
 
-       register_hook('plugin_settings', 'addon/superblock/superblock.php', 'superblock_addon_settings');
-       register_hook('plugin_settings_post', 'addon/superblock/superblock.php', 'superblock_addon_settings_post');
-       register_hook('conversation_start', 'addon/superblock/superblock.php', 'superblock_conversation_start');
-       register_hook('item_photo_menu', 'addon/superblock/superblock.php', 'superblock_item_photo_menu');
-       register_hook('enotify_store', 'addon/superblock/superblock.php', 'superblock_enotify_store');
+       Addon::registerHook('plugin_settings', 'addon/superblock/superblock.php', 'superblock_addon_settings');
+       Addon::registerHook('plugin_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');
 
 }
 
 
 function superblock_uninstall() {
 
-       unregister_hook('plugin_settings', 'addon/superblock/superblock.php', 'superblock_addon_settings');
-       unregister_hook('plugin_settings_post', 'addon/superblock/superblock.php', 'superblock_addon_settings_post');
-       unregister_hook('conversation_start', 'addon/superblock/superblock.php', 'superblock_conversation_start');
-       unregister_hook('item_photo_menu', 'addon/superblock/superblock.php', 'superblock_item_photo_menu');
-       unregister_hook('enotify_store', 'addon/superblock/superblock.php', 'superblock_enotify_store');
+       Addon::unregisterHook('plugin_settings', 'addon/superblock/superblock.php', 'superblock_addon_settings');
+       Addon::unregisterHook('plugin_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');
 
 }
 
index 6203f3cdf345b8a408c1bc98d85b58ca49a6175f..db16d2143c3c9c4b2fabd0681d22c8b978a49484 100644 (file)
@@ -6,27 +6,27 @@
  * Version: 1.0
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Model\User;
 
 
 function testdrive_install() {
 
-       register_hook('register_account', 'addon/testdrive/testdrive.php', 'testdrive_register_account');
-       register_hook('cron', 'addon/testdrive/testdrive.php', 'testdrive_cron');
-       register_hook('enotify','addon/testdrive/testdrive.php', 'testdrive_enotify');
-       register_hook('globaldir_update','addon/testdrive/testdrive.php', 'testdrive_globaldir_update');
+       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');
 
 }
 
 
 function testdrive_uninstall() {
 
-       unregister_hook('register_account', 'addon/testdrive/testdrive.php', 'testdrive_register_account');
-       unregister_hook('cron', 'addon/testdrive/testdrive.php', 'testdrive_cron');
-       unregister_hook('enotify','addon/testdrive/testdrive.php', 'testdrive_enotify');
-       unregister_hook('globaldir_update','addon/testdrive/testdrive.php', 'testdrive_globaldir_update');
+       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');
 
 }
 
index 9973784176e1ea4ecf6fb5492df3bc88cffda15a..f928fd5e08ad6de002cecad0dde3371156c99cdb 100644 (file)
@@ -5,14 +5,14 @@
  * Version: 1.0
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
  */
-
+use Friendica\Core\Addon;
 
 function tictac_install() {
-       register_hook('app_menu', 'addon/tictac/tictac.php', 'tictac_app_menu');
+       Addon::registerHook('app_menu', 'addon/tictac/tictac.php', 'tictac_app_menu');
 }
 
 function tictac_uninstall() {
-       unregister_hook('app_menu', 'addon/tictac/tictac.php', 'tictac_app_menu');
+       Addon::unregisterHook('app_menu', 'addon/tictac/tictac.php', 'tictac_app_menu');
 
 }
 
index a056bd09feb55aab5cd1137122e4852490921009..df47a8e3c61a21f012e2491b472208b3b325ea28 100644 (file)
 require_once('library/OAuth1.php');
 require_once('addon/tumblr/tumblroauth/tumblroauth.php');
 
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 
 function tumblr_install() {
-       register_hook('post_local',           'addon/tumblr/tumblr.php', 'tumblr_post_local');
-       register_hook('notifier_normal',      'addon/tumblr/tumblr.php', 'tumblr_send');
-       register_hook('jot_networks',         'addon/tumblr/tumblr.php', 'tumblr_jot_nets');
-       register_hook('connector_settings',      'addon/tumblr/tumblr.php', 'tumblr_settings');
-       register_hook('connector_settings_post', 'addon/tumblr/tumblr.php', 'tumblr_settings_post');
+       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');
 
 }
 function tumblr_uninstall() {
-       unregister_hook('post_local',       'addon/tumblr/tumblr.php', 'tumblr_post_local');
-       unregister_hook('notifier_normal',  'addon/tumblr/tumblr.php', 'tumblr_send');
-       unregister_hook('jot_networks',     'addon/tumblr/tumblr.php', 'tumblr_jot_nets');
-       unregister_hook('connector_settings',      'addon/tumblr/tumblr.php', 'tumblr_settings');
-       unregister_hook('connector_settings_post', 'addon/tumblr/tumblr.php', 'tumblr_settings_post');
+       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');
 }
 
 function tumblr_module() {}
index 807445b6de536fcb368760666d5f78017ea21c27..1b4758018c0b359d12333e5ab8f81f3709ffca05 100644 (file)
@@ -62,6 +62,7 @@
 
 use Friendica\App;
 use Friendica\Content\OEmbed;
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Core\Worker;
@@ -78,38 +79,38 @@ define('TWITTER_DEFAULT_POLL_INTERVAL', 5); // given in minutes
 function twitter_install()
 {
        //  we need some hooks, for the configuration and for sending tweets
-       register_hook('connector_settings', 'addon/twitter/twitter.php', 'twitter_settings');
-       register_hook('connector_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post');
-       register_hook('post_local', 'addon/twitter/twitter.php', 'twitter_post_local');
-       register_hook('notifier_normal', 'addon/twitter/twitter.php', 'twitter_post_hook');
-       register_hook('jot_networks', 'addon/twitter/twitter.php', 'twitter_jot_nets');
-       register_hook('cron', 'addon/twitter/twitter.php', 'twitter_cron');
-       register_hook('queue_predeliver', 'addon/twitter/twitter.php', 'twitter_queue_hook');
-       register_hook('follow', 'addon/twitter/twitter.php', 'twitter_follow');
-       register_hook('expire', 'addon/twitter/twitter.php', 'twitter_expire');
-       register_hook('prepare_body', 'addon/twitter/twitter.php', 'twitter_prepare_body');
-       register_hook('check_item_notification', 'addon/twitter/twitter.php', 'twitter_check_item_notification');
+       Addon::registerHook('connector_settings', 'addon/twitter/twitter.php', 'twitter_settings');
+       Addon::registerHook('connector_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post');
+       Addon::registerHook('post_local', 'addon/twitter/twitter.php', 'twitter_post_local');
+       Addon::registerHook('notifier_normal', 'addon/twitter/twitter.php', 'twitter_post_hook');
+       Addon::registerHook('jot_networks', 'addon/twitter/twitter.php', 'twitter_jot_nets');
+       Addon::registerHook('cron', 'addon/twitter/twitter.php', 'twitter_cron');
+       Addon::registerHook('queue_predeliver', 'addon/twitter/twitter.php', 'twitter_queue_hook');
+       Addon::registerHook('follow', 'addon/twitter/twitter.php', 'twitter_follow');
+       Addon::registerHook('expire', 'addon/twitter/twitter.php', 'twitter_expire');
+       Addon::registerHook('prepare_body', 'addon/twitter/twitter.php', 'twitter_prepare_body');
+       Addon::registerHook('check_item_notification', 'addon/twitter/twitter.php', 'twitter_check_item_notification');
        logger("installed twitter");
 }
 
 function twitter_uninstall()
 {
-       unregister_hook('connector_settings', 'addon/twitter/twitter.php', 'twitter_settings');
-       unregister_hook('connector_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post');
-       unregister_hook('post_local', 'addon/twitter/twitter.php', 'twitter_post_local');
-       unregister_hook('notifier_normal', 'addon/twitter/twitter.php', 'twitter_post_hook');
-       unregister_hook('jot_networks', 'addon/twitter/twitter.php', 'twitter_jot_nets');
-       unregister_hook('cron', 'addon/twitter/twitter.php', 'twitter_cron');
-       unregister_hook('queue_predeliver', 'addon/twitter/twitter.php', 'twitter_queue_hook');
-       unregister_hook('follow', 'addon/twitter/twitter.php', 'twitter_follow');
-       unregister_hook('expire', 'addon/twitter/twitter.php', 'twitter_expire');
-       unregister_hook('prepare_body', 'addon/twitter/twitter.php', 'twitter_prepare_body');
-       unregister_hook('check_item_notification', 'addon/twitter/twitter.php', 'twitter_check_item_notification');
+       Addon::unregisterHook('connector_settings', 'addon/twitter/twitter.php', 'twitter_settings');
+       Addon::unregisterHook('connector_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post');
+       Addon::unregisterHook('post_local', 'addon/twitter/twitter.php', 'twitter_post_local');
+       Addon::unregisterHook('notifier_normal', 'addon/twitter/twitter.php', 'twitter_post_hook');
+       Addon::unregisterHook('jot_networks', 'addon/twitter/twitter.php', 'twitter_jot_nets');
+       Addon::unregisterHook('cron', 'addon/twitter/twitter.php', 'twitter_cron');
+       Addon::unregisterHook('queue_predeliver', 'addon/twitter/twitter.php', 'twitter_queue_hook');
+       Addon::unregisterHook('follow', 'addon/twitter/twitter.php', 'twitter_follow');
+       Addon::unregisterHook('expire', 'addon/twitter/twitter.php', 'twitter_expire');
+       Addon::unregisterHook('prepare_body', 'addon/twitter/twitter.php', 'twitter_prepare_body');
+       Addon::unregisterHook('check_item_notification', 'addon/twitter/twitter.php', 'twitter_check_item_notification');
 
        // old setting - remove only
-       unregister_hook('post_local_end', 'addon/twitter/twitter.php', 'twitter_post_hook');
-       unregister_hook('plugin_settings', 'addon/twitter/twitter.php', 'twitter_settings');
-       unregister_hook('plugin_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post');
+       Addon::unregisterHook('post_local_end', 'addon/twitter/twitter.php', 'twitter_post_hook');
+       Addon::unregisterHook('plugin_settings', 'addon/twitter/twitter.php', 'twitter_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post');
 }
 
 function twitter_check_item_notification(App $a, &$notification_data)
index 85077c456b1371ec045b1e15b7626e96e5aa8312..faa553cc18cd2d31587cf280c48fac65523ead39 100644 (file)
@@ -5,15 +5,15 @@
  * Version: 1.0
  * Author: Michael Vogel <http://pirati.ca/profile/heluecht>
  */
-
+use Friendica\Core\Addon;
 use Friendica\Content\Smilies;
 
 function unicode_smilies_install() {
-       register_hook('smilie', 'addon/unicode_smilies/unicode_smilies.php', 'unicode_smilies_smilies');
+       Addon::registerHook('smilie', 'addon/unicode_smilies/unicode_smilies.php', 'unicode_smilies_smilies');
 }
 
 function unicode_smilies_uninstall() {
-       unregister_hook('smilie', 'addon/unicode_smilies/unicode_smilies.php', 'unicode_smilies_smilies');
+       Addon::unregisterHook('smilie', 'addon/unicode_smilies/unicode_smilies.php', 'unicode_smilies_smilies');
 }
 
 function unicode_smilies_smilies(&$a,&$b) {
index 623ed89d8f7c31c0ec36e3b40ee3e63de27b0854..cf1b33a7e50e95ec0ec49cf79f030af6d288b222 100644 (file)
@@ -1,6 +1,4 @@
 <?php
-
-
 /**
  * Name: viewsrc
  * Description: Add "View Source" link to item context
@@ -8,16 +6,17 @@
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
  *
  */
+use Friendica\Core\Addon;
 
 function viewsrc_install() {
-       register_hook('item_photo_menu', 'addon/viewsrc/viewsrc.php', 'viewsrc_item_photo_menu');
-       register_hook('page_end', 'addon/viewsrc/viewsrc.php', 'viewsrc_page_end');
+       Addon::registerHook('item_photo_menu', 'addon/viewsrc/viewsrc.php', 'viewsrc_item_photo_menu');
+       Addon::registerHook('page_end', 'addon/viewsrc/viewsrc.php', 'viewsrc_page_end');
 }
 
 
 function viewsrc_uninstall() {
-       unregister_hook('item_photo_menu', 'addon/viewsrc/viewsrc.php', 'viewsrc_item_photo_menu');
-       unregister_hook('page_end', 'addon/viewsrc/viewsrc.php', 'viewsrc_page_end');
+       Addon::unregisterHook('item_photo_menu', 'addon/viewsrc/viewsrc.php', 'viewsrc_item_photo_menu');
+       Addon::unregisterHook('page_end', 'addon/viewsrc/viewsrc.php', 'viewsrc_page_end');
 
 }
 
index 1588847df4bf49e25016627bc3ba2ce09ea92ee0..fe12248e33d2ac7595121301bf97a332c8f713cd 100644 (file)
@@ -6,15 +6,15 @@
  * Author: Stephen Mahood <https://friends.mayfirst.org/profile/marxistvegan>
  * Author: Tobias Diekershoff <https://f.diekershoff.de/profile/tobias>
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 
 function webrtc_install() {
-        register_hook('app_menu', 'addon/webrtc/webrtc.php', 'webrtc_app_menu');
+        Addon::registerHook('app_menu', 'addon/webrtc/webrtc.php', 'webrtc_app_menu');
 }
 
 function webrtc_uninstall() {
-        unregister_hook('app_menu', 'addon/webrtc/webrtc.php', 'webrtc_app_menu');
+        Addon::unregisterHook('app_menu', 'addon/webrtc/webrtc.php', 'webrtc_app_menu');
 
 }
 
index 502278a278e91ebbf1a52dbe5712e2afc1b1bbc3..69f03a8ee4341c535bc5a9b5953ef7bef9b4e8b5 100644 (file)
@@ -5,17 +5,17 @@
  * Version: 1.0
  * Author: Fabio Comuni <http://kirgroup.com/profile/fabrix/>
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function widgets_install() {
-       register_hook('plugin_settings', 'addon/widgets/widgets.php', 'widgets_settings');
-       register_hook('plugin_settings_post', 'addon/widgets/widgets.php', 'widgets_settings_post');
+       Addon::registerHook('plugin_settings', 'addon/widgets/widgets.php', 'widgets_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/widgets/widgets.php', 'widgets_settings_post');
        logger("installed widgets");
 }
 function widgets_uninstall() {
-       unregister_hook('plugin_settings', 'addon/widgets/widgets.php', 'widgets_settings');
-       unregister_hook('plugin_settings_post', 'addon/widgets/widgets.php', 'widgets_settings_post');
+       Addon::unregisterHook('plugin_settings', 'addon/widgets/widgets.php', 'widgets_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/widgets/widgets.php', 'widgets_settings_post');
 }
 
 
index 66b23a7ccbc4ec4acce5eb6049900369c0da5ad1..377d2cd4f1b1e76babe60d50f46eb8879cd5933f 100644 (file)
@@ -26,6 +26,7 @@
  *        count only unseen elements which are not type=activity (likes and dislikes not seen as new elements)
  */
 use Friendica\App;
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 use Friendica\Model\User;
 
@@ -35,15 +36,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).
         */
-       register_hook('cron', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_cron');
+       Addon::registerHook('cron', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_cron');
 
        /* Then we'll attach into the plugin settings page, and also the
         * settings post hook so that we can create and update
         * user preferences. User shall be able to activate the plugin and
         * define whether he allows pushing first characters of item text
         */
-       register_hook('plugin_settings', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings');
-       register_hook('plugin_settings_post', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings_post');
+       Addon::registerHook('plugin_settings', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings_post');
 
        logger("installed windowsphonepush");
 }
@@ -53,9 +54,9 @@ function windowsphonepush_uninstall()
        /* uninstall unregisters any hooks created with register_hook
         * during install. Don't delete data in table `pconfig`.
         */
-       unregister_hook('cron', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_cron');
-       unregister_hook('plugin_settings', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings');
-       unregister_hook('plugin_settings_post', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings_post');
+       Addon::unregisterHook('cron', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_cron');
+       Addon::unregisterHook('plugin_settings', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/windowsphonepush/windowsphonepush.php', 'windowsphonepush_settings_post');
 
        logger("removed windowsphonepush");
 }
index 22032c90ab70d6e8fc2ef8b45915e442a210aac1..d73005a3ff54dccb4c86eb5629c89d59e93d3a81 100644 (file)
@@ -6,28 +6,28 @@
  * Version: 1.1
  * Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\PConfig;
 
 function wppost_install() {
-    register_hook('post_local',           'addon/wppost/wppost.php', 'wppost_post_local');
-    register_hook('notifier_normal',      'addon/wppost/wppost.php', 'wppost_send');
-    register_hook('jot_networks',         'addon/wppost/wppost.php', 'wppost_jot_nets');
-    register_hook('connector_settings',      'addon/wppost/wppost.php', 'wppost_settings');
-    register_hook('connector_settings_post', 'addon/wppost/wppost.php', 'wppost_settings_post');
+    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');
 
 }
 function wppost_uninstall() {
-    unregister_hook('post_local',       'addon/wppost/wppost.php', 'wppost_post_local');
-    unregister_hook('notifier_normal',  'addon/wppost/wppost.php', 'wppost_send');
-    unregister_hook('jot_networks',     'addon/wppost/wppost.php', 'wppost_jot_nets');
-    unregister_hook('connector_settings',      'addon/wppost/wppost.php', 'wppost_settings');
-    unregister_hook('connector_settings_post', 'addon/wppost/wppost.php', 'wppost_settings_post');
+    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');
 
        // obsolete - remove
-    unregister_hook('post_local_end',   'addon/wppost/wppost.php', 'wppost_send');
-    unregister_hook('plugin_settings',  'addon/wppost/wppost.php', 'wppost_settings');
-    unregister_hook('plugin_settings_post',  'addon/wppost/wppost.php', 'wppost_settings_post');
+    Addon::unregisterHook('post_local_end',   'addon/wppost/wppost.php', 'wppost_send');
+    Addon::unregisterHook('plugin_settings',  'addon/wppost/wppost.php', 'wppost_settings');
+    Addon::unregisterHook('plugin_settings_post',  'addon/wppost/wppost.php', 'wppost_settings_post');
 
 }
 
index ba8c27c7f80d39d8072e27486db4c425937d7944..fc2d6bb5c0d347e469ebfed2456dab7b1c85d368 100644 (file)
@@ -7,23 +7,24 @@
  * Author: Michael Vogel <https://pirati.ca/profile/heluecht>
  */
 use Friendica\App;
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 
 function xmpp_install()
 {
-       register_hook('plugin_settings', 'addon/xmpp/xmpp.php', 'xmpp_plugin_settings');
-       register_hook('plugin_settings_post', 'addon/xmpp/xmpp.php', 'xmpp_plugin_settings_post');
-       register_hook('page_end', 'addon/xmpp/xmpp.php', 'xmpp_script');
-       register_hook('logged_in', 'addon/xmpp/xmpp.php', 'xmpp_login');
+       Addon::registerHook('plugin_settings', 'addon/xmpp/xmpp.php', 'xmpp_plugin_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/xmpp/xmpp.php', 'xmpp_plugin_settings_post');
+       Addon::registerHook('page_end', 'addon/xmpp/xmpp.php', 'xmpp_script');
+       Addon::registerHook('logged_in', 'addon/xmpp/xmpp.php', 'xmpp_login');
 }
 
 function xmpp_uninstall()
 {
-       unregister_hook('plugin_settings', 'addon/xmpp/xmpp.php', 'xmpp_plugin_settings');
-       unregister_hook('plugin_settings_post', 'addon/xmpp/xmpp.php', 'xmpp_plugin_settings_post');
-       unregister_hook('page_end', 'addon/xmpp/xmpp.php', 'xmpp_script');
-       unregister_hook('logged_in', 'addon/xmpp/xmpp.php', 'xmpp_login');
+       Addon::unregisterHook('plugin_settings', 'addon/xmpp/xmpp.php', 'xmpp_plugin_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/xmpp/xmpp.php', 'xmpp_plugin_settings_post');
+       Addon::unregisterHook('page_end', 'addon/xmpp/xmpp.php', 'xmpp_script');
+       Addon::unregisterHook('logged_in', 'addon/xmpp/xmpp.php', 'xmpp_login');
 }
 
 function xmpp_plugin_settings_post()
index d5d6d23410cee60d3d7c07b16b75b1a4ec93efb5..96554bb58a92276ece30da3243bef8b94a9c6b70 100644 (file)
@@ -8,19 +8,19 @@
  * Author: Keith Fernie <http://friendika.me4.it/profile/keith>
  * 
  */
-
+use Friendica\Core\Addon;
 use Friendica\Core\Config;
 
 function yourls_install() {
-       register_hook('plugin_settings', 'addon/yourls/yourls.php', 'yourls_addon_settings');
-       register_hook('plugin_settings_post', 'addon/yourls/yourls.php', 'yourls_addon_settings_post');
+       Addon::registerHook('plugin_settings', 'addon/yourls/yourls.php', 'yourls_addon_settings');
+       Addon::registerHook('plugin_settings_post', 'addon/yourls/yourls.php', 'yourls_addon_settings_post');
 
 }
 
 
 function yourls_uninstall() {
-       unregister_hook('plugin_settings', 'addon/yourls/yourls.php', 'yourls_addon_settings');
-       unregister_hook('plugin_settings_post', 'addon/yourls/yourls.php', 'yourls_addon_settings_post');
+       Addon::unregisterHook('plugin_settings', 'addon/yourls/yourls.php', 'yourls_addon_settings');
+       Addon::unregisterHook('plugin_settings_post', 'addon/yourls/yourls.php', 'yourls_addon_settings_post');
        Config::set('yourls','url1',trim($_POST['']));
        Config::set('yourls','username1',trim($_POST['']));
        Config::set('yourls','password1',trim($_POST['']));