From 981b079e9ae4e395a7042a0afded09d91f83f95a Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Thu, 20 Oct 2011 12:16:43 +0200 Subject: [PATCH] Move connectors addons settings under "connector settings" tab --- facebook/facebook.php | 3 ++- statusnet/statusnet.php | 12 +++++++----- twitter/twitter.php | 8 +++++--- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/facebook/facebook.php b/facebook/facebook.php index 7ffdaffac..da028dbcd 100644 --- a/facebook/facebook.php +++ b/facebook/facebook.php @@ -50,7 +50,7 @@ define('FACEBOOK_MAXPOSTLEN', 420); function facebook_install() { register_hook('post_local_end', 'addon/facebook/facebook.php', 'facebook_post_hook'); register_hook('jot_networks', 'addon/facebook/facebook.php', 'facebook_jot_nets'); - register_hook('plugin_settings', 'addon/facebook/facebook.php', 'facebook_plugin_settings'); + register_hook('connector_settings', 'addon/facebook/facebook.php', 'facebook_plugin_settings'); register_hook('cron', 'addon/facebook/facebook.php', 'facebook_cron'); register_hook('queue_predeliver', 'addon/facebook/facebook.php', 'fb_queue_hook'); } @@ -59,6 +59,7 @@ function facebook_install() { function facebook_uninstall() { unregister_hook('post_local_end', 'addon/facebook/facebook.php', 'facebook_post_hook'); unregister_hook('jot_networks', 'addon/facebook/facebook.php', 'facebook_jot_nets'); + unregister_hook('connector_settings', 'addon/facebook/facebook.php', 'facebook_plugin_settings'); unregister_hook('plugin_settings', 'addon/facebook/facebook.php', 'facebook_plugin_settings'); unregister_hook('cron', 'addon/facebook/facebook.php', 'facebook_cron'); unregister_hook('queue_predeliver', 'addon/facebook/facebook.php', 'fb_queue_hook'); diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 25b521084..4cfa0f03f 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -106,8 +106,8 @@ class StatusNetOAuth extends TwitterOAuth { function statusnet_install() { // we need some hooks, for the configuration and for sending tweets - register_hook('plugin_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings'); - register_hook('plugin_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post'); + register_hook('connector_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings'); + register_hook('connector_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post'); register_hook('post_local_end', 'addon/statusnet/statusnet.php', 'statusnet_post_hook'); register_hook('jot_networks', 'addon/statusnet/statusnet.php', 'statusnet_jot_nets'); logger("installed statusnet"); @@ -115,6 +115,8 @@ function statusnet_install() { 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('plugin_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings'); unregister_hook('plugin_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post'); unregister_hook('post_local_end', 'addon/statusnet/statusnet.php', 'statusnet_post_hook'); @@ -176,7 +178,7 @@ function statusnet_settings_post ($a,$post) { } } } - goaway($a->get_baseurl().'/settings/addon'); + goaway($a->get_baseurl().'/settings/connectors'); } else { if (isset($_POST['statusnet-consumersecret'])) { // check if we can reach the API of the StatusNet server @@ -203,7 +205,7 @@ function statusnet_settings_post ($a,$post) { notice( t('We could not contact the StatusNet API with the Path you entered.').EOL ); } } - goaway($a->get_baseurl().'/settings/addon'); + goaway($a->get_baseurl().'/settings/connectors'); } else { if (isset($_POST['statusnet-pin'])) { // if the user supplied us with a PIN from Twitter, let the magic of OAuth happen @@ -221,7 +223,7 @@ function statusnet_settings_post ($a,$post) { set_pconfig(local_user(),'statusnet', 'oauthsecret', $token['oauth_token_secret']); set_pconfig(local_user(),'statusnet', 'post', 1); // reload the Addon Settings page, if we don't do it see Bug #42 - goaway($a->get_baseurl().'/settings/addon'); + goaway($a->get_baseurl().'/settings/connectors'); } else { // if no PIN is supplied in the POST variables, the user has changed the setting // to post a tweet for every new __public__ posting to the wall diff --git a/twitter/twitter.php b/twitter/twitter.php index 51b55fd0a..6535ff636 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -43,8 +43,8 @@ function twitter_install() { // we need some hooks, for the configuration and for sending tweets - register_hook('plugin_settings', 'addon/twitter/twitter.php', 'twitter_settings'); - register_hook('plugin_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post'); + 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_end', 'addon/twitter/twitter.php', 'twitter_post_hook'); register_hook('jot_networks', 'addon/twitter/twitter.php', 'twitter_jot_nets'); logger("installed twitter"); @@ -52,6 +52,8 @@ function twitter_install() { 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('plugin_settings', 'addon/twitter/twitter.php', 'twitter_settings'); unregister_hook('plugin_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post'); unregister_hook('post_local_end', 'addon/twitter/twitter.php', 'twitter_post_hook'); @@ -106,7 +108,7 @@ function twitter_settings_post ($a,$post) { set_pconfig(local_user(),'twitter', 'oauthsecret', $token['oauth_token_secret']); set_pconfig(local_user(),'twitter', 'post', 1); // reload the Addon Settings page, if we don't do it see Bug #42 - goaway($a->get_baseurl().'/settings/addon'); + goaway($a->get_baseurl().'/settings/connectors'); } else { // if no PIN is supplied in the POST variables, the user has changed the setting // to post a tweet for every new __public__ posting to the wall