X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=group_text%2Fgroup_text.php;h=6d14b6f5f851138e2851275bbc8b801a0230f4a3;hb=905823ea63bee55129a8d2337ca5a812b09eeda9;hp=febb87a7a5748a81c28aa0ae8c1bd9a985e53fbb;hpb=be1342fe5dee55f30f4c83d2da5cdc4f5bc46b16;p=friendica-addons.git diff --git a/group_text/group_text.php b/group_text/group_text.php index febb87a7..6d14b6f5 100644 --- a/group_text/group_text.php +++ b/group_text/group_text.php @@ -4,28 +4,29 @@ * Description: Disable images in group edit menu * Version: 1.0 * Author: Thomas Willingham - * - * */ - +use Friendica\Core\Hook; +use Friendica\Core\L10n; +use Friendica\Core\Logger; use Friendica\Core\PConfig; +use Friendica\DI; function group_text_install() { - register_hook('plugin_settings', 'addon/group_text/group_text.php', 'group_text_settings'); - register_hook('plugin_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("installed group_text"); + Logger::log("installed group_text"); } function group_text_uninstall() { - unregister_hook('plugin_settings', 'addon/group_text/group_text.php', 'group_text_settings'); - unregister_hook('plugin_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("removed group_text"); + Logger::log("removed group_text"); } @@ -40,17 +41,17 @@ function group_text_uninstall() { */ function group_text_settings_post($a,$post) { - if(! local_user() || (! x($_POST,'group_text-submit'))) + if(! local_user() || empty($_POST['group_text-submit'])) return; PConfig::set(local_user(),'system','groupedit_image_limit',intval($_POST['group_text'])); - info( t('Group Text settings updated.') . EOL); + info(L10n::t('Group Text settings updated.') . EOL); } /** * - * Called from the Plugin Setting form. + * Called from the Addon Setting form. * Add our own settings info to the page. * */ @@ -64,7 +65,7 @@ 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"; + $a->page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variable */ @@ -74,14 +75,14 @@ function group_text_settings(&$a,&$s) { /* Add some HTML to the existing form */ $s .= '
'; - $s .= '

' . t('Group Text') . '

'; + $s .= '

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

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