4 * Description: Disable images in group edit menu
6 * Author: Thomas Willingham <https://kakste.com/profile/beardyunixer>
10 use Friendica\Core\Hook;
11 use Friendica\Core\Logger;
12 use Friendica\Core\Renderer;
15 function group_text_install() {
17 Hook::register('addon_settings', 'addon/group_text/group_text.php', 'group_text_settings');
18 Hook::register('addon_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post');
20 Logger::notice("installed group_text");
25 * Callback from the settings post function.
26 * $post contains the $_POST array.
27 * We will make sure we've got a valid user account
28 * and if so set our configuration setting for this person.
32 function group_text_settings_post($a,$post) {
33 if(! local_user() || empty($_POST['group_text-submit']))
35 DI::pConfig()->set(local_user(),'system','groupedit_image_limit',intval($_POST['group_text']));
41 * Called from the Addon Setting form.
42 * Add our own settings info to the page.
48 function group_text_settings(App &$a, array &$data)
54 $enabled = DI::pConfig()->get(local_user(),'system','groupedit_image_limit');
56 $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/group_text/');
57 $html = Renderer::replaceMacros($t, [
58 '$enabled' => ['group_text', DI::l10n()->t('Use a text only (non-image) group selector in the "group edit" menu'), $enabled],
62 'addon' => 'group_text',
63 'title' => DI::l10n()->t('Group Text'),