X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=numfriends%2Fnumfriends.php;h=f12badeb40a5cd4f4811256c8c494c8b5343734a;hb=940d4658541eef8b5f92bcb0b8b1ec1e73c1cf7b;hp=5fa40e504ba00ae723030e65b4b72d45a7348f5b;hpb=8504f2e9997e83c19d76a01a4fdbafd480b0926d;p=friendica-addons.git diff --git a/numfriends/numfriends.php b/numfriends/numfriends.php index 5fa40e50..f12badeb 100644 --- a/numfriends/numfriends.php +++ b/numfriends/numfriends.php @@ -6,9 +6,7 @@ * Author: Mike Macgirvin */ use Friendica\Core\Hook; -use Friendica\Core\L10n; use Friendica\Core\Logger; -use Friendica\Core\PConfig; use Friendica\DI; function numfriends_install() { @@ -19,16 +17,6 @@ function numfriends_install() { Logger::log("installed numfriends"); } - -function numfriends_uninstall() { - - Hook::unregister('addon_settings', 'addon/numfriends/numfriends.php', 'numfriends_settings'); - Hook::unregister('addon_settings_post', 'addon/numfriends/numfriends.php', 'numfriends_settings_post'); - - - Logger::log("removed numfriends"); -} - /** * * Callback from the settings post function. @@ -41,8 +29,7 @@ function numfriends_settings_post($a,$post) { if(! local_user() || empty($_POST['numfriends-submit'])) return; - PConfig::set(local_user(),'system','display_friend_count',intval($_POST['numfriends'])); - info( L10n::t('Numfriends settings updated.') . EOL); + DI::pConfig()->set(local_user(),'system','display_friend_count',intval($_POST['numfriends'])); } @@ -64,18 +51,18 @@ 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 */ $s .= '
'; - $s .= '

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

'; + $s .= '

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

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