]> git.mxchange.org Git - friendica-addons.git/commitdiff
Move connectors addons settings under "connector settings" tab
authorFabio Comuni <fabrix.xm@gmail.com>
Thu, 20 Oct 2011 10:16:43 +0000 (12:16 +0200)
committerFabio Comuni <fabrix.xm@gmail.com>
Thu, 20 Oct 2011 10:16:43 +0000 (12:16 +0200)
facebook/facebook.php
statusnet/statusnet.php
twitter/twitter.php

index 7ffdaffac52a3f8d41d1b344828e4c587d4b9e7d..da028dbcda684a40ee23c13a33096920ff5c43b1 100644 (file)
@@ -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');
index 25b5210842e349d8b603388d5aeae5aa82369938..4cfa0f03fcef793f0a0d2198b0de596af2a0b3a0 100644 (file)
@@ -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
index 51b55fd0a29527f409e7bf058d29fb450dace7fd..6535ff6363e328c7d0aad1e733880b09e5683c06 100644 (file)
@@ -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