parent
e86da3c670
commit
fb149c05c3
@ -0,0 +1,112 @@ |
||||
<?php |
||||
/** |
||||
* This script initiates a video conference session, calling the Zoom Conector API. |
||||
*/ |
||||
require_once __DIR__.'/../../vendor/autoload.php'; |
||||
|
||||
$course_plugin = 'googlemeet'; //needed in order to load the plugin lang variables |
||||
require_once __DIR__.'/config.php'; |
||||
|
||||
$htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="'.api_get_path( |
||||
WEB_PLUGIN_PATH |
||||
).'googlemeet/resources/css/style.css"/>'; |
||||
|
||||
$plugin = GoogleMeetPlugin::create(); |
||||
|
||||
$userId = api_get_user_id(); |
||||
$tool_name = $plugin->get_lang('tool_title'); |
||||
$tpl = new Template($tool_name); |
||||
|
||||
$isAdmin = api_is_platform_admin(); |
||||
$isTeacher = api_is_teacher(); |
||||
$message = null; |
||||
|
||||
$action = isset($_GET['action']) ? $_GET['action'] : null; |
||||
$enable = $plugin->get('google_meet_enabled') == 'true'; |
||||
$actionLinks = ''; |
||||
|
||||
if ($enable) { |
||||
if ($isAdmin || $isTeacher) { |
||||
if ($action) { |
||||
switch ($action) { |
||||
case 'delete': |
||||
break; |
||||
case 'add': |
||||
$actionLinks .= Display::url( |
||||
Display::return_icon('back.png', get_lang('Back'), [], ICON_SIZE_MEDIUM), |
||||
api_get_path(WEB_PLUGIN_PATH).'googlemeet/start.php?'.api_get_cidreq() |
||||
); |
||||
//create form |
||||
$form = new FormValidator( |
||||
'add_meet', |
||||
'post', |
||||
api_get_self().'?action='.Security::remove_XSS($_GET['action']).'&'.api_get_cidreq() |
||||
); |
||||
|
||||
$form->addHeader(get_lang('AddMeet')); |
||||
$form->addText( |
||||
'meet_name', |
||||
[ |
||||
$plugin->get_lang('MeetName'), |
||||
$plugin->get_lang('MeetNameHelp'), |
||||
], |
||||
true, |
||||
[ |
||||
'title' => $plugin->get_lang('MeetNameHelp'), |
||||
] |
||||
); |
||||
|
||||
$form->addText( |
||||
'meet_url', |
||||
[ |
||||
$plugin->get_lang('InstantMeetURL'), |
||||
$plugin->get_lang('InstantMeetURLHelp'), |
||||
], |
||||
true, |
||||
[ |
||||
'title' => $plugin->get_lang('InstantMeetURLHelp'), |
||||
] |
||||
); |
||||
|
||||
$form->addHidden('type_meet', 1); |
||||
|
||||
$form->addButtonSave($plugin->get_lang('Add')); |
||||
|
||||
try { |
||||
if ($form->validate()) { |
||||
$values = $form->exportValues(); |
||||
$res = $plugin->saveMeet($values); |
||||
|
||||
} |
||||
} catch (HTML_QuickForm_Error $e) { |
||||
echo $e; |
||||
} |
||||
|
||||
$tpl->assign('form_room', $form->returnForm()); |
||||
|
||||
break; |
||||
case 'edit': |
||||
$actionLinks .= Display::url( |
||||
Display::return_icon('back.png', get_lang('Back'), [], ICON_SIZE_MEDIUM), |
||||
api_get_self().'?action=list&'.api_get_cidreq() |
||||
); |
||||
|
||||
|
||||
break; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
if ($isAdmin || $isTeacher) { |
||||
|
||||
$tpl->assign( |
||||
'actions', |
||||
Display::toolbarAction('toolbar', [$actionLinks]) |
||||
); |
||||
} |
||||
|
||||
$tpl->assign('message', $message); |
||||
$content = $tpl->fetch('googlemeet/view/meet.tpl'); |
||||
$tpl->assign('content', $content); |
||||
$tpl->display_one_col_template(); |
||||
@ -0,0 +1,12 @@ |
||||
.plugin_logo{ |
||||
text-align: center; |
||||
padding-top: 1rem; |
||||
padding-bottom: 1rem; |
||||
} |
||||
.plugin_logo .img-responsive{ |
||||
margin: auto; |
||||
} |
||||
.tools{ |
||||
margin-bottom: 2rem; |
||||
margin-top: 1rem; |
||||
} |
||||
|
After Width: | Height: | Size: 83 KiB |
@ -0,0 +1,82 @@ |
||||
<div class="row"> |
||||
<div class="col-md-12"> |
||||
<div class="panel panel-default"> |
||||
<div class="panel-body"> |
||||
<div class="plugin_logo"> |
||||
<img alt="" class="img-responsive" src="{{ _p.web }}plugin/googlemeet/resources/img/svg/meet_room.svg"> |
||||
</div> |
||||
|
||||
<div class="tools text-center"> |
||||
{% if is_admin or is_teacher %} |
||||
<a href="{{ url_add_room }}" class="btn btn-primary"> |
||||
<i class="fa fa-video-camera" aria-hidden="true"></i> |
||||
{{ 'ManageMeetAccounts'|get_plugin_lang('GoogleMeetPlugin') }} |
||||
</a> |
||||
{% endif %} |
||||
{% if is_admin or is_teacher %} |
||||
{% if room %} |
||||
<a href="{{ url_change_room }}" class="btn btn-danger"> |
||||
<i class="fa fa-trash-o" aria-hidden="true"></i> |
||||
{{ 'RemoveAndChangeRoomMeet'| get_plugin_lang('GoogleMeetPlugin') }} |
||||
</a> |
||||
{% endif %} |
||||
{% endif %} |
||||
</div> |
||||
|
||||
|
||||
{% if room %} |
||||
<div class="alert alert-info" role="alert"> |
||||
{{ 'CourseDoesNotHaveAssociatedAccountMeet'|get_plugin_lang('GoogleMeetPlugin') }} |
||||
</div> |
||||
<div class="info-room"> |
||||
<div class="well"> |
||||
<dl class="dl-horizontal"> |
||||
<dt>{{ 'MeetingIDZoom'|get_plugin_lang('GoogleMeetPlugin') }}</dt> |
||||
<dd>{{ room.room_id }}</dd> |
||||
<dt>{{ 'RoomNameZoom'|get_plugin_lang('GoogleMeetPlugin') }}</dt> |
||||
<dd>{{ room.room_name }}</dd> |
||||
<dt>{{ 'InstantMeetingURL'|get_plugin_lang('GoogleMeetPlugin') }}</dt> |
||||
<dd> |
||||
<a href="{{ room.room_url }}" target="_blank"> |
||||
{{ room.room_url }} |
||||
</a> |
||||
</dd> |
||||
{% if room.room_pass %} |
||||
<dt>{{ 'HostKey'|get_plugin_lang('GoogleMeetPlugin') }}</dt> |
||||
<dd>{{ room.room_pass }}</dd> |
||||
{% endif %} |
||||
|
||||
{% if is_teacher %} |
||||
{% if not view_pass %} |
||||
<dt>{{ 'AccountEmailZoom'|get_plugin_lang('GoogleMeetPlugin') }}</dt> |
||||
<dd>{{ room.zoom_email }}</dd> |
||||
<dt>{{ 'Password'|get_lang }}</dt> |
||||
<dd>{{ room.zoom_pass }}</dd> |
||||
{% endif %} |
||||
{% endif %} |
||||
</dl> |
||||
<div class="text-center"> |
||||
<a href="{{ room.room_url }}" target="_blank" class="btn btn-success btn-lg"> |
||||
<i class="fa fa-video-camera" aria-hidden="true"></i> |
||||
{{ 'JoinTheMeetingZoom' | get_plugin_lang('GoogleMeetPlugin') }} |
||||
</a> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% else %} |
||||
<div class="alert alert-warning" role="alert"> |
||||
{{ 'CourseDoesNotHaveAssociatedAccountMeet'|get_plugin_lang('GoogleMeetPlugin') }} |
||||
</div> |
||||
{% if is_student %} |
||||
<div class="alert alert-info" role="alert"> |
||||
{{ 'MessageMeetingZoom'|get_plugin_lang('GoogleMeetPlugin') }} |
||||
</div> |
||||
{% endif %} |
||||
{% endif %} |
||||
|
||||
{{ form_zoom }} |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
Loading…
Reference in new issue