X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=gnot%2Fgnot.php;h=686b1f65d3c204aad38a5cf6079043eb5ab513b2;hb=c95713b19c35eff74052bf248bfc1025d5d9161b;hp=7adf045fde3c0ae57b1f12a89f0cca6f4e46eb95;hpb=36120615dd049c94b9db7858aae77d8ec9d28e84;p=friendica-addons.git diff --git a/gnot/gnot.php b/gnot/gnot.php index 7adf045f..686b1f65 100644 --- a/gnot/gnot.php +++ b/gnot/gnot.php @@ -8,9 +8,9 @@ * */ use Friendica\Core\Hook; -use Friendica\Core\L10n; use Friendica\Core\Logger; -use Friendica\Core\PConfig; +use Friendica\Core\Renderer; +use Friendica\DI; function gnot_install() { @@ -47,8 +47,8 @@ function gnot_settings_post($a,$post) { if(! local_user() || empty($_POST['gnot-submit'])) return; - PConfig::set(local_user(),'gnot','enable',intval($_POST['gnot'])); - info(L10n::t('Gnot settings updated.') . EOL); + DI::pConfig()->set(local_user(),'gnot','enable',intval($_POST['gnot'])); + info(DI::l10n()->t('Gnot settings updated.') . EOL); } @@ -68,34 +68,30 @@ function gnot_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 */ - $gnot = intval(PConfig::get(local_user(),'gnot','enable')); + $gnot = intval(DI::pConfig()->get(local_user(),'gnot','enable')); $gnot_checked = (($gnot) ? ' checked="checked" ' : '' ); + $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/gnot/'); /* Add some HTML to the existing form */ - $s .= '