X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=statusnet%2Fstatusnet.php;h=7308f223de5ad70267e65f5e5339758c87a61ad0;hb=e090ee2990350ad051d894eac9fdeb509a3f2c51;hp=3d7083893418ad6870476e07624a4f8ef37807d9;hpb=c71f7b0e1a7bb5ca88347b295dd3a4cc3106c5a9;p=friendica-addons.git
diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php
index 3d708389..7308f223 100644
--- a/statusnet/statusnet.php
+++ b/statusnet/statusnet.php
@@ -47,13 +47,18 @@ require_once 'include/enotify.php';
use Friendica\App;
use Friendica\Content\OEmbed;
+use Friendica\Content\Text\BBCode;
+use Friendica\Content\Text\Plaintext;
use Friendica\Core\Addon;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Model\GContact;
use Friendica\Model\Group;
+use Friendica\Model\Item;
use Friendica\Model\Photo;
use Friendica\Model\User;
+use Friendica\Util\Network;
class StatusNetOAuth extends TwitterOAuth
{
@@ -190,7 +195,7 @@ function statusnet_jot_nets(App $a, &$b)
$statusnet_defpost = PConfig::get(local_user(), 'statusnet', 'post_by_default');
$selected = ((intval($statusnet_defpost) == 1) ? ' checked="checked" ' : '');
$b .= '
'
- . t('Post to GNU Social') . '
';
+ . L10n::t('Post to GNU Social') . '';
}
}
@@ -231,14 +236,14 @@ function statusnet_settings_post(App $a, $post)
foreach ($globalsn as $asn) {
if ($asn['apiurl'] == $_POST['statusnet-preconf-apiurl']) {
$apibase = $asn['apiurl'];
- $c = fetch_url($apibase . 'statusnet/version.xml');
+ $c = Network::fetchUrl($apibase . 'statusnet/version.xml');
if (strlen($c) > 0) {
PConfig::set(local_user(), 'statusnet', 'consumerkey', $asn['consumerkey']);
PConfig::set(local_user(), 'statusnet', 'consumersecret', $asn['consumersecret']);
PConfig::set(local_user(), 'statusnet', 'baseapi', $asn['apiurl']);
//PConfig::set(local_user(), 'statusnet', 'application_name', $asn['applicationname'] );
} else {
- notice(t('Please contact your site administrator. The provided API URL is not valid.') . EOL . $asn['apiurl'] . EOL);
+ notice(L10n::t('Please contact your site administrator. The provided API URL is not valid.') . EOL . $asn['apiurl'] . EOL);
}
}
}
@@ -249,7 +254,7 @@ function statusnet_settings_post(App $a, $post)
// we'll check the API Version for that, if we don't get one we'll try to fix the path but will
// resign quickly after this one try to fix the path ;-)
$apibase = $_POST['statusnet-baseapi'];
- $c = fetch_url($apibase . 'statusnet/version.xml');
+ $c = Network::fetchUrl($apibase . 'statusnet/version.xml');
if (strlen($c) > 0) {
// ok the API path is correct, let's save the settings
PConfig::set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']);
@@ -259,7 +264,7 @@ function statusnet_settings_post(App $a, $post)
} else {
// the API path is not correct, maybe missing trailing / ?
$apibase = $apibase . '/';
- $c = fetch_url($apibase . 'statusnet/version.xml');
+ $c = Network::fetchUrl($apibase . 'statusnet/version.xml');
if (strlen($c) > 0) {
// ok the API path is now correct, let's save the settings
PConfig::set(local_user(), 'statusnet', 'consumerkey', $_POST['statusnet-consumerkey']);
@@ -267,7 +272,7 @@ function statusnet_settings_post(App $a, $post)
PConfig::set(local_user(), 'statusnet', 'baseapi', $apibase);
} else {
// still not the correct API base, let's do noting
- notice(t('We could not contact the GNU Social API with the Path you entered.') . EOL);
+ notice(L10n::t('We could not contact the GNU Social API with the Path you entered.') . EOL);
}
}
goaway('settings/connectors');
@@ -301,7 +306,7 @@ function statusnet_settings_post(App $a, $post)
if (!intval($_POST['statusnet-mirror']))
PConfig::delete(local_user(), 'statusnet', 'lastid');
- info(t('GNU Social settings updated.') . EOL);
+ info(L10n::t('GNU Social settings updated.') . EOL);
}
}
}
@@ -342,11 +347,11 @@ function statusnet_settings(App $a, &$s)
$css = (($enabled) ? '' : '-disabled');
$s .= '';
- $s .= '
' . t('GNU Social Import/Export/Mirror') . '
';
+ $s .= '
' . L10n::t('GNU Social Import/Export/Mirror') . '
';
$s .= '';
$s .= '
';
$s .= '';
- $s .= '
' . t('GNU Social Import/Export/Mirror') . '
';
+ $s .= '
' . L10n::t('GNU Social Import/Export/Mirror') . '
';
$s .= '';
if ((!$ckey) && (!$csecret)) {
@@ -361,31 +366,31 @@ function statusnet_settings(App $a, &$s)
* ignore this option entirely.
*/
if (!$globalsn == null) {
- $s .= '
' . t('Globally Available GNU Social OAuthKeys') . '
';
- $s .= '
' . t("There are preconfigured OAuth key pairs for some GNU Social servers available. If you are using one of them, please use these credentials. If not feel free to connect to any other GNU Social instance \x28see below\x29.") . '
';
+ $s .= '
' . L10n::t('Globally Available GNU Social OAuthKeys') . '
';
+ $s .= '
' . L10n::t("There are preconfigured OAuth key pairs for some GNU Social servers available. If you are using one of them, please use these credentials. If not feel free to connect to any other GNU Social instance \x28see below\x29.") . '
' . t('No consumer key pair for GNU Social found. Register your Friendica Account as an desktop client on your GNU Social account, copy the consumer key pair here and enter the API base root. Before you register your own OAuth key pair ask the administrator if there is already a key pair for this Friendica installation at your favorited GNU Social installation.') . '
';
+ $s .= '
' . L10n::t('Provide your own OAuth Credentials') . '
';
+ $s .= '
' . L10n::t('No consumer key pair for GNU Social found. Register your Friendica Account as an desktop client on your GNU Social account, copy the consumer key pair here and enter the API base root. Before you register your own OAuth key pair ask the administrator if there is already a key pair for this Friendica installation at your favorited GNU Social installation.') . '
';
} else {
/* * *
@@ -404,22 +409,22 @@ function statusnet_settings(App $a, &$s)
/* * *
* make some nice form
*/
- $s .= '
' . t('To connect to your GNU Social account click the button below to get a security code from GNU Social which you have to copy into the input box below and submit the form. Only your public posts will be posted to GNU Social.') . '
';
- $s .= '';
+ $s .= '
' . L10n::t('To connect to your GNU Social account click the button below to get a security code from GNU Social which you have to copy into the input box below and submit the form. Only your public posts will be posted to GNU Social.') . '
' . t('If enabled all your public postings can be posted to the associated GNU Social account. You can choose to do so by default (here) or for every posting separately in the posting options when writing the entry.') . '
' . L10n::t('If enabled all your public postings can be posted to the associated GNU Social account. You can choose to do so by default (here) or for every posting separately in the posting options when writing the entry.') . '
';
if ($a->user['hidewall']) {
- $s .= '
' . t('Note: Due your privacy settings (Hide your profile details from unknown viewers?) the link potentially included in public postings relayed to GNU Social will lead the visitor to a blank page informing the visitor that the access to your profile has been restricted.') . '
';
+ $s .= '
' . L10n::t('Note: Due your privacy settings (Hide your profile details from unknown viewers?) the link potentially included in public postings relayed to GNU Social will lead the visitor to a blank page informing the visitor that the access to your profile has been restricted.') . '