X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=randplace%2Frandplace.php;h=886d79d125a58f240d63404ddcee5521367a3daf;hb=65e4726718a10e1d15782d299b348add76377751;hp=ffc3237c3d007f129d907e0256df9a423fe7d079;hpb=36120615dd049c94b9db7858aae77d8ec9d28e84;p=friendica-addons.git diff --git a/randplace/randplace.php b/randplace/randplace.php index ffc3237c..886d79d1 100644 --- a/randplace/randplace.php +++ b/randplace/randplace.php @@ -19,9 +19,8 @@ * */ use Friendica\Core\Hook; -use Friendica\Core\L10n; use Friendica\Core\Logger; -use Friendica\Core\PConfig; +use Friendica\DI; function randplace_install() { @@ -93,7 +92,7 @@ function randplace_post_hook($a, &$item) { /* Retrieve our personal config setting */ - $active = PConfig::get(local_user(), 'randplace', 'enable'); + $active = DI::pConfig()->get(local_user(), 'randplace', 'enable'); if(! $active) return; @@ -138,7 +137,7 @@ function randplace_settings_post($a,$post) { if(! local_user()) return; if($_POST['randplace-submit']) - PConfig::set(local_user(),'randplace','enable',intval($_POST['randplace'])); + DI::pConfig()->set(local_user(),'randplace','enable',intval($_POST['randplace'])); } @@ -158,25 +157,25 @@ function randplace_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - $a->page['htmlhead'] .= '' . "\r\n"; + DI::page()['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variable */ - $enabled = PConfig::get(local_user(),'randplace','enable'); + $enabled = DI::pConfig()->get(local_user(),'randplace','enable'); $checked = (($enabled) ? ' checked="checked" ' : ''); /* Add some HTML to the existing form */ $s .= '
'; - $s .= '

' . L10n::t('Randplace Settings') . '

'; + $s .= '

' . DI::l10n()->t('Randplace Settings') . '

'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
'; /* provide a submit button */ - $s .= '
'; + $s .= '
'; }