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

pull/946/head
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

@ -46,7 +46,7 @@ function blockem_addon_settings (App $a, &$s)
/* Add our stylesheet to the page so we can make our settings look nice */
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/blockem/blockem.css' . '" media="all" />' . "\r\n";
$words = PConfig::get(local_user(), 'blockem', 'words');
$words = DI::pConfig()->get(local_user(), 'blockem', 'words');
if (!$words) {
$words = '';
@ -86,7 +86,7 @@ function blockem_addon_settings_post(App $a, array &$b)
function blockem_enotify_store(App $a, array &$b)
{
$words = PConfig::get($b['uid'], 'blockem', 'words');
$words = DI::pConfig()->get($b['uid'], 'blockem', 'words');
if ($words) {
$arr = explode(',', $words);
@ -123,7 +123,7 @@ function blockem_prepare_body_content_filter(App $a, array &$hook_data)
$profiles_string = null;
if (local_user()) {
$profiles_string = PConfig::get(local_user(), 'blockem', 'words');
$profiles_string = DI::pConfig()->get(local_user(), 'blockem', 'words');
}
if ($profiles_string) {
@ -159,7 +159,7 @@ function blockem_conversation_start(App $a, array &$b)
return;
}
$words = PConfig::get(local_user(), 'blockem', 'words');
$words = DI::pConfig()->get(local_user(), 'blockem', 'words');
if ($words) {
$a->data['blockem'] = explode(',', $words);
@ -217,7 +217,7 @@ function blockem_init(App $a)
return;
}
$words = PConfig::get(local_user(), 'blockem', 'words');
$words = DI::pConfig()->get(local_user(), 'blockem', 'words');
if (array_key_exists('block', $_GET) && $_GET['block']) {
if (strlen($words)) {

View File

@ -48,13 +48,13 @@ function blogger_jot_nets(App $a, array &$jotnets_fields)
return;
}
if (PConfig::get(local_user(), 'blogger', 'post')) {
if (DI::pConfig()->get(local_user(), 'blogger', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'blogger_enable',
L10n::t('Post to blogger'),
PConfig::get(local_user(), 'blogger', 'post_by_default')
DI::pConfig()->get(local_user(), 'blogger', 'post_by_default')
]
];
}
@ -73,17 +73,17 @@ function blogger_settings(App $a, &$s)
/* Get the current state of our config variables */
$enabled = PConfig::get(local_user(), 'blogger', 'post');
$enabled = DI::pConfig()->get(local_user(), 'blogger', 'post');
$checked = (($enabled) ? ' checked="checked" ' : '');
$css = (($enabled) ? '' : '-disabled');
$def_enabled = PConfig::get(local_user(), 'blogger', 'post_by_default');
$def_enabled = DI::pConfig()->get(local_user(), 'blogger', 'post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
$bl_username = PConfig::get(local_user(), 'blogger', 'bl_username');
$bl_password = PConfig::get(local_user(), 'blogger', 'bl_password');
$bl_blog = PConfig::get(local_user(), 'blogger', 'bl_blog');
$bl_username = DI::pConfig()->get(local_user(), 'blogger', 'bl_username');
$bl_password = DI::pConfig()->get(local_user(), 'blogger', 'bl_password');
$bl_blog = DI::pConfig()->get(local_user(), 'blogger', 'bl_blog');
/* Add some HTML to the existing form */
$s .= '<span id="settings_blogger_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_blogger_expanded\'); openClose(\'settings_blogger_inflated\');">';
@ -166,11 +166,11 @@ function blogger_post_local(App $a, array &$b)
return;
}
$bl_post = intval(PConfig::get(local_user(), 'blogger', 'post'));
$bl_post = intval(DI::pConfig()->get(local_user(), 'blogger', 'post'));
$bl_enable = (($bl_post && !empty($_REQUEST['blogger_enable'])) ? intval($_REQUEST['blogger_enable']) : 0);
if ($b['api_source'] && intval(PConfig::get(local_user(), 'blogger', 'post_by_default'))) {
if ($b['api_source'] && intval(DI::pConfig()->get(local_user(), 'blogger', 'post_by_default'))) {
$bl_enable = 1;
}
@ -199,9 +199,9 @@ function blogger_send(App $a, array &$b)
return;
}
$bl_username = XML::escape(PConfig::get($b['uid'], 'blogger', 'bl_username'));
$bl_password = XML::escape(PConfig::get($b['uid'], 'blogger', 'bl_password'));
$bl_blog = PConfig::get($b['uid'], 'blogger', 'bl_blog');
$bl_username = XML::escape(DI::pConfig()->get($b['uid'], 'blogger', 'bl_username'));
$bl_password = XML::escape(DI::pConfig()->get($b['uid'], 'blogger', 'bl_password'));
$bl_blog = DI::pConfig()->get($b['uid'], 'blogger', 'bl_blog');
if ($bl_username && $bl_password && $bl_blog) {
$title = '<title>' . (($b['title']) ? $b['title'] : L10n::t('Post from Friendica')) . '</title>';

View File

@ -133,13 +133,13 @@ function buffer_jot_nets(App $a, array &$jotnets_fields)
return;
}
if (PConfig::get(local_user(), 'buffer', 'post')) {
if (DI::pConfig()->get(local_user(), 'buffer', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'buffer_enable',
L10n::t('Post to Buffer'),
PConfig::get(local_user(), 'buffer', 'post_by_default')
DI::pConfig()->get(local_user(), 'buffer', 'post_by_default')
]
];
}
@ -157,11 +157,11 @@ function buffer_settings(App $a, &$s)
/* Get the current state of our config variables */
$enabled = PConfig::get(local_user(),'buffer','post');
$enabled = DI::pConfig()->get(local_user(),'buffer','post');
$checked = (($enabled) ? ' checked="checked" ' : '');
$css = (($enabled) ? '' : '-disabled');
$def_enabled = PConfig::get(local_user(),'buffer','post_by_default');
$def_enabled = DI::pConfig()->get(local_user(),'buffer','post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
/* Add some HTML to the existing form */
@ -176,7 +176,7 @@ function buffer_settings(App $a, &$s)
$client_id = Config::get("buffer", "client_id");
$client_secret = Config::get("buffer", "client_secret");
$access_token = PConfig::get(local_user(), "buffer", "access_token");
$access_token = DI::pConfig()->get(local_user(), "buffer", "access_token");
$s .= '<div id="buffer-password-wrapper">';
@ -252,11 +252,11 @@ function buffer_post_local(App $a, array &$b)
return;
}
$buffer_post = intval(PConfig::get(local_user(),'buffer','post'));
$buffer_post = intval(DI::pConfig()->get(local_user(),'buffer','post'));
$buffer_enable = (($buffer_post && !empty($_REQUEST['buffer_enable'])) ? intval($_REQUEST['buffer_enable']) : 0);
if ($b['api_source'] && intval(PConfig::get(local_user(),'buffer','post_by_default'))) {
if ($b['api_source'] && intval(DI::pConfig()->get(local_user(),'buffer','post_by_default'))) {
$buffer_enable = 1;
}
@ -313,7 +313,7 @@ function buffer_send(App $a, array &$b)
$client_id = Config::get("buffer", "client_id");
$client_secret = Config::get("buffer", "client_secret");
$access_token = PConfig::get($b['uid'], "buffer","access_token");
$access_token = DI::pConfig()->get($b['uid'], "buffer","access_token");
$callback_url = "";
if ($access_token) {

View File

@ -63,7 +63,7 @@ function catavatar_addon_settings(App $a, &$s)
'$usecat' => L10n::t('Use Cat as Avatar'),
'$morecat' => L10n::t('More Random Cat!'),
'$emailcat' => L10n::t('Reset to email Cat'),
'$seed' => PConfig::get(local_user(), 'catavatar', 'seed', false),
'$seed' => DI::pConfig()->get(local_user(), 'catavatar', 'seed', false),
'$header' => L10n::t('Cat Avatar Settings'),
]);
}
@ -82,7 +82,7 @@ function catavatar_addon_settings_post(App $a, &$s)
'account_expired' => false, 'account_removed' => false];
$user = DBA::selectFirst('user', ['email'], $condition);
$seed = PConfig::get(local_user(), 'catavatar', 'seed', md5(trim(strtolower($user['email']))));
$seed = DI::pConfig()->get(local_user(), 'catavatar', 'seed', md5(trim(strtolower($user['email']))));
if (!empty($_POST['catavatar-usecat'])) {
$url = DI::baseUrl()->get() . '/catavatar/' . local_user() . '?ts=' . time();
@ -182,7 +182,7 @@ function catavatar_content(App $a)
throw new NotFoundException();
}
$seed = PConfig::get($uid, "catavatar", "seed", md5(trim(strtolower($user['email']))));
$seed = DI::pConfig()->get($uid, "catavatar", "seed", md5(trim(strtolower($user['email']))));
// ...Or start generation
ob_start();

View File

@ -43,7 +43,7 @@ function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cacheti
$now = new DateTime();
if (!is_null($cached)) {
$cdate = PConfig::get(local_user(), 'curweather', 'last');
$cdate = DI::pConfig()->get(local_user(), 'curweather', 'last');
$cached = unserialize($cached);
if ($cdate + $cachetime > $now->getTimestamp()) {
@ -100,7 +100,7 @@ function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cacheti
function curweather_network_mod_init(App $a, &$b)
{
if (!intval(PConfig::get(local_user(), 'curweather', 'curweather_enable'))) {
if (!intval(DI::pConfig()->get(local_user(), 'curweather', 'curweather_enable'))) {
return;
}
@ -115,11 +115,11 @@ function curweather_network_mod_init(App $a, &$b)
// those parameters will be used to get: cloud status, temperature, preassure
// and relative humidity for display, also the relevent area of the map is
// linked from lat/log of the reply of OWMp
$rpt = PConfig::get(local_user(), 'curweather', 'curweather_loc');
$rpt = DI::pConfig()->get(local_user(), 'curweather', 'curweather_loc');
// Set the language to the browsers language or default and use metric units
$lang = Session::get('language', Config::get('system', 'language'));
$units = PConfig::get( local_user(), 'curweather', 'curweather_units');
$units = DI::pConfig()->get( local_user(), 'curweather', 'curweather_units');
$appid = Config::get('curweather', 'appid');
$cachetime = intval(Config::get('curweather', 'cachetime'));
@ -184,8 +184,8 @@ function curweather_addon_settings(App $a, &$s)
}
/* Get the current state of our config variable */
$curweather_loc = PConfig::get(local_user(), 'curweather', 'curweather_loc');
$curweather_units = PConfig::get(local_user(), 'curweather', 'curweather_units');
$curweather_loc = DI::pConfig()->get(local_user(), 'curweather', 'curweather_loc');
$curweather_units = DI::pConfig()->get(local_user(), 'curweather', 'curweather_units');
$appid = Config::get('curweather', 'appid');
if ($appid == "") {
@ -194,7 +194,7 @@ function curweather_addon_settings(App $a, &$s)
$noappidtext = '';
}
$enable = intval(PConfig::get(local_user(), 'curweather', 'curweather_enable'));
$enable = intval(DI::pConfig()->get(local_user(), 'curweather', 'curweather_enable'));
$enable_checked = (($enable) ? ' checked="checked" ' : '');
// load template and replace the macros

View File

@ -46,13 +46,13 @@ function diaspora_jot_nets(App $a, array &$jotnets_fields)
return;
}
if (PConfig::get(local_user(), 'diaspora', 'post')) {
if (DI::pConfig()->get(local_user(), 'diaspora', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'diaspora_enable',
L10n::t('Post to Diaspora'),
PConfig::get(local_user(), 'diaspora', 'post_by_default')
DI::pConfig()->get(local_user(), 'diaspora', 'post_by_default')
]
];
}
@ -70,17 +70,17 @@ function diaspora_settings(App $a, &$s)
/* Get the current state of our config variables */
$enabled = PConfig::get(local_user(),'diaspora','post');
$enabled = DI::pConfig()->get(local_user(),'diaspora','post');
$checked = (($enabled) ? ' checked="checked" ' : '');
$css = (($enabled) ? '' : '-disabled');
$def_enabled = PConfig::get(local_user(),'diaspora','post_by_default');
$def_enabled = DI::pConfig()->get(local_user(),'diaspora','post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
$handle = PConfig::get(local_user(), 'diaspora', 'handle');
$password = PConfig::get(local_user(), 'diaspora', 'password');
$aspect = PConfig::get(local_user(),'diaspora','aspect');
$handle = DI::pConfig()->get(local_user(), 'diaspora', 'handle');
$password = DI::pConfig()->get(local_user(), 'diaspora', 'password');
$aspect = DI::pConfig()->get(local_user(),'diaspora','aspect');
$status = "";
@ -211,11 +211,11 @@ function diaspora_post_local(App $a, array &$b)
return;
}
$diaspora_post = intval(PConfig::get(local_user(),'diaspora','post'));
$diaspora_post = intval(DI::pConfig()->get(local_user(),'diaspora','post'));
$diaspora_enable = (($diaspora_post && !empty($_REQUEST['diaspora_enable'])) ? intval($_REQUEST['diaspora_enable']) : 0);
if ($b['api_source'] && intval(PConfig::get(local_user(),'diaspora','post_by_default'))) {
if ($b['api_source'] && intval(DI::pConfig()->get(local_user(),'diaspora','post_by_default'))) {
$diaspora_enable = 1;
}
@ -258,9 +258,9 @@ function diaspora_send(App $a, array &$b)
Logger::log('diaspora_send: prepare posting', Logger::DEBUG);
$handle = PConfig::get($b['uid'],'diaspora','handle');
$password = PConfig::get($b['uid'],'diaspora','password');
$aspect = PConfig::get($b['uid'],'diaspora','aspect');
$handle = DI::pConfig()->get($b['uid'],'diaspora','handle');
$password = DI::pConfig()->get($b['uid'],'diaspora','password');
$aspect = DI::pConfig()->get($b['uid'],'diaspora','aspect');
if ($handle && $password) {
Logger::log('diaspora_send: all values seem to be okay', Logger::DEBUG);

View File

@ -15,6 +15,7 @@ use Friendica\Core\PConfig;
use Friendica\Core\Renderer;
use Friendica\Core\Protocol;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Util\XML;
use Friendica\Content\Text\Markdown;
@ -44,7 +45,7 @@ function discourse_settings(App $a, &$s)
return;
}
$enabled = intval(PConfig::get(local_user(), 'discourse', 'enabled'));
$enabled = intval(DI::pConfig()->get(local_user(), 'discourse', 'enabled'));
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/discourse/');
$s .= Renderer::replaceMacros($t, [
@ -69,7 +70,7 @@ function discourse_email_getmessage(App $a, &$message)
return;
}
if (!PConfig::get($message['item']['uid'], 'discourse', 'enabled')) {
if (!DI::pConfig()->get($message['item']['uid'], 'discourse', 'enabled')) {
return;
}

View File

@ -44,13 +44,13 @@ function dwpost_jot_nets(App $a, array &$jotnets_fields)
return;
}
if (PConfig::get(local_user(), 'dwpost', 'post')) {
if (DI::pConfig()->get(local_user(), 'dwpost', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'dwpost_enable',
L10n::t('Post to Dreamwidth'),
PConfig::get(local_user(), 'dwpost', 'post_by_default')
DI::pConfig()->get(local_user(), 'dwpost', 'post_by_default')
]
];
}
@ -67,16 +67,16 @@ function dwpost_settings(App $a, &$s)
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/dwpost/dwpost.css' . '" media="all" />' . "\r\n";
/* Get the current state of our config variables */
$enabled = PConfig::get(local_user(), 'dwpost', 'post');
$enabled = DI::pConfig()->get(local_user(), 'dwpost', 'post');
$checked = (($enabled) ? ' checked="checked" ' : '');
$def_enabled = PConfig::get(local_user(), 'dwpost', 'post_by_default');
$def_enabled = DI::pConfig()->get(local_user(), 'dwpost', 'post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
$dw_username = PConfig::get(local_user(), 'dwpost', 'dw_username');
$dw_password = PConfig::get(local_user(), 'dwpost', 'dw_password');
$dw_username = DI::pConfig()->get(local_user(), 'dwpost', 'dw_username');
$dw_password = DI::pConfig()->get(local_user(), 'dwpost', 'dw_password');
/* Add some HTML to the existing form */
$s .= '<span id="settings_dwpost_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_dwpost_expanded\'); openClose(\'settings_dwpost_inflated\');">';
@ -137,11 +137,11 @@ function dwpost_post_local(App $a, array &$b)
return;
}
$dw_post = intval(PConfig::get(local_user(),'dwpost','post'));
$dw_post = intval(DI::pConfig()->get(local_user(),'dwpost','post'));
$dw_enable = (($dw_post && !empty($_REQUEST['dwpost_enable'])) ? intval($_REQUEST['dwpost_enable']) : 0);
if ($b['api_source'] && intval(PConfig::get(local_user(),'dwpost','post_by_default'))) {
if ($b['api_source'] && intval(DI::pConfig()->get(local_user(),'dwpost','post_by_default'))) {
$dw_enable = 1;
}
@ -185,8 +185,8 @@ function dwpost_send(App $a, array &$b)
$tz = $x[0]['timezone'];
}
$dw_username = PConfig::get($b['uid'],'dwpost','dw_username');
$dw_password = PConfig::get($b['uid'],'dwpost','dw_password');
$dw_username = DI::pConfig()->get($b['uid'],'dwpost','dw_username');
$dw_password = DI::pConfig()->get($b['uid'],'dwpost','dw_password');
$dw_blog = 'http://www.dreamwidth.org/interface/xmlrpc';
if ($dw_username && $dw_password && $dw_blog) {

View File

@ -53,9 +53,9 @@ function fromapp_settings(&$a, &$s)
/* Get the current state of our config variable */
$fromapp = PConfig::get(local_user(), 'fromapp', 'app', '');
$fromapp = DI::pConfig()->get(local_user(), 'fromapp', 'app', '');
$force = intval(PConfig::get(local_user(), 'fromapp', 'force'));
$force = intval(DI::pConfig()->get(local_user(), 'fromapp', 'force'));
$force_enabled = (($force) ? ' checked="checked" ' : '');
@ -94,8 +94,8 @@ function fromapp_post_hook(&$a, &$item)
return;
}
$app = PConfig::get(local_user(), 'fromapp', 'app');
$force = intval(PConfig::get(local_user(), 'fromapp', 'force'));
$app = DI::pConfig()->get(local_user(), 'fromapp', 'app');
$force = intval(DI::pConfig()->get(local_user(), 'fromapp', 'force'));
if (is_null($app) || (! strlen($app))) {
return;

View File

@ -67,7 +67,7 @@ function geonames_post_hook(App $a, array &$item)
/* Retrieve our personal config setting */
$geo_account = Config::get('geonames', 'username');
$active = PConfig::get(local_user(), 'geonames', 'enable');
$active = DI::pConfig()->get(local_user(), 'geonames', 'enable');
if (!$geo_account || !$active) {
return;
@ -140,7 +140,7 @@ function geonames_addon_settings(App $a, &$s)
DI::page()->registerStylesheet($stylesheetPath);
/* Get the current state of our config variable */
$enabled = intval(PConfig::get(local_user(), 'geonames', 'enable'));
$enabled = intval(DI::pConfig()->get(local_user(), 'geonames', 'enable'));
$t = Renderer::getMarkupTemplate('settings.tpl', __DIR__);
$s .= Renderer::replaceMacros($t, [

View File

@ -74,7 +74,7 @@ function gnot_settings(&$a,&$s) {
/* Get the current state of our config variable */
$gnot = intval(PConfig::get(local_user(),'gnot','enable'));
$gnot = intval(DI::pConfig()->get(local_user(),'gnot','enable'));
$gnot_checked = (($gnot) ? ' checked="checked" ' : '' );
@ -92,7 +92,7 @@ function gnot_settings(&$a,&$s) {
function gnot_enotify_mail(&$a,&$b) {
if((! $b['uid']) || (! intval(PConfig::get($b['uid'], 'gnot','enable'))))
if((! $b['uid']) || (! intval(DI::pConfig()->get($b['uid'], 'gnot','enable'))))
return;
if($b['type'] == NOTIFY_COMMENT)
$b['subject'] = L10n::t('[Friendica:Notify] Comment to conversation #%d', $b['parent']);

View File

@ -69,7 +69,7 @@ function group_text_settings(&$a,&$s) {
/* Get the current state of our config variable */
$enabled = PConfig::get(local_user(),'system','groupedit_image_limit');
$enabled = DI::pConfig()->get(local_user(),'system','groupedit_image_limit');
$checked = (($enabled) ? ' checked="checked" ' : '');
/* Add some HTML to the existing form */

View File

@ -46,7 +46,7 @@ function ifttt_settings(App $a, &$s)
return;
}
$key = PConfig::get(local_user(), 'ifttt', 'key');
$key = DI::pConfig()->get(local_user(), 'ifttt', 'key');
if (!$key) {
$key = Strings::getRandomHex(20);
@ -119,7 +119,7 @@ function ifttt_post(App $a)
$key = $_REQUEST['key'];
// Check the key
if ($key != PConfig::get($uid, 'ifttt', 'key')) {
if ($key != DI::pConfig()->get($uid, 'ifttt', 'key')) {
Logger::log('Invalid key for user ' . $uid, Logger::DEBUG);
return;
}

View File

@ -42,13 +42,13 @@ function ijpost_jot_nets(\Friendica\App &$a, array &$jotnets_fields)
return;
}
if (PConfig::get(local_user(), 'ijpost', 'post')) {
if (DI::pConfig()->get(local_user(), 'ijpost', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'ijpost_enable',
L10n::t('Post to Insanejournal'),
PConfig::get(local_user(), 'ijpost', 'post_by_default')
DI::pConfig()->get(local_user(), 'ijpost', 'post_by_default')
]
];
}
@ -66,16 +66,16 @@ function ijpost_settings(&$a, &$s)
/* Get the current state of our config variables */
$enabled = PConfig::get(local_user(), 'ijpost', 'post');
$enabled = DI::pConfig()->get(local_user(), 'ijpost', 'post');
$checked = (($enabled) ? ' checked="checked" ' : '');
$def_enabled = PConfig::get(local_user(), 'ijpost', 'post_by_default');
$def_enabled = DI::pConfig()->get(local_user(), 'ijpost', 'post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
$ij_username = PConfig::get(local_user(), 'ijpost', 'ij_username');
$ij_password = PConfig::get(local_user(), 'ijpost', 'ij_password');
$ij_username = DI::pConfig()->get(local_user(), 'ijpost', 'ij_username');
$ij_password = DI::pConfig()->get(local_user(), 'ijpost', 'ij_password');
/* Add some HTML to the existing form */
$s .= '<span id="settings_ijpost_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_ijpost_expanded\'); openClose(\'settings_ijpost_inflated\');">';
@ -136,11 +136,11 @@ function ijpost_post_local(&$a, &$b)
return;
}
$ij_post = intval(PConfig::get(local_user(), 'ijpost', 'post'));
$ij_post = intval(DI::pConfig()->get(local_user(), 'ijpost', 'post'));
$ij_enable = (($ij_post && !empty($_REQUEST['ijpost_enable'])) ? intval($_REQUEST['ijpost_enable']) : 0);
if ($b['api_source'] && intval(PConfig::get(local_user(), 'ijpost', 'post_by_default'))) {
if ($b['api_source'] && intval(DI::pConfig()->get(local_user(), 'ijpost', 'post_by_default'))) {
$ij_enable = 1;
}
@ -183,8 +183,8 @@ function ijpost_send(&$a, &$b)
$tz = $x[0]['timezone'];
}
$ij_username = PConfig::get($b['uid'], 'ijpost', 'ij_username');
$ij_password = PConfig::get($b['uid'], 'ijpost', 'ij_password');
$ij_username = DI::pConfig()->get($b['uid'], 'ijpost', 'ij_username');
$ij_password = DI::pConfig()->get($b['uid'], 'ijpost', 'ij_password');
$ij_blog = 'http://www.insanejournal.com/interface/xmlrpc';
if ($ij_username && $ij_password && $ij_blog) {

View File

@ -36,8 +36,8 @@ function irc_addon_settings(&$a,&$s) {
// DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->getBaseURL() . '/addon/irc/irc.css' . '" media="all" />' . "\r\n";
/* setting popular channels, auto connect channels */
$sitechats = PConfig::get( local_user(), 'irc','sitechats'); /* popular channels */
$autochans = PConfig::get( local_user(), 'irc','autochans'); /* auto connect chans */
$sitechats = DI::pConfig()->get( local_user(), 'irc','sitechats'); /* popular channels */
$autochans = DI::pConfig()->get( local_user(), 'irc','autochans'); /* auto connect chans */
$t = Renderer::getMarkupTemplate( "settings.tpl", "addon/irc/" );
$s .= Renderer::replaceMacros($t, [
@ -86,7 +86,7 @@ function irc_content(&$a) {
/* set the list of popular channels */
if (local_user()) {
$sitechats = PConfig::get( local_user(), 'irc', 'sitechats');
$sitechats = DI::pConfig()->get( local_user(), 'irc', 'sitechats');
if (!$sitechats)
$sitechats = Config::get('irc', 'sitechats');
} else {
@ -106,7 +106,7 @@ function irc_content(&$a) {
/* setting the channel(s) to auto connect */
if (local_user()) {
$autochans = PConfig::get(local_user(), 'irc', 'autochans');
$autochans = DI::pConfig()->get(local_user(), 'irc', 'autochans');
if (!$autochans)
$autochans = Config::get('irc','autochans');
} else {

View File

@ -237,15 +237,15 @@ function jappixmini_init()
}
// do not return an address if user deactivated addon
$activated = PConfig::get($uid, 'jappixmini', 'activate');
$activated = DI::pConfig()->get($uid, 'jappixmini', 'activate');
if (!$activated) {
exit();
}
// return the requested Jabber address
try {
$username = PConfig::get($uid, 'jappixmini', 'username');
$server = PConfig::get($uid, 'jappixmini', 'server');
$username = DI::pConfig()->get($uid, 'jappixmini', 'username');
$server = DI::pConfig()->get($uid, 'jappixmini', 'server');
$address = "$username@$server";
$encrypted_address = "";
@ -269,9 +269,9 @@ function jappixmini_init()
function jappixmini_settings(App $a, &$s)
{
// addon settings for a user
$activate = PConfig::get(local_user(), 'jappixmini', 'activate');
$activate = DI::pConfig()->get(local_user(), 'jappixmini', 'activate');
$activate = intval($activate) ? ' checked="checked"' : '';
$dontinsertchat = PConfig::get(local_user(), 'jappixmini', 'dontinsertchat');
$dontinsertchat = DI::pConfig()->get(local_user(), 'jappixmini', 'dontinsertchat');
$insertchat = !(intval($dontinsertchat) ? ' checked="checked"' : '');
$defaultbosh = Config::get("jappixmini", "bosh_address");
@ -280,18 +280,18 @@ function jappixmini_settings(App $a, &$s)
PConfig::set(local_user(), 'jappixmini', 'bosh', $defaultbosh);
}
$username = PConfig::get(local_user(), 'jappixmini', 'username');
$username = DI::pConfig()->get(local_user(), 'jappixmini', 'username');
$username = htmlentities($username);
$server = PConfig::get(local_user(), 'jappixmini', 'server');
$server = DI::pConfig()->get(local_user(), 'jappixmini', 'server');
$server = htmlentities($server);
$bosh = PConfig::get(local_user(), 'jappixmini', 'bosh');
$bosh = DI::pConfig()->get(local_user(), 'jappixmini', 'bosh');
$bosh = htmlentities($bosh);
$password = PConfig::get(local_user(), 'jappixmini', 'password');
$autosubscribe = PConfig::get(local_user(), 'jappixmini', 'autosubscribe');
$password = DI::pConfig()->get(local_user(), 'jappixmini', 'password');
$autosubscribe = DI::pConfig()->get(local_user(), 'jappixmini', 'autosubscribe');
$autosubscribe = intval($autosubscribe) ? ' checked="checked"' : '';
$autoapprove = PConfig::get(local_user(), 'jappixmini', 'autoapprove');
$autoapprove = DI::pConfig()->get(local_user(), 'jappixmini', 'autoapprove');
$autoapprove = intval($autoapprove) ? ' checked="checked"' : '';
$encrypt = intval(PConfig::get(local_user(), 'jappixmini', 'encrypt'));
$encrypt = intval(DI::pConfig()->get(local_user(), 'jappixmini', 'encrypt'));
$encrypt_checked = $encrypt ? ' checked="checked"' : '';
$encrypt_disabled = $encrypt ? '' : ' disabled="disabled"';
@ -445,13 +445,13 @@ function jappixmini_settings_post(App $a, &$b)
$purge = intval($b['jappixmini-purge']);
$username = trim($b['jappixmini-username']);
$old_username = PConfig::get($uid, 'jappixmini', 'username');
$old_username = DI::pConfig()->get($uid, 'jappixmini', 'username');
if ($username != $old_username) {
$purge = 1;
}
$server = trim($b['jappixmini-server']);
$old_server = PConfig::get($uid, 'jappixmini', 'server');
$old_server = DI::pConfig()->get($uid, 'jappixmini', 'server');
if ($server != $old_server) {
$purge = 1;
}
@ -485,8 +485,8 @@ function jappixmini_script(App $a)
return;
}
$activate = PConfig::get(local_user(), 'jappixmini', 'activate');
$dontinsertchat = PConfig::get(local_user(), 'jappixmini', 'dontinsertchat');
$activate = DI::pConfig()->get(local_user(), 'jappixmini', 'activate');
$dontinsertchat = DI::pConfig()->get(local_user(), 'jappixmini', 'dontinsertchat');
if (!$activate || $dontinsertchat) {
return;
}
@ -496,20 +496,20 @@ function jappixmini_script(App $a)
DI::page()['htmlhead'] .= '<script type="text/javascript" src="' . DI::baseUrl()->get() . '/addon/jappixmini/lib.js"></script>' . "\r\n";
$username = PConfig::get(local_user(), 'jappixmini', 'username');
$username = DI::pConfig()->get(local_user(), 'jappixmini', 'username');
$username = str_replace("'", "\\'", $username);
$server = PConfig::get(local_user(), 'jappixmini', 'server');
$server = DI::pConfig()->get(local_user(), 'jappixmini', 'server');
$server = str_replace("'", "\\'", $server);
$bosh = PConfig::get(local_user(), 'jappixmini', 'bosh');
$bosh = DI::pConfig()->get(local_user(), 'jappixmini', 'bosh');
$bosh = str_replace("'", "\\'", $bosh);
$encrypt = PConfig::get(local_user(), 'jappixmini', 'encrypt');
$encrypt = DI::pConfig()->get(local_user(), 'jappixmini', 'encrypt');
$encrypt = intval($encrypt);
$password = PConfig::get(local_user(), 'jappixmini', 'password');
$password = DI::pConfig()->get(local_user(), 'jappixmini', 'password');
$password = str_replace("'", "\\'", $password);
$autoapprove = PConfig::get(local_user(), 'jappixmini', 'autoapprove');
$autoapprove = DI::pConfig()->get(local_user(), 'jappixmini', 'autoapprove');
$autoapprove = intval($autoapprove);
$autosubscribe = PConfig::get(local_user(), 'jappixmini', 'autosubscribe');
$autosubscribe = DI::pConfig()->get(local_user(), 'jappixmini', 'autosubscribe');
$autosubscribe = intval($autosubscribe);
// set proxy if necessary
@ -619,7 +619,7 @@ function jappixmini_cron(App $a, $d)
}
// check if jabber address already present
$present = PConfig::get($uid, "jappixmini", "id:" . $dfrn_id);
$present = DI::pConfig()->get($uid, "jappixmini", "id:" . $dfrn_id);
$now = intval(time());
if ($present) {
// $present has format "timestamp:jabber_address"
@ -642,11 +642,11 @@ function jappixmini_cron(App $a, $d)
$base = substr($request, 0, $pos) . "/jappixmini?role=$role";
// construct own address
$username = PConfig::get($uid, 'jappixmini', 'username');
$username = DI::pConfig()->get($uid, 'jappixmini', 'username');
if (!$username) {
continue;
}
$server = PConfig::get($uid, 'jappixmini', 'server');
$server = DI::pConfig()->get($uid, 'jappixmini', 'server');
if (!$server) {
continue;
}

View File

@ -85,7 +85,7 @@ function krynn_post_hook($a, &$item) {
/* Retrieve our personal config setting */
$active = PConfig::get(local_user(), 'krynn', 'enable');
$active = DI::pConfig()->get(local_user(), 'krynn', 'enable');
if(! $active)
return;
@ -147,7 +147,7 @@ function krynn_settings(&$a,&$s) {
/* Get the current state of our config variable */
$enabled = PConfig::get(local_user(),'krynn','enable');
$enabled = DI::pConfig()->get(local_user(),'krynn','enable');
$checked = (($enabled) ? ' checked="checked" ' : '');

View File

@ -47,10 +47,10 @@ function langfilter_addon_settings(App $a, &$s)
return;
}
$enable_checked = (intval(PConfig::get(local_user(), 'langfilter', 'disable')) ? '' : ' checked="checked" ');
$languages = PConfig::get(local_user(), 'langfilter', 'languages');
$minconfidence = PConfig::get(local_user(), 'langfilter', 'minconfidence') * 100;
$minlength = PConfig::get(local_user(), 'langfilter', 'minlength');
$enable_checked = (intval(DI::pConfig()->get(local_user(), 'langfilter', 'disable')) ? '' : ' checked="checked" ');
$languages = DI::pConfig()->get(local_user(), 'langfilter', 'languages');
$minconfidence = DI::pConfig()->get(local_user(), 'langfilter', 'minconfidence') * 100;
$minlength = DI::pConfig()->get(local_user(), 'langfilter', 'minlength');
$t = Renderer::getMarkupTemplate("settings.tpl", "addon/langfilter/");
$s .= Renderer::replaceMacros($t, [
@ -129,14 +129,14 @@ function langfilter_prepare_body_content_filter(App $a, &$hook_data)
}
// Don't filter if language filter is disabled
if (PConfig::get($logged_user, 'langfilter', 'disable')) {
if (DI::pConfig()->get($logged_user, 'langfilter', 'disable')) {
return;
}
$naked_body = BBCode::toPlaintext($hook_data['item']['body'], false);
// Don't filter if body lenght is below minimum
$minlen = PConfig::get(local_user(), 'langfilter', 'minlength', 32);
$minlen = DI::pConfig()->get(local_user(), 'langfilter', 'minlength', 32);
if (!$minlen) {
$minlen = 32;
}
@ -145,8 +145,8 @@ function langfilter_prepare_body_content_filter(App $a, &$hook_data)
return;
}
$read_languages_string = PConfig::get(local_user(), 'langfilter', 'languages');
$minconfidence = PConfig::get(local_user(), 'langfilter', 'minconfidence');
$read_languages_string = DI::pConfig()->get(local_user(), 'langfilter', 'languages');
$minconfidence = DI::pConfig()->get(local_user(), 'langfilter', 'minconfidence');
// Don't filter if no spoken languages are configured
if (!$read_languages_string) {

View File

@ -42,13 +42,13 @@ function libertree_jot_nets(App &$a, array &$jotnets_fields)
return;
}
if (PConfig::get(local_user(), 'libertree', 'post')) {
if (DI::pConfig()->get(local_user(), 'libertree', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'libertree_enable',
L10n::t('Post to libertree'),
PConfig::get(local_user(), 'libertree', 'post_by_default')
DI::pConfig()->get(local_user(), 'libertree', 'post_by_default')
]
];
}
@ -66,16 +66,16 @@ function libertree_settings(&$a,&$s) {
/* Get the current state of our config variables */
$enabled = PConfig::get(local_user(),'libertree','post');
$enabled = DI::pConfig()->get(local_user(),'libertree','post');
$checked = (($enabled) ? ' checked="checked" ' : '');
$css = (($enabled) ? '' : '-disabled');
$def_enabled = PConfig::get(local_user(),'libertree','post_by_default');
$def_enabled = DI::pConfig()->get(local_user(),'libertree','post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
$ltree_api_token = PConfig::get(local_user(), 'libertree', 'libertree_api_token');
$ltree_url = PConfig::get(local_user(), 'libertree', 'libertree_url');
$ltree_api_token = DI::pConfig()->get(local_user(), 'libertree', 'libertree_api_token');
$ltree_url = DI::pConfig()->get(local_user(), 'libertree', 'libertree_url');
/* Add some HTML to the existing form */
@ -159,11 +159,11 @@ function libertree_post_local(&$a,&$b) {
return;
}
$ltree_post = intval(PConfig::get(local_user(),'libertree','post'));
$ltree_post = intval(DI::pConfig()->get(local_user(),'libertree','post'));
$ltree_enable = (($ltree_post && !empty($_REQUEST['libertree_enable'])) ? intval($_REQUEST['libertree_enable']) : 0);
if ($b['api_source'] && intval(PConfig::get(local_user(),'libertree','post_by_default'))) {
if ($b['api_source'] && intval(DI::pConfig()->get(local_user(),'libertree','post_by_default'))) {
$ltree_enable = 1;
}
@ -204,8 +204,8 @@ function libertree_send(&$a,&$b) {
return;
}
$ltree_api_token = PConfig::get($b['uid'],'libertree','libertree_api_token');
$ltree_url = PConfig::get($b['uid'],'libertree','libertree_url');
$ltree_api_token = DI::pConfig()->get($b['uid'],'libertree','libertree_api_token');
$ltree_url = DI::pConfig()->get($b['uid'],'libertree','libertree_url');
$ltree_blog = "$ltree_url/api/v1/posts/create/?token=$ltree_api_token";
$ltree_source = DI::baseUrl()->getHostname();

View File

@ -42,13 +42,13 @@ function ljpost_jot_nets(\Friendica\App &$a, array &$jotnets_fields)
return;
}
if (PConfig::get(local_user(),'ljpost','post')) {
if (DI::pConfig()->get(local_user(),'ljpost','post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'ljpost_enable',
L10n::t('Post to LiveJournal'),
PConfig::get(local_user(),'ljpost','post_by_default')
DI::pConfig()->get(local_user(),'ljpost','post_by_default')
]
];
}
@ -66,16 +66,16 @@ function ljpost_settings(&$a,&$s) {
/* Get the current state of our config variables */
$enabled = PConfig::get(local_user(),'ljpost','post');
$enabled = DI::pConfig()->get(local_user(),'ljpost','post');
$checked = (($enabled) ? ' checked="checked" ' : '');
$def_enabled = PConfig::get(local_user(),'ljpost','post_by_default');
$def_enabled = DI::pConfig()->get(local_user(),'ljpost','post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
$lj_username = PConfig::get(local_user(), 'ljpost', 'lj_username');
$lj_password = PConfig::get(local_user(), 'ljpost', 'lj_password');
$lj_username = DI::pConfig()->get(local_user(), 'ljpost', 'lj_username');
$lj_password = DI::pConfig()->get(local_user(), 'ljpost', 'lj_password');
/* Add some HTML to the existing form */
@ -135,11 +135,11 @@ function ljpost_post_local(&$a,&$b) {
if($b['private'] || $b['parent'])
return;
$lj_post = intval(PConfig::get(local_user(),'ljpost','post'));
$lj_post = intval(DI::pConfig()->get(local_user(),'ljpost','post'));
$lj_enable = (($lj_post && !empty($_REQUEST['ljpost_enable'])) ? intval($_REQUEST['ljpost_enable']) : 0);
if($b['api_source'] && intval(PConfig::get(local_user(),'ljpost','post_by_default')))
if($b['api_source'] && intval(DI::pConfig()->get(local_user(),'ljpost','post_by_default')))
$lj_enable = 1;
if(! $lj_enable)
@ -176,13 +176,13 @@ function ljpost_send(&$a,&$b) {
if($x && strlen($x[0]['timezone']))
$tz = $x[0]['timezone'];
$lj_username = XML::escape(PConfig::get($b['uid'],'ljpost','lj_username'));
$lj_password = XML::escape(PConfig::get($b['uid'],'ljpost','lj_password'));
$lj_journal = XML::escape(PConfig::get($b['uid'],'ljpost','lj_journal'));
$lj_username = XML::escape(DI::pConfig()->get($b['uid'],'ljpost','lj_username'));
$lj_password = XML::escape(DI::pConfig()->get($b['uid'],'ljpost','lj_password'));
$lj_journal = XML::escape(DI::pConfig()->get($b['uid'],'ljpost','lj_journal'));
// if(! $lj_journal)
// $lj_journal = $lj_username;
$lj_blog = XML::escape(PConfig::get($b['uid'],'ljpost','lj_blog'));
$lj_blog = XML::escape(DI::pConfig()->get($b['uid'],'ljpost','lj_blog'));
if(! strlen($lj_blog))
$lj_blog = XML::escape('http://www.livejournal.com/interface/xmlrpc');

View File

@ -103,7 +103,7 @@ function mailstream_generate_id($a, $uri) {
}
function mailstream_post_hook(&$a, &$item) {
if (!PConfig::get($item['uid'], 'mailstream', 'enabled')) {
if (!DI::pConfig()->get($item['uid'], 'mailstream', 'enabled')) {
Logger::debug('mailstream: not enabled for item ' . $item['id']);
return;
}
@ -123,7 +123,7 @@ function mailstream_post_hook(&$a, &$item) {
Logger::debug('mailstream: no plink for item ' . $item['id']);
return;
}
if (PConfig::get($item['uid'], 'mailstream', 'nolikes')) {
if (DI::pConfig()->get($item['uid'], 'mailstream', 'nolikes')) {
if ($item['verb'] == Activity::LIKE) {
Logger::debug('mailstream: like item ' . $item['id']);
return;
@ -159,7 +159,7 @@ function mailstream_get_user($uid) {
}
function mailstream_do_images($a, &$item, &$attachments) {
if (!PConfig::get($item['uid'], 'mailstream', 'attachimg')) {
if (!DI::pConfig()->get($item['uid'], 'mailstream', 'attachimg')) {
return;
}
$attachments = [];
@ -282,7 +282,7 @@ function mailstream_send(\Friendica\App $a, $message_id, $item, $user) {
if ($frommail == "") {
$frommail = 'friendica@localhost.local';
}
$address = PConfig::get($item['uid'], 'mailstream', 'address');
$address = DI::pConfig()->get($item['uid'], 'mailstream', 'address');
if (!$address) {
$address = $user['email'];
}
@ -369,10 +369,10 @@ function mailstream_cron($a, $b) {
}
function mailstream_addon_settings(&$a,&$s) {
$enabled = PConfig::get(local_user(), 'mailstream', 'enabled');
$address = PConfig::get(local_user(), 'mailstream', 'address');
$nolikes = PConfig::get(local_user(), 'mailstream', 'nolikes');
$attachimg= PConfig::get(local_user(), 'mailstream', 'attachimg');
$enabled = DI::pConfig()->get(local_user(), 'mailstream', 'enabled');
$address = DI::pConfig()->get(local_user(), 'mailstream', 'address');
$nolikes = DI::pConfig()->get(local_user(), 'mailstream', 'nolikes');
$attachimg= DI::pConfig()->get(local_user(), 'mailstream', 'attachimg');
$template = Renderer::getMarkupTemplate('settings.tpl', 'addon/mailstream/');
$s .= Renderer::replaceMacros($template, [
'$enabled' => [

View File

@ -12,6 +12,7 @@ use Friendica\Content\Text\Markdown;
use Friendica\Core\Renderer;
use Friendica\Core\PConfig;
use Friendica\Core\L10n;
use Friendica\DI;
function markdown_install() {
Hook::register('post_local_start', __FILE__, 'markdown_post_local_start');
@ -25,7 +26,7 @@ function markdown_addon_settings(App $a, &$s)
return;
}
$enabled = intval(PConfig::get(local_user(), 'markdown', 'enabled'));
$enabled = intval(DI::pConfig()->get(local_user(), 'markdown', 'enabled'));
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/markdown/');
$s .= Renderer::replaceMacros($t, [
@ -45,7 +46,7 @@ function markdown_addon_settings_post(App $a, &$b)
}
function markdown_post_local_start(App $a, &$request) {
if (empty($request['body']) || !PConfig::get(local_user(), 'markdown', 'enabled')) {
if (empty($request['body']) || !DI::pConfig()->get(local_user(), 'markdown', 'enabled')) {
return;
}

View File

@ -49,7 +49,7 @@ function mathjax_settings(App $a, &$s)
return;
}
$use = PConfig::get(local_user(), 'mathjax', 'use', false);
$use = DI::pConfig()->get(local_user(), 'mathjax', 'use', false);
$tpl = Renderer::getMarkupTemplate('settings.tpl', __DIR__);
$s .= Renderer::replaceMacros($tpl, [
@ -64,7 +64,7 @@ function mathjax_footer(App $a, &$b)
{
// if the visitor of the page is not a local_user, use MathJax
// otherwise check the users settings.
if (!local_user() || PConfig::get(local_user(), 'mathjax', 'use', false)) {
if (!local_user() || DI::pConfig()->get(local_user(), 'mathjax', 'use', false)) {
DI::page()->registerFooterScript(__DIR__ . '/asset/MathJax.js?config=TeX-MML-AM_CHTML');
DI::page()->registerFooterScript(__DIR__ . '/mathjax.js');
}

View File

@ -46,7 +46,7 @@ function notimeline_settings(&$a, &$s)
/* Get the current state of our config variable */
$notimeline = PConfig::get(local_user(), 'system', 'no_wall_archive_widget', false);
$notimeline = DI::pConfig()->get(local_user(), 'system', 'no_wall_archive_widget', false);
$notimeline_checked = (($notimeline) ? ' checked="checked" ' : '');

View File

@ -68,8 +68,8 @@ function nsfw_addon_settings(&$a, &$s)
DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl()->get() . '/addon/nsfw/nsfw.css' . '" media="all" />' . "\r\n";
$enable_checked = (intval(PConfig::get(local_user(), 'nsfw', 'disable')) ? '' : ' checked="checked" ');
$words = PConfig::get(local_user(), 'nsfw', 'words');
$enable_checked = (intval(DI::pConfig()->get(local_user(), 'nsfw', 'disable')) ? '' : ' checked="checked" ');
$words = DI::pConfig()->get(local_user(), 'nsfw', 'words');
if (!$words) {
$words = 'nsfw,';
}
@ -114,12 +114,12 @@ function nsfw_addon_settings_post(&$a, &$b)
function nsfw_prepare_body_content_filter(\Friendica\App $a, &$hook_data)
{
$words = null;
if (PConfig::get(local_user(), 'nsfw', 'disable')) {
if (DI::pConfig()->get(local_user(), 'nsfw', 'disable')) {
return;
}
if (local_user()) {
$words = PConfig::get(local_user(), 'nsfw', 'words');
$words = DI::pConfig()->get(local_user(), 'nsfw', 'words');
}
if ($words) {

View File

@ -64,7 +64,7 @@ function numfriends_settings(&$a, &$s)
/* Get the current state of our config variable */
$numfriends = PConfig::get(local_user(), 'system', 'display_friend_count', 24);
$numfriends = DI::pConfig()->get(local_user(), 'system', 'display_friend_count', 24);
/* Add some HTML to the existing form */