X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=group_text%2Fgroup_text.php;h=b8a1d21fd0b7e5fcdd1f30c103c379a691676105;hb=0ea84cfb66366edbbe333e9fe3db6a35d07a9c17;hp=cf56dbecd76e302f6287a6b3a32b1d2f8288b8e9;hpb=d836593a3b54a30f961fc17c4e48c622f1e0b8e7;p=friendica-addons.git diff --git a/group_text/group_text.php b/group_text/group_text.php index cf56dbec..b8a1d21f 100644 --- a/group_text/group_text.php +++ b/group_text/group_text.php @@ -5,15 +5,14 @@ * Version: 1.0 * Author: Thomas Willingham */ -use Friendica\Core\Addon; -use Friendica\Core\L10n; +use Friendica\Core\Hook; use Friendica\Core\Logger; -use Friendica\Core\PConfig; +use Friendica\DI; function group_text_install() { - Addon::registerHook('addon_settings', 'addon/group_text/group_text.php', 'group_text_settings'); - Addon::registerHook('addon_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post'); + Hook::register('addon_settings', 'addon/group_text/group_text.php', 'group_text_settings'); + Hook::register('addon_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post'); Logger::log("installed group_text"); } @@ -21,8 +20,8 @@ function group_text_install() { function group_text_uninstall() { - Addon::unregisterHook('addon_settings', 'addon/group_text/group_text.php', 'group_text_settings'); - Addon::unregisterHook('addon_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post'); + Hook::unregister('addon_settings', 'addon/group_text/group_text.php', 'group_text_settings'); + Hook::unregister('addon_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post'); Logger::log("removed group_text"); @@ -42,9 +41,9 @@ function group_text_uninstall() { function group_text_settings_post($a,$post) { if(! local_user() || empty($_POST['group_text-submit'])) return; - PConfig::set(local_user(),'system','groupedit_image_limit',intval($_POST['group_text'])); + DI::pConfig()->set(local_user(),'system','groupedit_image_limit',intval($_POST['group_text'])); - info(L10n::t('Group Text settings updated.') . EOL); + info(DI::l10n()->t('Group Text settings updated.') . EOL); } @@ -64,24 +63,24 @@ function group_text_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(),'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 */ $s .= '
'; - $s .= '

' . L10n::t('Group Text') . '

'; + $s .= '

' . DI::l10n()->t('Group Text') . '

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