aboutsummaryrefslogtreecommitdiffstats
path: root/addon
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2011-07-29 17:23:09 +0200
committerFabio Comuni <fabrix.xm@gmail.com>2011-07-29 17:23:09 +0200
commitac6945eed1644e7a9e58c5f74dae696ff0f09d72 (patch)
treeb3b13f5569869a2feffb3990ea8e33313f789e5e /addon
parentb1e766dadb1d4a9e727b2d1d5f32442392ac6bd3 (diff)
parentf47d582736ddf24528dd514850d4bed76783f589 (diff)
downloadvolse-hubzilla-ac6945eed1644e7a9e58c5f74dae696ff0f09d72.tar.gz
volse-hubzilla-ac6945eed1644e7a9e58c5f74dae696ff0f09d72.tar.bz2
volse-hubzilla-ac6945eed1644e7a9e58c5f74dae696ff0f09d72.zip
Merge remote-tracking branch 'friendika/master'
Diffstat (limited to 'addon')
-rw-r--r--addon/impressum/impressum.php2
-rw-r--r--addon/piwik/piwik.php2
-rw-r--r--addon/statusnet/statusnet.php10
-rw-r--r--addon/twitter/twitter.php22
4 files changed, 23 insertions, 13 deletions
diff --git a/addon/impressum/impressum.php b/addon/impressum/impressum.php
index b93d9eef6..b760c7e0d 100644
--- a/addon/impressum/impressum.php
+++ b/addon/impressum/impressum.php
@@ -4,7 +4,7 @@
* Description: Plugin to add contact information to the about page (/friendika)
* Version: 1.0
* Author: Tobias Diekershoff <https://diekershoff.homeunix.net/friendika/profile/tobias>
- * License: 3-clause BSD license (same as Friendika)
+ * License: 3-clause BSD license
*/
function impressum_install() {
diff --git a/addon/piwik/piwik.php b/addon/piwik/piwik.php
index 3cc136d29..8389416e9 100644
--- a/addon/piwik/piwik.php
+++ b/addon/piwik/piwik.php
@@ -12,7 +12,7 @@
* Author: Tobias Diekershoff
* tobias.diekershoff@gmx.net
*
- * License: 3-clause BSD license (same as Friendika)
+* License: 3-clause BSD license
*
* Configuration:
* Add the following two lines to your .htconfig.php file:
diff --git a/addon/statusnet/statusnet.php b/addon/statusnet/statusnet.php
index 63cdd28df..bf6cbfbc7 100644
--- a/addon/statusnet/statusnet.php
+++ b/addon/statusnet/statusnet.php
@@ -1,7 +1,7 @@
<?php
/**
* Name: StatusNet Connector
- * Version: 1.0
+ * Version: 1.0.1
* Author: Tobias Diekershoff <https://diekershoff.homeunix.net/friendika/profile/tobias>
*/
@@ -10,7 +10,7 @@
* Author: Tobias Diekershoff
* tobias.diekershoff@gmx.net
*
- * License:3-clause BSD license (same as Friendika)
+ * License:3-clause BSD license
*
* Configuration:
* To activate the plugin itself add it to the $a->config['system']['addon']
@@ -155,8 +155,8 @@ function statusnet_settings_post ($a,$post) {
goaway($a->get_baseurl().'/settings/addon');
} else {
if (isset($_POST['statusnet-pin'])) {
- // if the user supplied us with a PIN from Twitter, let the magic of OAuth happen
- logger('got a StatusNet security code');
+ // if the user supplied us with a PIN from Twitter, let the magic of OAuth happen
+ logger('got a StatusNet security code');
$api = get_pconfig(local_user(), 'statusnet', 'baseapi');
$ckey = get_pconfig(local_user(), 'statusnet', 'consumerkey' );
$csecret = get_pconfig(local_user(), 'statusnet', 'consumersecret' );
@@ -276,7 +276,7 @@ function statusnet_settings(&$a,&$s) {
$connection = new StatusNetOAuth($api,$ckey,$csecret,$otoken,$osecret);
$details = $connection->get('account/verify_credentials');
$s .= '<div id="statusnet-info" ><img id="statusnet-avatar" src="'.$details->profile_image_url.'" /><p id="statusnet-info-block">'. t('Currently connected to: ') .'<a href="'.$details->statusnet_profile_url.'" target="_statusnet">'.$details->screen_name.'</a><br /><em>'.$details->description.'</em></p></div>';
- $s .= '<p>'. t('If enabled all your <strong>public</strong> postings will be posted to the associated StatusNet account.') .'</p>';
+ $s .= '<p>'. t('If enabled all your <strong>public</strong> postings can be posted to the associated StatusNet account. You can choose to do so by default (here) or for every posting separately in the posting options when writing the entry.') .'</p>';
$s .= '<div id="statusnet-enable-wrapper">';
$s .= '<label id="statusnet-enable-label" for="statusnet-checkbox">'. t('Allow posting to StatusNet') .'</label>';
$s .= '<input id="statusnet-checkbox" type="checkbox" name="statusnet-enable" value="1" ' . $checked . '/>';
diff --git a/addon/twitter/twitter.php b/addon/twitter/twitter.php
index 7f2b2e1c7..c3fbc3e64 100644
--- a/addon/twitter/twitter.php
+++ b/addon/twitter/twitter.php
@@ -1,7 +1,7 @@
<?php
/**
* Name: Twitter Connector
- * Version: 1.0
+ * Version: 1.0.1
* Author: Tobias Diekershoff <https://diekershoff.homeunix.net/friendika/profile/tobias>
*/
@@ -11,7 +11,7 @@
* Author: Tobias Diekershoff
* tobias.diekershoff@gmx.net
*
- * License:3-clause BSD license (same as Friendika)
+ * License:3-clause BSD license
*
* Configuration:
* To use this plugin you need a OAuth Consumer key pair (key & secret)
@@ -87,7 +87,8 @@ function twitter_settings_post ($a,$post) {
*/
del_pconfig( local_user(), 'twitter', 'consumerkey' );
del_pconfig( local_user(), 'twitter', 'consumersecret' );
- del_pconfig( local_user(), 'twitter', 'post' );
+ del_pconfig( local_user(), 'twitter', 'post' );
+ del_pconfig( local_user(), 'twitter', 'post_by_default' );
} else {
if (isset($_POST['twitter-pin'])) {
// if the user supplied us with a PIN from Twitter, let the magic of OAuth happen
@@ -105,11 +106,13 @@ 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
- header('Location: '.$a->get_baseurl().'/settings/addon');
+ goaway($a->get_baseurl().'/settings/addon');
} 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
set_pconfig(local_user(),'twitter','post',intval($_POST['twitter-enable']));
+ set_pconfig(local_user(),'twitter','post_by_default',intval($_POST['twitter-default']));
+ info( t('Twitter settings updated.') . EOL);
}}
}
function twitter_settings(&$a,&$s) {
@@ -127,6 +130,9 @@ function twitter_settings(&$a,&$s) {
$osecret = get_pconfig(local_user(), 'twitter', 'oauthsecret' );
$enabled = get_pconfig(local_user(), 'twitter', 'post');
$checked = (($enabled) ? ' checked="checked" ' : '');
+ $defenabled = get_pconfig(local_user(),'twitter','post_by_default');
+ $defchecked = (($defenabled) ? ' checked="checked" ' : '');
+
$s .= '<div class="settings-block">';
$s .= '<h3>'. t('Twitter Posting Settings') .'</h3>';
@@ -172,11 +178,15 @@ function twitter_settings(&$a,&$s) {
$connection = new TwitterOAuth($ckey,$csecret,$otoken,$osecret);
$details = $connection->get('account/verify_credentials');
$s .= '<div id="twitter-info" ><img id="twitter-avatar" src="'.$details->profile_image_url.'" /><p id="twitter-info-block">'. t('Currently connected to: ') .'<a href="https://twitter.com/'.$details->screen_name.'" target="_twitter">'.$details->screen_name.'</a><br /><em>'.$details->description.'</em></p></div>';
- $s .= '<p>'. t('If enabled all your <strong>public</strong> postings will be posted to the associated Twitter account as well.') .'</p>';
+ $s .= '<p>'. t('If enabled all your <strong>public</strong> postings can be posted to the associated Twitter account. You can choose to do so by default (here) or for every posting separately in the posting options when writing the entry.') .'</p>';
$s .= '<div id="twitter-enable-wrapper">';
- $s .= '<label id="twitter-enable-label" for="twitter-checkbox">'. t('Send public postings to Twitter'). '</label>';
+ $s .= '<label id="twitter-enable-label" for="twitter-checkbox">'. t('Allow posting to Twitter'). '</label>';
$s .= '<input id="twitter-checkbox" type="checkbox" name="twitter-enable" value="1" ' . $checked . '/>';
+ $s .= '<div class="clear"></div>';
+ $s .= '<label id="twitter-default-label" for="twitter-default">'. t('Send public postings to Twitter by default') .'</label>';
+ $s .= '<input id="twitter-default" type="checkbox" name="twitter-default" value="1" ' . $defchecked . '/>';
$s .= '</div><div class="clear"></div>';
+
$s .= '<div id="twitter-disconnect-wrapper">';
$s .= '<label id="twitter-disconnect-label" for="twitter-disconnect">'. t('Clear OAuth configuration') .'</label>';
$s .= '<input id="twitter-disconnect" type="checkbox" name="twitter-disconnect" value="1" />';