X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=diaspora%2Fdiaspora.php;h=96314d883c5ce5d7c3ec5cd3bb055d9b02070c60;hb=1357817fc38de7be7dc8ebffc1fa0961796fd32d;hp=781c1d045b59d21e283f424000eed5773316145c;hpb=ea3a9052d83f8ea99cee8438022be0b022a24cc1;p=friendica-addons.git diff --git a/diaspora/diaspora.php b/diaspora/diaspora.php index 781c1d04..96314d88 100644 --- a/diaspora/diaspora.php +++ b/diaspora/diaspora.php @@ -12,10 +12,7 @@ require_once 'addon/diaspora/Diaspora_Connection.php'; use Friendica\App; use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; -use Friendica\Core\L10n; use Friendica\Core\Logger; -use Friendica\Core\PConfig; -use Friendica\Core\Protocol; use Friendica\Database\DBA; use Friendica\Core\Worker; use Friendica\DI; @@ -51,7 +48,7 @@ function diaspora_jot_nets(App $a, array &$jotnets_fields) 'type' => 'checkbox', 'field' => [ 'diaspora_enable', - L10n::t('Post to Diaspora'), + DI::l10n()->t('Post to Diaspora'), DI::pConfig()->get(local_user(), 'diaspora', 'post_by_default') ] ]; @@ -87,9 +84,9 @@ function diaspora_settings(App $a, &$s) $r = q("SELECT `addr` FROM `contact` WHERE `self` AND `uid` = %d", intval(local_user())); if (DBA::isResult($r)) { - $status = L10n::t("Please remember: You can always be reached from Diaspora with your Friendica handle %s. ", $r[0]['addr']); - $status .= L10n::t('This connector is only meant if you still want to use your old Diaspora account for some time. '); - $status .= L10n::t('However, it is preferred that you tell your Diaspora contacts the new handle %s instead.', $r[0]['addr']); + $status = DI::l10n()->t("Please remember: You can always be reached from Diaspora with your Friendica handle %s. ", $r[0]['addr']); + $status .= DI::l10n()->t('This connector is only meant if you still want to use your old Diaspora account for some time. '); + $status .= DI::l10n()->t('However, it is preferred that you tell your Diaspora contacts the new handle %s instead.', $r[0]['addr']); } $aspects = false; @@ -100,18 +97,18 @@ function diaspora_settings(App $a, &$s) $aspects = $conn->getAspects(); if (!$aspects) { - $status = L10n::t("Can't login to your Diaspora account. Please check handle (in the format user@domain.tld) and password."); + $status = DI::l10n()->t("Can't login to your Diaspora account. Please check handle (in the format user@domain.tld) and password."); } } /* Add some HTML to the existing form */ $s .= ''; - $s .= '

'. L10n::t('Diaspora Export').'

'; + $s .= '

'. DI::l10n()->t('Diaspora Export').'

'; $s .= '
'; $s .= '
'; /* provide a submit button */ - $s .= '
'; + $s .= '
'; } @@ -174,11 +171,11 @@ function diaspora_settings(App $a, &$s) function diaspora_settings_post(App $a, &$b) { if (!empty($_POST['diaspora-submit'])) { - PConfig::set(local_user(),'diaspora', 'post' , intval($_POST['diaspora'])); - PConfig::set(local_user(),'diaspora', 'post_by_default', intval($_POST['diaspora_bydefault'])); - PConfig::set(local_user(),'diaspora', 'handle' , trim($_POST['handle'])); - PConfig::set(local_user(),'diaspora', 'password' , trim($_POST['password'])); - PConfig::set(local_user(),'diaspora', 'aspect' , trim($_POST['aspect'])); + DI::pConfig()->set(local_user(),'diaspora', 'post' , intval($_POST['diaspora'])); + DI::pConfig()->set(local_user(),'diaspora', 'post_by_default', intval($_POST['diaspora_bydefault'])); + DI::pConfig()->set(local_user(),'diaspora', 'handle' , trim($_POST['handle'])); + DI::pConfig()->set(local_user(),'diaspora', 'password' , trim($_POST['password'])); + DI::pConfig()->set(local_user(),'diaspora', 'aspect' , trim($_POST['aspect'])); } }