4 * Description: Disable images in group edit menu
6 * Author: Thomas Willingham <https://kakste.com/profile/beardyunixer>
8 * Note: Please use Circle Text instead
12 use Friendica\Core\Hook;
13 use Friendica\Core\Logger;
14 use Friendica\Core\Renderer;
17 function group_text_install()
19 Hook::register('addon_settings', 'addon/group_text/group_text.php', 'group_text_settings');
20 Hook::register('addon_settings_post', 'addon/group_text/group_text.php', 'group_text_settings_post');
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(array $post)
34 if (!DI::userSession()->getLocalUserId() || empty($post['group_text-submit'])) {
38 DI::pConfig()->set(DI::userSession()->getLocalUserId(), 'system', 'groupedit_image_limit', intval($post['group_text']));
44 * Called from the Addon Setting form.
45 * Add our own settings info to the page.
49 function group_text_settings(array &$data)
51 if (!DI::userSession()->getLocalUserId()) {
55 $enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'groupedit_image_limit');
57 $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/group_text/');
58 $html = Renderer::replaceMacros($t, [
59 '$enabled' => ['group_text', DI::l10n()->t('Use a text only (non-image) group selector in the "group edit" menu'), $enabled],
63 'addon' => 'group_text',
64 'title' => DI::l10n()->t('Group Text'),