diff --git a/gpluspost/gpluspost.php b/gpluspost/gpluspost.php index 35278495..dae59efe 100644 --- a/gpluspost/gpluspost.php +++ b/gpluspost/gpluspost.php @@ -2,7 +2,7 @@ /** * Name: G+ Post - * Description: Posts to a Google+ page with the help of Seesmic + * Description: Posts to a Google+ page with the help of Hootsuite * Version: 0.1 * Author: Michael Vogel */ diff --git a/jappixmini/jappixmini.php b/jappixmini/jappixmini.php index 69c58e94..aac5c548 100644 --- a/jappixmini/jappixmini.php +++ b/jappixmini/jappixmini.php @@ -122,6 +122,22 @@ function jappixmini_plugin_admin(&$a, &$o) { $o .= ''; $o .= '
'; + // bosh address + $bosh_address = get_config("jappixmini", "bosh_address"); + $o .= '


'; + $o .= '

'; + + // default server address + $default_server = get_config("jappixmini", "default_server"); + $o .= '


'; + $o .= '

'; + + // default user name to friendica nickname + $default_user = intval(get_config("jappixmini", "default_user")); + $default_user = intval($default_user) ? ' checked="checked"' : ''; + $o .= ''; + $o .= '
'; + // info text field $info_text = get_config("jappixmini", "infotext"); $o .= '


'; @@ -137,8 +153,14 @@ function jappixmini_plugin_admin_post(&$a) { if ($submit) { $info_text = $_REQUEST['jappixmini-infotext']; $bosh_proxy = intval($_REQUEST['jappixmini-proxy']); + $default_user = intval($_REQUEST['jappixmini-defaultuser']); + $bosh_address = $_REQUEST['jappixmini-address']; + $default_server = $_REQUEST['jappixmini-server']; set_config("jappixmini", "infotext", $info_text); set_config("jappixmini", "bosh_proxy", $bosh_proxy); + set_config("jappixmini", "bosh_address", $bosh_address); + set_config("jappixmini", "default_server", $default_server); + set_config("jappixmini", "default_user", $default_user); } } @@ -224,6 +246,11 @@ function jappixmini_settings(&$a, &$s) { $dontinsertchat = get_pconfig(local_user(),'jappixmini','dontinsertchat'); $insertchat = !(intval($dontinsertchat) ? ' checked="checked"' : ''); + $defaultbosh = get_config("jappixmini", "bosh_address"); + + if ($defaultbosh != "") + set_pconfig(local_user(),'jappixmini','bosh', $defaultbosh); + $username = get_pconfig(local_user(),'jappixmini','username'); $username = htmlentities($username); $server = get_pconfig(local_user(),'jappixmini','server'); @@ -239,6 +266,12 @@ function jappixmini_settings(&$a, &$s) { $encrypt_checked = $encrypt ? ' checked="checked"' : ''; $encrypt_disabled = $encrypt ? '' : ' disabled="disabled"'; + if ($server == "") + $server = get_config("jappixmini", "default_server"); + + if (($username == "") and get_config("jappixmini", "default_user")) + $username = $a->user["nickname"]; + $info_text = get_config("jappixmini", "infotext"); $info_text = htmlentities($info_text); $info_text = str_replace("\n", "
", $info_text); @@ -278,9 +311,12 @@ function jappixmini_settings(&$a, &$s) { $s .= ' '; $s .= '
'; - $s .= ''; - $s .= ' '; - $s .= '
'; + if (defaultbosh == "") { + $s .= ''; + $s .= ' '; + $s .= '
'; + } + $s .= ''; $s .= ' '; diff --git a/jappixmini/lib.js b/jappixmini/lib.js index a777a7fd..ed52f597 100644 --- a/jappixmini/lib.js +++ b/jappixmini/lib.js @@ -40,7 +40,7 @@ function jappixmini_addon_get_client_secret(callback) { var div = document.getElementById("#jappixmini-password-query-div"); if (!div) { - div = $('

Retype your Friendica password for chatting:
'); + div = $('
Retype your Friendica password for chatting:
'); var input = $('') div.append(input); diff --git a/pumpio/pumpio.css b/pumpio/pumpio.css index eba380e4..020f3697 100755 --- a/pumpio/pumpio.css +++ b/pumpio/pumpio.css @@ -1,11 +1,11 @@ -#pumpio-mirror-label,#pumpio-public-label, #pumpio-enable-label, #pumpio-username-label, #pumpio-servername-label, #pumpio-bydefault-label { +#pumpio-mirror-label,#pumpio-public-label, #pumpio-enable-label, #pumpio-username-label, #pumpio-servername-label, #pumpio-bydefault-label, #pumpio-delete-label { float: left; width: 200px; margin-top: 10px; } -#pumpio-mirror,#pumpio-public, #pumpio-checkbox, #pumpio-username, #pumpio-servername, #pumpio-bydefault { +#pumpio-mirror,#pumpio-public, #pumpio-checkbox, #pumpio-username, #pumpio-servername, #pumpio-bydefault, #pumpio-delete { float: left; margin-top: 10px; } diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index b7634bcb..da723eca 100755 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -198,47 +198,59 @@ function pumpio_settings(&$a,&$s) { $s .= '
'; $s .= '

' . t('Pump.io Post Settings') . '

'; - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; - $s .= '
'; $s .= ''; $s .= ''; $s .= '
'; + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + if (($username != '') AND ($servername != '')) { - $s .= '
'; - - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; - - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; - - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; - - $s .= '
'; - $s .= ''; - $s .= ''; - $s .= '
'; $oauth_token = get_pconfig(local_user(), "pumpio", "oauth_token"); $oauth_token_secret = get_pconfig(local_user(), "pumpio", "oauth_token_secret"); $s .= '
'; - if (($oauth_token == "") OR ($oauth_token_secret == "")) - $s .= t("You are not authenticated to pumpio"); + if (($oauth_token == "") OR ($oauth_token_secret == "")) { + $s .= '
'; + + //$s .= t("You are not authenticated to pumpio"); + } else { + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + //$s .= '
'; + + } $s .= '
'; } @@ -253,28 +265,37 @@ function pumpio_settings(&$a,&$s) { function pumpio_settings_post(&$a,&$b) { if(x($_POST,'pumpio-submit')) { - // filtering the username if it is filled wrong - $user = $_POST['pumpio_user']; - if (strstr($user, "@")) { - $pos = strpos($user, "@"); - if ($pos > 0) - $user = substr($user, 0, $pos); + if(x($_POST,'pumpio_delete')) { + set_pconfig(local_user(),'pumpio','consumer_key',''); + set_pconfig(local_user(),'pumpio','consumer_secret',''); + set_pconfig(local_user(),'pumpio','host',''); + set_pconfig(local_user(),'pumpio','oauth_token',''); + set_pconfig(local_user(),'pumpio','oauth_token_secret',''); + set_pconfig(local_user(),'pumpio','post',false); + set_pconfig(local_user(),'pumpio','post_by_default',false); + set_pconfig(local_user(),'pumpio','user',''); + } else { + // filtering the username if it is filled wrong + $user = $_POST['pumpio_user']; + if (strstr($user, "@")) { + $pos = strpos($user, "@"); + if ($pos > 0) + $user = substr($user, 0, $pos); + } + + // Filtering the hostname if someone is entering it with "http" + $host = $_POST['pumpio_host']; + $host = trim($host); + $host = str_replace(array("https://", "http://"), array("", ""), $host); + + set_pconfig(local_user(),'pumpio','post',intval($_POST['pumpio'])); + set_pconfig(local_user(),'pumpio','host',$host); + set_pconfig(local_user(),'pumpio','user',$user); + set_pconfig(local_user(),'pumpio','public',$_POST['pumpio_public']); + set_pconfig(local_user(),'pumpio','mirror',$_POST['pumpio_mirror']); + set_pconfig(local_user(),'pumpio','post_by_default',intval($_POST['pumpio_bydefault'])); } - - // Filtering the hostname if someone is entering it with "http" - $host = $_POST['pumpio_host']; - $host = trim($host); - $host = str_replace(array("https://", "http://"), array("", ""), $host); - - set_pconfig(local_user(),'pumpio','post',intval($_POST['pumpio'])); - set_pconfig(local_user(),'pumpio','host',$host); - set_pconfig(local_user(),'pumpio','user',$user); - set_pconfig(local_user(),'pumpio','public',$_POST['pumpio_public']); - set_pconfig(local_user(),'pumpio','mirror',$_POST['pumpio_mirror']); - set_pconfig(local_user(),'pumpio','post_by_default',intval($_POST['pumpio_bydefault'])); - } - } function pumpio_post_local(&$a,&$b) {