Move PConfig::get() to DI::pConfig()->get()

This commit is contained in:
nupplaPhil 2020-01-18 16:50:56 +01:00
parent 2a35176588
commit ea3a9052d8
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
42 changed files with 414 additions and 412 deletions

View file

@ -50,13 +50,13 @@ function wppost_jot_nets(\Friendica\App &$a, array &$jotnets_fields)
return;
}
if (PConfig::get(local_user(),'wppost','post')) {
if (DI::pConfig()->get(local_user(),'wppost','post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'wppost_enable',
L10n::t('Post to Wordpress'),
PConfig::get(local_user(),'wppost','post_by_default')
DI::pConfig()->get(local_user(),'wppost','post_by_default')
]
];
}
@ -74,23 +74,23 @@ function wppost_settings(&$a,&$s) {
/* Get the current state of our config variables */
$enabled = PConfig::get(local_user(),'wppost','post');
$enabled = DI::pConfig()->get(local_user(),'wppost','post');
$checked = (($enabled) ? ' checked="checked" ' : '');
$css = (($enabled) ? '' : '-disabled');
$def_enabled = PConfig::get(local_user(),'wppost','post_by_default');
$back_enabled = PConfig::get(local_user(),'wppost','backlink');
$shortcheck_enabled = PConfig::get(local_user(),'wppost','shortcheck');
$def_enabled = DI::pConfig()->get(local_user(),'wppost','post_by_default');
$back_enabled = DI::pConfig()->get(local_user(),'wppost','backlink');
$shortcheck_enabled = DI::pConfig()->get(local_user(),'wppost','shortcheck');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
$back_checked = (($back_enabled) ? ' checked="checked" ' : '');
$shortcheck_checked = (($shortcheck_enabled) ? ' checked="checked" ' : '');
$wp_username = PConfig::get(local_user(), 'wppost', 'wp_username');
$wp_password = PConfig::get(local_user(), 'wppost', 'wp_password');
$wp_blog = PConfig::get(local_user(), 'wppost', 'wp_blog');
$wp_backlink_text = PConfig::get(local_user(), 'wppost', 'wp_backlink_text');
$wp_username = DI::pConfig()->get(local_user(), 'wppost', 'wp_username');
$wp_password = DI::pConfig()->get(local_user(), 'wppost', 'wp_password');
$wp_blog = DI::pConfig()->get(local_user(), 'wppost', 'wp_blog');
$wp_backlink_text = DI::pConfig()->get(local_user(), 'wppost', 'wp_backlink_text');
/* Add some HTML to the existing form */
@ -197,11 +197,11 @@ function wppost_post_local(&$a, &$b) {
return;
}
$wp_post = intval(PConfig::get(local_user(),'wppost','post'));
$wp_post = intval(DI::pConfig()->get(local_user(),'wppost','post'));
$wp_enable = (($wp_post && !empty($_REQUEST['wppost_enable'])) ? intval($_REQUEST['wppost_enable']) : 0);
if ($b['api_source'] && intval(PConfig::get(local_user(),'wppost','post_by_default'))) {
if ($b['api_source'] && intval(DI::pConfig()->get(local_user(),'wppost','post_by_default'))) {
$wp_enable = 1;
}
@ -240,10 +240,10 @@ function wppost_send(&$a, &$b)
return;
}
$wp_username = XML::escape(PConfig::get($b['uid'], 'wppost', 'wp_username'));
$wp_password = XML::escape(PConfig::get($b['uid'], 'wppost', 'wp_password'));
$wp_blog = PConfig::get($b['uid'],'wppost','wp_blog');
$wp_backlink_text = PConfig::get($b['uid'],'wppost','wp_backlink_text');
$wp_username = XML::escape(DI::pConfig()->get($b['uid'], 'wppost', 'wp_username'));
$wp_password = XML::escape(DI::pConfig()->get($b['uid'], 'wppost', 'wp_password'));
$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');
}
@ -251,7 +251,7 @@ function wppost_send(&$a, &$b)
if ($wp_username && $wp_password && $wp_blog) {
$wptitle = trim($b['title']);
if (intval(PConfig::get($b['uid'], 'wppost', 'shortcheck'))) {
if (intval(DI::pConfig()->get($b['uid'], 'wppost', 'shortcheck'))) {
// Checking, if its a post that is worth a blog post
$postentry = false;
$siteinfo = BBCode::getAttachedData($b["body"]);
@ -312,7 +312,7 @@ function wppost_send(&$a, &$b)
$post = $title.$post;
$wp_backlink = intval(PConfig::get($b['uid'],'wppost','backlink'));
$wp_backlink = intval(DI::pConfig()->get($b['uid'],'wppost','backlink'));
if($wp_backlink && $b['plink']) {
$post .= EOL . EOL . '<a href="' . $b['plink'] . '">'
. $wp_backlink_text . '</a>' . EOL . EOL;