X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=webrtc%2Fwebrtc.php;h=a1f7d2cd149fc3b4591104af9fcba35e7ce2bd65;hb=8878d7c9d41507cccc0dd229ce86c974221c936f;hp=afecefaabb993c570318149fbb4a0111d0fd53b4;hpb=04df7f6e058626c030c115fd9062156a981cb619;p=friendica-addons.git diff --git a/webrtc/webrtc.php b/webrtc/webrtc.php index afecefaa..a1f7d2cd 100644 --- a/webrtc/webrtc.php +++ b/webrtc/webrtc.php @@ -21,25 +21,33 @@ function webrtc_app_menu(App $a, array &$b) $b['app_menu'][] = '
' . DI::l10n()->t('WebRTC Videochat') . '
'; } -function webrtc_addon_admin (App $a, &$o) +function webrtc_addon_admin (App $a, string &$o) { - $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/webrtc/" ); - $o = Renderer::replaceMacros( $t, [ - '$submit' => DI::l10n()->t('Save Settings'), - '$webrtcurl' => ['webrtcurl', DI::l10n()->t('WebRTC Base URL'), DI::config()->get('webrtc','webrtcurl' ), DI::l10n()->t('Page your users will create a WebRTC chat room on. For example you could use https://live.mayfirst.org .')], + $t = Renderer::getMarkupTemplate('admin.tpl', 'addon/webrtc/' ); + $o = Renderer::replaceMacros($t, [ + '$submit' => DI::l10n()->t('Save Settings'), + '$webrtcurl' => [ + 'webrtcurl', + DI::l10n()->t('WebRTC Base URL'), + DI::config()->get('webrtc','webrtcurl' ), + DI::l10n()->t('Page your users will create a WebRTC chat room on. For example you could use https://live.mayfirst.org .'), + ], ]); } + function webrtc_addon_admin_post (App $a) { - $url = trim($_POST['webrtcurl'] ?? ''); - DI::config()->set('webrtc', 'webrtcurl', $url); + DI::config()->set('webrtc', 'webrtcurl', trim($_POST['webrtcurl'] ?? '')); } -function webrtc_module() { - return; -} +/** + * This is a statement rather than an actual function definition. The simple + * existence of this method is checked to figure out if the addon offers a + * module. + */ +function webrtc_module() {} -function webrtc_content(App $a) +function webrtc_content(App $a): string { $o = '';