X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=wppost%2Fwppost.php;h=052b4074d287e6f52a2e66f2acb82e182bef7dc2;hb=bdfe575365366690fe6a3934e793c67db1a2d623;hp=2a0222f75080d4fcd5267d16d250f7f8b188255d;hpb=ea3a9052d83f8ea99cee8438022be0b022a24cc1;p=friendica-addons.git
diff --git a/wppost/wppost.php b/wppost/wppost.php
index 2a0222f7..052b4074 100644
--- a/wppost/wppost.php
+++ b/wppost/wppost.php
@@ -9,9 +9,7 @@
use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML;
use Friendica\Core\Hook;
-use Friendica\Core\L10n;
use Friendica\Core\Logger;
-use Friendica\Core\PConfig;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Util\Network;
@@ -55,7 +53,7 @@ function wppost_jot_nets(\Friendica\App &$a, array &$jotnets_fields)
'type' => 'checkbox',
'field' => [
'wppost_enable',
- L10n::t('Post to Wordpress'),
+ DI::l10n()->t('Post to Wordpress'),
DI::pConfig()->get(local_user(),'wppost','post_by_default')
]
];
@@ -96,54 +94,54 @@ function wppost_settings(&$a,&$s) {
/* Add some HTML to the existing form */
$s .= '';
- $s .= '
'. L10n::t('Wordpress Export').'
';
+ $s .= '
'. DI::l10n()->t('Wordpress Export').'
';
$s .= '';
$s .= '
';
$s .= '';
- $s .= '
'. L10n::t('Wordpress Export').'
';
+ $s .= '
'. DI::l10n()->t('Wordpress Export').'
';
$s .= '';
$s .= '
';
- $s .= '';
+ $s .= '';
$s .= '';
$s .= '
';
$s .= '
';
- $s .= '';
+ $s .= '';
$s .= '';
$s .= '
';
$s .= '
';
- $s .= '';
+ $s .= '';
$s .= '';
$s .= '
';
$s .= '
';
- $s .= '';
+ $s .= '';
$s .= '';
$s .= '
';
$s .= '
';
- $s .= '';
+ $s .= '';
$s .= '';
$s .= '
';
$s .= '
';
- $s .= '';
+ $s .= '';
$s .= '';
$s .= '
';
$s .= '
';
- $s .= '';
+ $s .= '';
$s .= '';
$s .= '
';
$s .= '
';
- $s .= '';
+ $s .= '';
$s .= '';
$s .= '
';
/* provide a submit button */
- $s .= '
';
+ $s .= '';
}
@@ -151,17 +149,17 @@ function wppost_settings(&$a,&$s) {
function wppost_settings_post(&$a,&$b) {
if(!empty($_POST['wppost-submit'])) {
- PConfig::set(local_user(),'wppost','post',intval($_POST['wppost']));
- PConfig::set(local_user(),'wppost','post_by_default',intval($_POST['wp_bydefault'] ?? false));
- PConfig::set(local_user(),'wppost','wp_username',trim($_POST['wp_username']));
- PConfig::set(local_user(),'wppost','wp_password',trim($_POST['wp_password']));
- PConfig::set(local_user(),'wppost','wp_blog',trim($_POST['wp_blog']));
- PConfig::set(local_user(),'wppost','backlink',trim($_POST['wp_backlink'] ?? ''));
- PConfig::set(local_user(),'wppost','shortcheck',trim($_POST['wp_shortcheck']));
+ DI::pConfig()->set(local_user(),'wppost','post',intval($_POST['wppost']));
+ DI::pConfig()->set(local_user(),'wppost','post_by_default',intval($_POST['wp_bydefault'] ?? false));
+ DI::pConfig()->set(local_user(),'wppost','wp_username',trim($_POST['wp_username']));
+ DI::pConfig()->set(local_user(),'wppost','wp_password',trim($_POST['wp_password']));
+ DI::pConfig()->set(local_user(),'wppost','wp_blog',trim($_POST['wp_blog']));
+ DI::pConfig()->set(local_user(),'wppost','backlink',trim($_POST['wp_backlink'] ?? ''));
+ DI::pConfig()->set(local_user(),'wppost','shortcheck',trim($_POST['wp_shortcheck']));
$wp_backlink_text = Strings::escapeTags(trim($_POST['wp_backlink_text']));
$wp_backlink_text = BBCode::convert($wp_backlink_text, false, 8);
$wp_backlink_text = HTML::toPlaintext($wp_backlink_text, 0, true);
- PConfig::set(local_user(),'wppost','wp_backlink_text', $wp_backlink_text);
+ DI::pConfig()->set(local_user(),'wppost','wp_backlink_text', $wp_backlink_text);
}
}
@@ -245,7 +243,7 @@ function wppost_send(&$a, &$b)
$wp_blog = DI::pConfig()->get($b['uid'],'wppost','wp_blog');
$wp_backlink_text = DI::pConfig()->get($b['uid'],'wppost','wp_backlink_text');
if ($wp_backlink_text == '') {
- $wp_backlink_text = L10n::t('Read the origÂiÂnal post and comÂment stream on Friendica');
+ $wp_backlink_text = DI::l10n()->t('Read the origÂiÂnal post and comÂment stream on Friendica');
}
if ($wp_username && $wp_password && $wp_blog) {
@@ -303,7 +301,7 @@ function wppost_send(&$a, &$b)
}
}
- $title = '' . (($wptitle) ? $wptitle : L10n::t('Post from Friendica')) . '';
+ $title = '' . (($wptitle) ? $wptitle : DI::l10n()->t('Post from Friendica')) . '';
$post = BBCode::convert($b['body'], false, 4);
// If a link goes to youtube then remove the stuff around it. Wordpress detects youtube links and embeds it