X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=webrtc%2Fwebrtc.php;h=a71bac2afba551ca2b5c6de525f5831eec93c100;hb=96c41e56233765571870b56081efc366655bead4;hp=7a4e8cf772cd0b2fae2a9c9a3f295de3f87030f3;hpb=f75ef0c59e13abe3ed8418952b87669725034ada;p=friendica-addons.git diff --git a/webrtc/webrtc.php b/webrtc/webrtc.php index 7a4e8cf7..a71bac2a 100644 --- a/webrtc/webrtc.php +++ b/webrtc/webrtc.php @@ -3,16 +3,18 @@ * Name: WebRTC Application * Description: add a webrtc instance for video/audio * Version: 1.0 - * Author: stephen mahood - * Author: Tobias Diekershoff + * Author: Stephen Mahood + * Author: Tobias Diekershoff */ +use Friendica\Core\Addon; +use Friendica\Core\Config; function webrtc_install() { - register_hook('app_menu', 'addon/webrtc/webrtc.php', 'webrtc_app_menu'); + Addon::registerHook('app_menu', 'addon/webrtc/webrtc.php', 'webrtc_app_menu'); } function webrtc_uninstall() { - unregister_hook('app_menu', 'addon/webrtc/webrtc.php', 'webrtc_app_menu'); + Addon::unregisterHook('app_menu', 'addon/webrtc/webrtc.php', 'webrtc_app_menu'); } @@ -20,16 +22,16 @@ function webrtc_app_menu($a,&$b) { $b['app_menu'][] = ''; } -function webrtc_plugin_admin (&$a, &$o) { +function webrtc_addon_admin (&$a, &$o) { $t = get_markup_template( "admin.tpl", "addon/webrtc/" ); - $o = replace_macros( $t, array( - '$submit' => t('Submit'), - '$webrtcurl' => array('webrtcurl', t('WebRTC Base URL'), get_config('webrtc','webrtcurl' ), t('Page your users will create a WebRTC chat room on. For example you could use https://live.mayfirst.org .')), - )); + $o = replace_macros( $t, [ + '$submit' => t('Save Settings'), + '$webrtcurl' => ['webrtcurl', t('WebRTC Base URL'), Config::get('webrtc','webrtcurl' ), t('Page your users will create a WebRTC chat room on. For example you could use https://live.mayfirst.org .')], + ]); } -function webrtc_plugin_admin_post (&$a) { +function webrtc_addon_admin_post (&$a) { $url = ((x($_POST, 'webrtcurl')) ? notags(trim($_POST['webrtcurl'])) : ''); - set_config('webrtc', 'webrtcurl', $url); + Config::set('webrtc', 'webrtcurl', $url); info( t('Settings updated.'). EOL); } @@ -41,7 +43,7 @@ function webrtc_content(&$a) { $o = ''; /* landingpage to create chatrooms */ - $webrtcurl = get_config('webrtc','webrtcurl'); + $webrtcurl = Config::get('webrtc','webrtcurl'); /* embedd the landing page in an iframe */ $o .= '

'.t('Video Chat').'

';