diff options
author | Friendika <info@friendika.com> | 2011-05-17 18:25:18 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-05-17 18:25:18 -0700 |
commit | a0a59e0518459076079e904cd257dd9608b9bd37 (patch) | |
tree | 8356ca281c9d83a158c2eb27726105cd060743cc /addon/statusnet | |
parent | 8fa9ca520badd6ae757bbafa647020ed50a288c3 (diff) | |
download | volse-hubzilla-a0a59e0518459076079e904cd257dd9608b9bd37.tar.gz volse-hubzilla-a0a59e0518459076079e904cd257dd9608b9bd37.tar.bz2 volse-hubzilla-a0a59e0518459076079e904cd257dd9608b9bd37.zip |
statusnet post by default
Diffstat (limited to 'addon/statusnet')
-rw-r--r-- | addon/statusnet/statusnet.css | 19 | ||||
-rw-r--r-- | addon/statusnet/statusnet.php | 23 |
2 files changed, 29 insertions, 13 deletions
diff --git a/addon/statusnet/statusnet.css b/addon/statusnet/statusnet.css index 4e27b0938..6c1347fc7 100644 --- a/addon/statusnet/statusnet.css +++ b/addon/statusnet/statusnet.css @@ -12,25 +12,32 @@ } #statusnet-disconnect-label { float: left; - width: 200px; + width: 250px; + margin-bottom: 25px; +} +#statusnet-default-label { + float: left; + width: 250px; margin-bottom: 25px; } #statusnet-disconnect { float: left; } + #statusnet-enable-label { float: left; - width: 200px; + width: 250px; margin-bottom: 5px; } #statusnet-checkbox { float: left; } + #statusnet-pin-label { float: left; - width: 200px; + width: 250px; margin-bottom: 25px; } #statusnet-pin { @@ -40,7 +47,7 @@ #statusnet-consumerkey-label { float: left; - width: 200px; + width: 250px; margin-bottom: 8px; } #statusnet-consumerkey { @@ -49,7 +56,7 @@ } #statusnet-consumersecret-label { float: left; - width: 200px; + width: 250px; margin-bottom: 8px; } #statusnet-consumersecret { @@ -58,7 +65,7 @@ } #statusnet-baseapi-label { float: left; - width: 200px; + width: 250px; margin-bottom: 25px; } #statusnet-baseapi { diff --git a/addon/statusnet/statusnet.php b/addon/statusnet/statusnet.php index 5ed92d13a..ad992f979 100644 --- a/addon/statusnet/statusnet.php +++ b/addon/statusnet/statusnet.php @@ -90,10 +90,11 @@ function statusnet_settings_post ($a,$post) { * if the statusnet-disconnect checkbox is set, clear the statusnet configuration * TODO can we revoke the access tokens at Twitter and do we need to do so? */ - del_pconfig( local_user(), 'statusnet', 'consumerkey' ); - del_pconfig( local_user(), 'statusnet', 'consumersecret' ); - del_pconfig( local_user(), 'statusnet', 'post' ); - del_pconfig( local_user(), 'statusnet', 'oauthtoken' ); + del_pconfig( local_user(), 'statusnet', 'consumerkey' ); + del_pconfig( local_user(), 'statusnet', 'consumersecret' ); + del_pconfig( local_user(), 'statusnet', 'post' ); + del_pconfig( local_user(), 'statusnet', 'post_by_default' ); + del_pconfig( local_user(), 'statusnet', 'oauthtoken' ); del_pconfig( local_user(), 'statusnet', 'oauthsecret' ); del_pconfig( local_user(), 'statusnet', 'baseapi' ); } else { @@ -149,6 +150,8 @@ function statusnet_settings_post ($a,$post) { // 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(),'statusnet','post',intval($_POST['statusnet-enable'])); + set_pconfig(local_user(),'statusnet','post_by_default',intval($_POST['statusnet-default'])); + notice( t('StatusNet settings updated.') . EOL); }}} } function statusnet_settings(&$a,&$s) { @@ -166,8 +169,10 @@ function statusnet_settings(&$a,&$s) { $csecret = get_pconfig(local_user(), 'statusnet', 'consumersecret' ); $otoken = get_pconfig(local_user(), 'statusnet', 'oauthtoken' ); $osecret = get_pconfig(local_user(), 'statusnet', 'oauthsecret' ); - $enabled = get_pconfig(local_user(), 'statusnet', 'post'); + $enabled = get_pconfig(local_user(), 'statusnet', 'post'); $checked = (($enabled) ? ' checked="checked" ' : ''); + $defenabled = get_pconfig(local_user(),'statusnet','post_by_default'); + $defchecked = (($defenabled) ? ' checked="checked" ' : ''); $s .= '<div class="settings-block">'; $s .= '<h3>'. t('StatusNet Posting Settings').'</h3>'; @@ -228,11 +233,15 @@ 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 as well.') .'</p>'; + $s .= '<p>'. t('If enabled all your <strong>public</strong> postings will be posted to the associated StatusNet account.') .'</p>'; $s .= '<div id="statusnet-enable-wrapper">'; - $s .= '<label id="statusnet-enable-label" for="statusnet-checkbox">'. t('Send public postings to StatusNet') .'</label>'; + $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 . '/>'; + $s .= '<div class="clear"></div>'; + $s .= '<label id="statusnet-default-label" for="statusnet-default">'. t('Send public postings to StatusNet by default') .'</label>'; + $s .= '<input id="statusnet-default" type="checkbox" name="statusnet-default" value="1" ' . $defchecked . '/>'; $s .= '</div><div class="clear"></div>'; + $s .= '<div id="statusnet-disconnect-wrapper">'; $s .= '<label id="statusnet-disconnect-label" for="statusnet-disconnect">'. t('Clear OAuth configuration') .'</label>'; $s .= '<input id="statusnet-disconnect" type="checkbox" name="statusnet-disconnect" value="1" />'; |