3 * Name: Audon Application
4 * Description: add a Audon instance. Based on webRTC Addon
6 * Author: Stephen Mahood <https://friends.mayfirst.org/profile/marxistvegan>
7 * Author: Tobias Diekershoff <https://f.diekershoff.de/profile/tobias>
8 * Author: Matthias Ebers <https://loma.ml/profile/feb>
11 use Friendica\Core\Hook;
12 use Friendica\Core\Renderer;
15 function audon_install()
17 Hook::register('app_menu', __FILE__, 'audon_app_menu');
20 function audon_app_menu(array &$b)
22 $b['app_menu'][] = '<div class="app-title"><a href="audon">' . DI::l10n()->t('Audon Audiochat') . '</a></div>';
25 function audon_addon_admin(string &$o)
27 $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/audon/');
28 $o = Renderer::replaceMacros($t, [
29 '$submit' => DI::l10n()->t('Save Settings'),
32 DI::l10n()->t('Audon Base URL'),
33 DI::config()->get('audon','audonurl'),
34 DI::l10n()->t('Page your users will create an Audon audio chat room on. For example you could use https://audon.space.'),
39 function audon_addon_admin_post()
41 DI::config()->set('audon', 'audonurl', trim($_POST['audonurl'] ?? ''));
45 * This is a statement rather than an actual function definition. The simple
46 * existence of this method is checked to figure out if the addon offers a
49 function audon_module() {}
51 function audon_content(): string
55 /* landingpage to create chatrooms */
56 $audonurl = DI::config()->get('audon', 'audonurl');
59 /* embedd the landing page in an iframe */
60 $o .= '<h2>' . DI::l10n()->t('Audio Chat') . '</h2>';
61 $o .= '<p>' . DI::l10n()->t('Audon is an audio conferencing tool. Connect your account to Audon and create a room. Share the generated link to talk to other participants.') . '</p>';
62 if ($audonurl == '') {
63 $o .= '<p>' . DI::l10n()->t('Please contact your Friendica administrator to remind them to configure the Audon addon.') . '</p>';
65 $o .= '<iframe src="' . $audonurl . '" width="740px" height="600px"></iframe>';