Move connectors addons settings under "connector settings" tab

pull/1/head
Fabio Comuni 2011-10-20 12:16:43 +02:00
parent a3eb7268ae
commit 981b079e9a
3 changed files with 14 additions and 9 deletions

View File

@ -50,7 +50,7 @@ define('FACEBOOK_MAXPOSTLEN', 420);
function facebook_install() { function facebook_install() {
register_hook('post_local_end', 'addon/facebook/facebook.php', 'facebook_post_hook'); 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('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('cron', 'addon/facebook/facebook.php', 'facebook_cron');
register_hook('queue_predeliver', 'addon/facebook/facebook.php', 'fb_queue_hook'); register_hook('queue_predeliver', 'addon/facebook/facebook.php', 'fb_queue_hook');
} }
@ -59,6 +59,7 @@ function facebook_install() {
function facebook_uninstall() { function facebook_uninstall() {
unregister_hook('post_local_end', 'addon/facebook/facebook.php', 'facebook_post_hook'); 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('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('plugin_settings', 'addon/facebook/facebook.php', 'facebook_plugin_settings');
unregister_hook('cron', 'addon/facebook/facebook.php', 'facebook_cron'); unregister_hook('cron', 'addon/facebook/facebook.php', 'facebook_cron');
unregister_hook('queue_predeliver', 'addon/facebook/facebook.php', 'fb_queue_hook'); unregister_hook('queue_predeliver', 'addon/facebook/facebook.php', 'fb_queue_hook');

View File

@ -106,8 +106,8 @@ class StatusNetOAuth extends TwitterOAuth {
function statusnet_install() { function statusnet_install() {
// we need some hooks, for the configuration and for sending tweets // we need some hooks, for the configuration and for sending tweets
register_hook('plugin_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings'); register_hook('connector_settings', 'addon/statusnet/statusnet.php', 'statusnet_settings');
register_hook('plugin_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post'); 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('post_local_end', 'addon/statusnet/statusnet.php', 'statusnet_post_hook');
register_hook('jot_networks', 'addon/statusnet/statusnet.php', 'statusnet_jot_nets'); register_hook('jot_networks', 'addon/statusnet/statusnet.php', 'statusnet_jot_nets');
logger("installed statusnet"); logger("installed statusnet");
@ -115,6 +115,8 @@ function statusnet_install() {
function statusnet_uninstall() { 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', 'addon/statusnet/statusnet.php', 'statusnet_settings');
unregister_hook('plugin_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post'); unregister_hook('plugin_settings_post', 'addon/statusnet/statusnet.php', 'statusnet_settings_post');
unregister_hook('post_local_end', 'addon/statusnet/statusnet.php', 'statusnet_post_hook'); 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 { } else {
if (isset($_POST['statusnet-consumersecret'])) { if (isset($_POST['statusnet-consumersecret'])) {
// check if we can reach the API of the StatusNet server // 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 ); 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 { } else {
if (isset($_POST['statusnet-pin'])) { if (isset($_POST['statusnet-pin'])) {
// if the user supplied us with a PIN from Twitter, let the magic of OAuth happen // 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', 'oauthsecret', $token['oauth_token_secret']);
set_pconfig(local_user(),'statusnet', 'post', 1); set_pconfig(local_user(),'statusnet', 'post', 1);
// reload the Addon Settings page, if we don't do it see Bug #42 // 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 { } else {
// if no PIN is supplied in the POST variables, the user has changed the setting // 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 // to post a tweet for every new __public__ posting to the wall

View File

@ -43,8 +43,8 @@
function twitter_install() { function twitter_install() {
// we need some hooks, for the configuration and for sending tweets // we need some hooks, for the configuration and for sending tweets
register_hook('plugin_settings', 'addon/twitter/twitter.php', 'twitter_settings'); register_hook('connector_settings', 'addon/twitter/twitter.php', 'twitter_settings');
register_hook('plugin_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post'); 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('post_local_end', 'addon/twitter/twitter.php', 'twitter_post_hook');
register_hook('jot_networks', 'addon/twitter/twitter.php', 'twitter_jot_nets'); register_hook('jot_networks', 'addon/twitter/twitter.php', 'twitter_jot_nets');
logger("installed twitter"); logger("installed twitter");
@ -52,6 +52,8 @@ function twitter_install() {
function twitter_uninstall() { 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', 'addon/twitter/twitter.php', 'twitter_settings');
unregister_hook('plugin_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post'); unregister_hook('plugin_settings_post', 'addon/twitter/twitter.php', 'twitter_settings_post');
unregister_hook('post_local_end', 'addon/twitter/twitter.php', 'twitter_post_hook'); 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', 'oauthsecret', $token['oauth_token_secret']);
set_pconfig(local_user(),'twitter', 'post', 1); set_pconfig(local_user(),'twitter', 'post', 1);
// reload the Addon Settings page, if we don't do it see Bug #42 // 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 { } else {
// if no PIN is supplied in the POST variables, the user has changed the setting // 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 // to post a tweet for every new __public__ posting to the wall