Plugin: Google Meet: Merging into Chamilo - refs #3293

pull/3377/head
Yannick Warnier 5 years ago
parent a1181254dd
commit 9a0be15404
  1. 1
      main/inc/lib/plugin.lib.php
  2. 14
      plugin/google_meet/README.md
  3. 5
      plugin/google_meet/config.php
  4. 4
      plugin/google_meet/install.php
  5. 24
      plugin/google_meet/lang/english.php
  6. 24
      plugin/google_meet/lang/french.php
  7. 24
      plugin/google_meet/lang/spanish.php
  8. 54
      plugin/google_meet/meets.php
  9. 0
      plugin/google_meet/plugin.php
  10. 148
      plugin/google_meet/resources/css/style.css
  11. 0
      plugin/google_meet/resources/img/64/google_meet.png
  12. 0
      plugin/google_meet/resources/img/64/google_meet_na.png
  13. 0
      plugin/google_meet/resources/img/svg/googlemeet.svg
  14. 0
      plugin/google_meet/resources/img/svg/meet_room.svg
  15. 108
      plugin/google_meet/src/google_meet_plugin.class.php
  16. 10
      plugin/google_meet/start.php
  17. 3
      plugin/google_meet/uninstall.php
  18. 2
      plugin/google_meet/view/home.tpl
  19. 0
      plugin/google_meet/view/meets.tpl
  20. 26
      plugin/googlemeet/lang/spanish.php
  21. 148
      plugin/googlemeet/resources/css/style.css

@ -233,6 +233,7 @@ class AppPlugin
'follow_buttons',
'formLogin_hide_unhide',
'google_maps',
'google_meet',
'grading_electronic',
'hello_world',
'ims_lti',

@ -0,0 +1,14 @@
Google Meet plugin
============================
This plugin allows you to have videoconference rooms in each course using Google Meet.
This is only a light integration, meaning you will still need to go to Google Meet and
have a Google account in order to create a meeting *and* students will need to be
connected to their Google account to connect. However, we believe there is still value
in making this plugin available for our community at large.
# Changelog
## Version 1.0 - 2020-07-09
Initial release. Includes the possibility to create meetings manually, through
a link to https://meet.google.com/

@ -1,11 +1,10 @@
<?php
/**
* Config the plugin.
*
* @author Alex Aragón Calixto <alex.aragon@tunqui.pe>
*
* @package chamilo.plugin.googlemeet
* @package chamilo.plugin.google_meet
*/
require_once __DIR__.'/../../main/inc/global.inc.php';
require_once 'src/googlemeet_plugin.class.php';
require_once 'src/google_meet_plugin.class.php';

@ -3,8 +3,8 @@
/**
* Config the plugin.
*
* @package chamilo.plugin.googlemeet
* @package chamilo.plugin.google_meet
*/
require_once __DIR__.'/config.php';
GoogleMeetPlugin::create()->install();
GoogleMeetPlugin::create()->install();

@ -0,0 +1,24 @@
<?php
/* For licensing terms, see /license.txt */
$strings['plugin_title'] = 'Google Meet';
$strings['plugin_comment'] = 'Google Meet is the videoconference system from Google.';
$strings['tool_title'] = 'Tool name';
$strings['tool_title_help'] = 'You can change the tool name to something else than "Google Meet". For example: Videoconference';
$strings['google_meet_enabled'] = 'Enable the Google Meet tool';
$strings['google_meet_enabled_help'] = 'Choose whether you want to enable this tool. This will make a new tool available on the homepage of every course.';
$strings['CourseDoesNotHaveAccountGoogleMeet'] = 'This course does not have a meeting configured.';
$strings['ManageMeetAccounts'] = 'Add a new Google Meet meeting';
$strings['AddMeet'] = 'Register a new meeting';
$strings['EditMeet'] = 'Edit meeting';
$strings['MeetName'] = 'Name of the meeting';
$strings['MeetNameHelp'] = 'Assign a name for the meeting (e.g. Room 1 - Strategy)';
$strings['GoogleMeetURL'] = 'Meeting URL';
$strings['GoogleMeetURLHelp'] = 'This is the URL to start a new instant meeting with Google Meet. If you do not have a meeting URL yet, <a href="%s" target="_blank">click here</a> to create one, then save the URL and put it in this field.';
$strings['AccessMeeting'] = 'Access the meeting';
$strings['MeetingDescription'] = 'Description';
$strings['MeetingDescriptionHelp'] = '(Optional) Add a short description for the meeting.';
$strings['MeetColor'] = 'Color of Meet';
$strings['MeetColorHelp'] = '(Optional)';

@ -0,0 +1,24 @@
<?php
/* For licensing terms, see /license.txt */
$strings['plugin_title'] = 'Google Meet';
$strings['plugin_comment'] = 'Google Meet est le système de vidéoconférence de Google.';
$strings['tool_title'] = "Nom de l'outil";
$strings['tool_title_help'] = 'Vous pouvez modifier le nom de cet outil dans les cours à autre chose que "Google Meet". Par exemple: Vidéoconférence';
$strings['google_meet_enabled'] = "Activer l'outil";
$strings['google_meet_enabled_help'] = "Choisissez si vous souhaitez activer/désactiver cet outil. L'activer rendra un nouvel outil disponible sur la page principale de chaque cours.";
$strings['CourseDoesNotHaveAccountGoogleMeet'] = "Ce cours n'a encore aucune réunion configurée.";
$strings['ManageMeetAccounts'] = 'Ajouter une nouvelle réunion Google Meet';
$strings['AddMeet'] = 'Enregistrer une nouvelle réunion';
$strings['EditMeet'] = 'Éditer la réunion';
$strings['MeetName'] = 'Titre de la réunion';
$strings['MeetNameHelp'] = 'Assignez-lui un nom (ex: Salle 1 - Stratégie)';
$strings['GoogleMeetURL'] = 'URL de la réunion';
$strings['GoogleMeetURLHelp'] = 'Il s\'agit de l\'URL de démarrage de la réunion sur Google Meet. Si vous n\'avez pas encore d\'URL, <a href="%s" target="_blank">cliquez ici</a> pour en créer une, puis copiez son URL et collez-la dans ce champs.';
$strings['AccessMeeting'] = 'Accéder à la réunion';
$strings['MeetingDescription'] = 'Description';
$strings['MeetingDescriptionHelp'] = '(Optionnel) Ajouter une brève description.';
$strings['MeetColor'] = 'Couleur de la réunion';
$strings['MeetColorHelp'] = '(Optionnel)';

@ -0,0 +1,24 @@
<?php
/* For licensing terms, see /license.txt */
$strings['plugin_title'] = 'Google Meet';
$strings['plugin_comment'] = 'Google Meet es el sistema de videoconferencia de Google.';
$strings['tool_title'] = 'Nombre de la herramienta';
$strings['tool_title_help'] = 'Puede cambiar el nombre de la herramienta Google Meet. Ejemplo: Videoconferencia';
$strings['google_meet_enabled'] = 'Activar herramienta Google Meet';
$strings['google_meet_enabled_help'] = 'Escoja si desea activar el plugin en esta plataforma. Esta acción activará una herramienta extra en la página principal del curso.';
$strings['CourseDoesNotHaveAccountGoogleMeet'] = 'Este curso no tiene configurado una reunión Google Meet.';
$strings['ManageMeetAccounts'] = 'Agregar una reunión Google Meet';
$strings['AddMeet'] = 'Registrar reunión Google Meet';
$strings['EditMeet'] = 'Editar reunión Google Meet';
$strings['MeetName'] = 'Nombre de la reunión';
$strings['MeetNameHelp'] = 'Asigne un nombre para la reunión. Ejemplo: Sala 1';
$strings['GoogleMeetURL'] = 'URL del Meet';
$strings['GoogleMeetURLHelp'] = 'Es la URL para iniciar una reunión instantánea con Google Meet. Si no tiene una URL de reunión todavía, <a href=\"%s\" target=\"_blank\">haga clic aquí</a> para crear una, luego guarde la URL y colóquela en el campo arriba.';
$strings['AccessMeeting'] = 'Acceder a la reunión';
$strings['MeetingDescription'] = 'Descripción';
$strings['MeetingDescriptionHelp'] = '(Opcional) Añada una breve descripción sobre la reunión.';
$strings['MeetColor'] = 'Color de Meet';
$strings['MeetColorHelp'] = '(Opcional)';

@ -1,15 +1,15 @@
<?php
/**
* This script initiates a video conference session, calling the Zoom Conector API.
* This script initiates a video conference session, c the Google Meet.
*/
require_once __DIR__.'/../../vendor/autoload.php';
$course_plugin = 'googlemeet'; //needed in order to load the plugin lang variables
$course_plugin = 'google_meet'; //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"/>';
).'google_meet/resources/css/style.css"/>';
$plugin = GoogleMeetPlugin::create();
@ -34,7 +34,7 @@ if ($enable) {
$idMeet = isset($_GET['id_meet']) ? $_GET['id_meet'] : null;
$res = $plugin->deleteMeet($idMeet);
if ($res) {
$url = api_get_path(WEB_PLUGIN_PATH).'googlemeet/start.php?'.api_get_cidreq();
$url = api_get_path(WEB_PLUGIN_PATH).'google_meet/start.php?'.api_get_cidreq();
header('Location: '.$url);
}
@ -42,7 +42,7 @@ if ($enable) {
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()
api_get_path(WEB_PLUGIN_PATH).'google_meet/start.php?'.api_get_cidreq()
);
//create form
$form = new FormValidator(
@ -68,36 +68,14 @@ if ($enable) {
'meet_url',
[
$plugin->get_lang('GoogleMeetURL'),
$plugin->get_lang('GoogleMeetURLHelp'),
sprintf($plugin->get_lang('GoogleMeetURLHelp'), GoogleMeetPlugin::GOOGLE_MEET_URL),
],
true,
[
'title' => $plugin->get_lang('InstantMeetURLHelp'),
'title' => sprintf($plugin->get_lang('GoogleMeetURLHelp'), GoogleMeetPlugin::GOOGLE_MEET_URL),
]
);
/*$timeNextWeek = time() + 86400 * 2;
$nextWeek = substr(api_get_local_time($timeNextWeek), 0, 10);
if (!isset($defaults['star_date'])) {
$date = substr($nextWeek, 0, 10);
$defaults['star_date'] = $date.' 09:00';
}
if (!isset($defaults['end_date'])) {
$nextDay = substr(api_get_local_time($timeNextWeek), 0, 10);
$date = substr($nextDay, 0, 10);
$defaults['end_date'] = $date.' 10:00';
}
$form->addDateTimePicker(
'star_date',
$plugin->get_lang('StartDateMeet')
);
$form->addDateTimePicker(
'end_date',
$plugin->get_lang('EndDateMeet')
);*/
try {
$form->addElement(
'color',
@ -140,7 +118,7 @@ if ($enable) {
$values = $form->exportValues();
$res = $plugin->saveMeet($values);
if ($res) {
$url = api_get_path(WEB_PLUGIN_PATH).'googlemeet/start.php?'.api_get_cidreq();
$url = api_get_path(WEB_PLUGIN_PATH).'google_meet/start.php?'.api_get_cidreq();
header('Location: '.$url);
}
}
@ -154,11 +132,11 @@ if ($enable) {
case 'edit':
$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()
api_get_path(WEB_PLUGIN_PATH).'google_meet/start.php?'.api_get_cidreq()
);
$idMeet = isset($_GET['id_meet']) ? (int)$_GET['id_meet'] : 0;
$dataMeet = $plugin->getMeet(Security::remove_XSS($idMeet));
$dataMeet = $plugin->getMeet($idMeet);
//create form
$form = new FormValidator(
@ -184,12 +162,12 @@ if ($enable) {
$form->addText(
'meet_url',
[
$plugin->get_lang('InstantMeetURL'),
$plugin->get_lang('InstantMeetURLHelp'),
$plugin->get_lang('GoogleMeetURL'),
sprintf($plugin->get_lang('GoogleMeetURLHelp'), GoogleMeetPlugin::GOOGLE_MEET_URL),
],
true,
[
'title' => $plugin->get_lang('InstantMeetURLHelp'),
'title' => sprintf($plugin->get_lang('GoogleMeetURLHelp'), GoogleMeetPlugin::GOOGLE_MEET_URL),
]
);
$form->addElement(
@ -223,7 +201,7 @@ if ($enable) {
$res = $plugin->updateMeet($values);
if ($res) {
$url = api_get_path(WEB_PLUGIN_PATH).'googlemeet/start.php?'.api_get_cidreq();
$url = api_get_path(WEB_PLUGIN_PATH).'google_meet/start.php?'.api_get_cidreq();
header('Location: '.$url);
}
@ -248,6 +226,6 @@ if ($isAdmin || $isTeacher) {
}
$tpl->assign('message', $message);
$content = $tpl->fetch('googlemeet/view/meets.tpl');
$content = $tpl->fetch('google_meet/view/meets.tpl');
$tpl->assign('content', $content);
$tpl->display_one_col_template();
$tpl->display_one_col_template();

@ -0,0 +1,148 @@
.plugin_logo{
text-align: center;
padding-top: 1rem;
padding-bottom: 1rem;
}
.plugin_logo .img-responsive{
margin: auto;
}
.tools{
margin-bottom: 2rem;
margin-top: 1rem;
}
.card{
position: relative;
display: flex;
flex-direction: column;
min-width: 0;
word-wrap: break-word;
border: 1px solid rgba(0,0,0,.05);
border-radius: .375rem;
background-color: #fff;
background-clip: border-box;
}
.card-meet{
margin-bottom: 30px;
border: 0;
box-shadow: 0 0 2rem 0 rgba(136,152,170,.15);
}
.card-meet:hover{
border-left: .25rem solid #cdcdcd !important;
}
.card-meet .card-body {
padding: 1rem 1.5rem;
}
.row-meet {
display: block;
}
.description{
padding-left: 1rem;
padding-right: 1rem;
padding-top: 2rem;
font-size: 12px;
color: #666666;
display: grid;
}
.description .title{
font-size: 1.45rem;
font-weight: 600!important;
color: #32325d;
overflow:hidden;
white-space:nowrap;
text-overflow: ellipsis;
width: 100%;
display: inline-block;
}
.description .text{
display: grid;
padding-bottom: 1rem;
}
.rounded-circle {
border-radius: 50%!important;
}
.shadow {
box-shadow: 0 0 2rem 0 rgba(136,152,170,.15)!important;
}
.icon {
width: 5rem;
height: 5rem;
}
.icon-shape {
display: inline-flex;
padding: 12px;
text-align: center;
border-radius: 50%;
align-items: center;
justify-content: center;
position: absolute;
right: 40%;
top: -20px;
}
.icon-shape .fa{
font-size: 20px;
}
.text-white {
color: #fff!important;
}
.btn-meet{
color: #fff;
border-color: #5e72e4;
background-color: #5e72e4;
box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08);
}
.btn-meet:hover {
color: #fff;
border-color: #5e72e4;
background-color: #5e72e4;
}
.btn:hover {
transform: translateY(-1px);
box-shadow: 0 7px 14px rgba(50,50,93,.1), 0 3px 6px rgba(0,0,0,.08);
}
.float-right {
position: absolute;
top: 5px;
right: 5px;
}
.btn-add-meet{
color: #fff;
border-color: #1cc88a;
background-color: #1cc88a;
font-weight: bold;
}
.btn-add-meet:hover {
color: #fff;
border-color: #17a673;
background-color: #169b6b;
}
.meet-list{
display: grid;
grid-template-columns: repeat(3, 1fr);
}
.meet-list .meet-item{
margin: 10px;
}
.meet-list .meet-item .card-meet{
min-height: 220px;
}
@media (min-width: 768px) and (max-width: 979px) {
.meet-list {
display: grid;
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 767px) {
.meet-list {
display: grid;
grid-template-columns: repeat(2, 1fr);
}
}
/* Landscape phones and down */
@media (max-width: 480px) {
.meet-list {
display: grid;
grid-template-columns: repeat(1, 1fr);
}
}

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

@ -2,16 +2,17 @@
/**
* Plugin class for the Google Meet plugin.
*
* @package chamilo.plugin.googlemeet
* @package chamilo.plugin.google_meet
*
* @author Alex Aragón Calixto <alex.aragon@tunqui.pe>
* @author Alex Aragón Calixto <alex.aragon@tunqui.pe>
*/
class GoogleMeetPlugin extends Plugin
{
const TABLE_MEET_LIST = 'plugin_meet_room';
const TABLE_MEET_LIST = 'plugin_google_meet_room';
const SETTING_TITLE = 'tool_title';
const SETTING_ENABLED = 'google_meet_enabled';
const GOOGLE_MEET_URL = 'https://meet.google.com/';
public $isCoursePlugin = true;
@ -33,7 +34,7 @@ class GoogleMeetPlugin extends Plugin
/**
* @return string
*/
public function getToolTitle()
public function getTitle()
{
$title = $this->get(self::SETTING_TITLE);
@ -45,6 +46,15 @@ class GoogleMeetPlugin extends Plugin
}
/**
* {@inheritdoc}
*/
public function get_name()
{
return 'google_meet';
}
/**
* Create a plugin instance
* @return GoogleMeetPlugin
*/
public static function create()
@ -56,7 +66,8 @@ class GoogleMeetPlugin extends Plugin
/**
* This method creates the tables required to this plugin.
* This method creates the tables required to this plugin and copies icons
* to the right places
*/
public function install()
{
@ -67,26 +78,26 @@ class GoogleMeetPlugin extends Plugin
meet_description VARCHAR(250) NULL,
meet_color VARCHAR(7) NULL,
type_meet INT NOT NULL,
cd_id INT NULL NOT NULL,
start_time DATETIME NULL,
end_time DATETIME NULL,
c_id INT NULL NOT NULL,
session_id INT,
activate INT
)";
Database::query($sql);
$src1 = api_get_path(SYS_PLUGIN_PATH).'google_meet/resources/img/64/meet.png';
$src2 = api_get_path(SYS_PLUGIN_PATH).'google_meet/resources/img/64/meet_na.png';
$dest1 = api_get_path(SYS_CODE_PATH).'img/icons/64/meet.png';
$dest2 = api_get_path(SYS_CODE_PATH).'img/icons/64/meet_na.png';
$src1 = api_get_path(SYS_PLUGIN_PATH).'google_meet/resources/img/64/google_meet.png';
$src2 = api_get_path(SYS_PLUGIN_PATH).'google_meet/resources/img/64/google_meet_na.png';
$dest1 = api_get_path(SYS_CODE_PATH).'img/icons/64/google_meet.png';
$dest2 = api_get_path(SYS_CODE_PATH).'img/icons/64/google_meet_na.png';
copy($src1, $dest1);
copy($src2, $dest2);
}
/**
* This method drops the plugin tables.
* This method drops the plugin tables and icons
*/
public function uninstall()
{
@ -101,12 +112,21 @@ class GoogleMeetPlugin extends Plugin
$sql = "DROP TABLE IF EXISTS $table";
Database::query($sql);
}
$dest1 = api_get_path(SYS_CODE_PATH).'img/icons/64/google_meet.png';
$dest2 = api_get_path(SYS_CODE_PATH).'img/icons/64/google_meet_na.png';
if (file_exists($dest1)) {
@unlink($dest1);
}
if (file_exists($dest2)) {
@unlink($dest2);
}
$this->manageTab(false);
}
/**
* {@inheritDoc}
* @return GoogleMeetPlugin
*/
public function performActionsAfterConfigure()
@ -119,18 +139,21 @@ class GoogleMeetPlugin extends Plugin
$courses = $em->createQuery('SELECT c.id FROM ChamiloCoreBundle:Course c')->getResult();
foreach ($courses as $course) {
$this->createLinkToCourseTool($this->getToolTitle(), $course['id']);
$this->createLinkToCourseTool($this->getTitle(), $course['id']);
}
}
return $this;
}
/**
* Delete links to the tool from the c_tool table
*/
private function deleteCourseToolLinks()
{
Database::getManager()
->createQuery('DELETE FROM ChamiloCourseBundle:CTool t WHERE t.category = :category AND t.link LIKE :link')
->execute(['category' => 'plugin', 'link' => 'googlemeet/start.php%']);
->execute(['category' => 'plugin', 'link' => 'google_meet/start.php%']);
}
@ -141,14 +164,18 @@ class GoogleMeetPlugin extends Plugin
$table = Database::get_main_table(self::TABLE_MEET_LIST);
$idCourse = api_get_course_int_id();
$url = self::filterUrl($values['meet_url']);
if (!isset($values['type_meet'])) {
$values['type_meet'] = 1;
}
$params = [
'meet_name' => $values['meet_name'],
'meet_url' => $values['meet_url'],
'meet_url' => $url,
'type_meet' => $values['type_meet'],
'meet_description' => $values['meet_description'],
'meet_color' => $values['meet_color'],
'cd_id' => $idCourse,
'c_id' => $idCourse,
'start_time' => null,
'end_time' => null,
'session_id' => null,
@ -167,7 +194,7 @@ class GoogleMeetPlugin extends Plugin
$list = [];
$tableMeetList = Database::get_main_table(self::TABLE_MEET_LIST);
$sql = "SELECT * FROM $tableMeetList WHERE cd_id = $idCourse AND activate = 1";
$sql = "SELECT * FROM $tableMeetList WHERE c_id = $idCourse AND activate = 1";
$result = Database::query($sql);
@ -200,7 +227,7 @@ class GoogleMeetPlugin extends Plugin
'meet_description' => $row['meet_description'],
'meet_color' => $row['meet_color'],
'type_meet' => $row['type_meet'],
'cd_id' => $row['cd_id'],
'c_id' => $row['c_id'],
'start_time' => $row['start_time'],
'end_time' => $row['end_time'],
'session_id' => $row['session_id'],
@ -219,8 +246,8 @@ class GoogleMeetPlugin extends Plugin
}
$meet = [];
$tableMeetList = Database::get_main_table(self::TABLE_MEET_LIST);
$sql = "SELECT * FROM $tableMeetList
WHERE id = $idMeet";
$idMeet = (int) $idMeet;
$sql = "SELECT * FROM $tableMeetList WHERE id = $idMeet";
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
@ -232,7 +259,7 @@ class GoogleMeetPlugin extends Plugin
'meet_description' => $row['meet_description'],
'meet_color' => $row['meet_color'],
'type_meet' => $row['type_meet'],
'cd_id' => $row['cd_id'],
'c_id' => $row['c_id'],
'start_time' => $row['start_time'],
'end_time' => $row['end_time'],
'session_id' => $row['session_id'],
@ -250,14 +277,18 @@ class GoogleMeetPlugin extends Plugin
$table = Database::get_main_table(self::TABLE_MEET_LIST);
$idCourse = api_get_course_int_id();
$url = self::filterUrl($values['meet_url']);
if (!isset($values['type_meet'])) {
$values['type_meet'] = 1;
}
$params = [
'meet_name' => $values['meet_name'],
'meet_url' => $values['meet_url'],
'meet_url' => $url,
'type_meet' => $values['type_meet'],
'meet_description' => $values['meet_description'],
'meet_color' => $values['meet_color'],
'cd_id' => $idCourse,
'c_id' => $idCourse,
'start_time' => null,
'end_time' => null,
'session_id' => null,
@ -277,12 +308,17 @@ class GoogleMeetPlugin extends Plugin
return true;
}
/**
* Delete a given meeting
* @param int $idMeet Chamilo's internal ID of the meeting
* @return bool True on success, false on failure
*/
public function deleteMeet($idMeet)
{
if (empty($idMeet)) {
return false;
}
$idMeet = (int) $idMeet;
$tableMeetList = Database::get_main_table(self::TABLE_MEET_LIST);
$sql = "DELETE FROM $tableMeetList WHERE id = $idMeet";
$result = Database::query($sql);
@ -294,4 +330,28 @@ class GoogleMeetPlugin extends Plugin
return true;
}
}
/**
* Do a bit of prevention on the meeting URL format
* @param string $url The URL received from the user
* @return string Reformatted URL
*/
private function filterUrl($url) {
if (!empty($url)) {
if (preg_match('#^'.self::GOOGLE_MEET_URL.'#', $url)) {
// The URL starts with the right Google Meet protocol and domain, do nothing
} elseif (preg_match('#^'.substr(self::GOOGLE_MEET_URL, 8).'#', $url)) {
// The URL starts with meet.google.com without the protocol. Add it
$url = 'https://'.$url;
} else {
// We assume it's just the meeting code. Add the full Google Meet prefix
if (substr($url, 0, 1) === '/') {
// Remove prefixing slash, if any
$url = substr($url, 1);
}
$url = self::GOOGLE_MEET_URL.$url;
}
}
return $url;
}
}

@ -4,12 +4,12 @@
*/
require_once __DIR__.'/../../vendor/autoload.php';
$course_plugin = 'googlemeet'; //needed in order to load the plugin lang variables
$course_plugin = 'google_meet'; //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"/>';
).'google_meet/resources/css/style.css"/>';
$plugin = GoogleMeetPlugin::create();
@ -26,7 +26,7 @@ $isStudent = api_is_student();
$action = isset($_GET['action']) ? $_GET['action'] : null;
$enable = $plugin->get('google_meet_enabled') == 'true';
$urlAddMeet = api_get_path(WEB_PLUGIN_PATH).'googlemeet/meets.php?action=add&'.api_get_cidreq();
$urlAddMeet = api_get_path(WEB_PLUGIN_PATH).'google_meet/meets.php?action=add&'.api_get_cidreq();
if ($enable) {
@ -42,6 +42,6 @@ $tpl->assign('meets', $meets);
$tpl->assign('is_admin', $isAdmin);
$tpl->assign('is_student', $isStudent);
$tpl->assign('is_teacher', $isTeacher);
$content = $tpl->fetch('googlemeet/view/home.tpl');
$content = $tpl->fetch('google_meet/view/home.tpl');
$tpl->assign('content', $content);
$tpl->display_one_col_template();
$tpl->display_one_col_template();

@ -1,5 +1,4 @@
<?php
/* For licensing terms, see /license.txt */
require_once __DIR__.'/config.php';
GoogleMeetPlugin::create()->uninstall();
GoogleMeetPlugin::create()->uninstall();

@ -3,7 +3,7 @@
<div class="meets">
<div class="">
<div class="plugin_logo">
<img alt="" class="img-responsive" src="{{ _p.web }}plugin/googlemeet/resources/img/svg/meet_room.svg">
<img alt="" class="img-responsive" src="{{ _p.web_plugin }}google_meet/resources/img/svg/meet_room.svg">
</div>
<div class="tools text-center">
{% if is_admin or is_teacher %}

@ -1,26 +0,0 @@
<?php
/* For licensing terms, see /license.txt */
$strings['plugin_title'] = 'Hangouts Meet';
$strings['plugin_comment'] = 'Google Hangouts Meet es el sistema de videoconferencia de Google, Conformado por a la app de Hangouts Meet y el Hardware de videoconferencia.';
$strings['tool_title'] = 'Nombre de la herramienta';
$strings['tool_title_help'] = 'Puede cambiar el nombre de la herramienta Google Meet; Ejemplo: Videoconferencia';
$strings['google_meet_enabled'] = 'Activar Herramienta Google Meet';
$strings['google_meet_enabled_help'] = 'Escoga si desea activar el plugin en su plataforma Chamilo, esta acción activara una herramienta extra en las herramienta del curso.';
$strings['CourseDoesNotHaveAccountGoogleMeet'] = 'Este curso no tiene configurado una reunión Google Meet.';
$strings['ManageMeetAccounts'] = 'Agregar una reunión Google Meet';
$strings['AddMeet'] = 'Registrar reunión Google Meet';
$strings['EditMeet'] = 'Editar reunión Google Meet';
$strings['MeetName'] = 'Nombre de la reunión';
$strings['MeetNameHelp'] = 'Asigna un nombre para la reunión. Ejemplo: Sala 1';
$strings['GoogleMeetURL'] = "URL del Meet";
$strings['GoogleMeetURLHelp'] = "Es la URL para iniciar una reunión instantánea conn Google Meet";
$strings['AccessMeeting'] = "Accede a la reunión";
$strings['MeetingDescription'] = "Descripción";
$strings['MeetingDescriptionHelp'] = "(Opcional) Añade una breve descripción sobre la reunión.";
$strings['MeetColor'] = "Color Meet";
$strings['MeetColorHelp'] = "(Opcional)";
$strings['StartDateMeet'] = "Fecha de inicio";
$strings['EndDateMeet'] = "Fecha de fin";

@ -1,148 +0,0 @@
.plugin_logo{
text-align: center;
padding-top: 1rem;
padding-bottom: 1rem;
}
.plugin_logo .img-responsive{
margin: auto;
}
.tools{
margin-bottom: 2rem;
margin-top: 1rem;
}
.card{
position: relative;
display: flex;
flex-direction: column;
min-width: 0;
word-wrap: break-word;
border: 1px solid rgba(0,0,0,.05);
border-radius: .375rem;
background-color: #fff;
background-clip: border-box;
}
.card-meet{
margin-bottom: 30px;
border: 0;
box-shadow: 0 0 2rem 0 rgba(136,152,170,.15);
}
.card-meet:hover{
border-left: .25rem solid #cdcdcd !important;
}
.card-meet .card-body {
padding: 1rem 1.5rem;
}
.row-meet {
display: block;
}
.description{
padding-left: 1rem;
padding-right: 1rem;
padding-top: 2rem;
font-size: 12px;
color: #666666;
display: grid;
}
.description .title{
font-size: 1.45rem;
font-weight: 600!important;
color: #32325d;
overflow:hidden;
white-space:nowrap;
text-overflow: ellipsis;
width: 100%;
display: inline-block;
}
.description .text{
display: grid;
padding-bottom: 1rem;
}
.rounded-circle {
border-radius: 50%!important;
}
.shadow {
box-shadow: 0 0 2rem 0 rgba(136,152,170,.15)!important;
}
.icon {
width: 5rem;
height: 5rem;
}
.icon-shape {
display: inline-flex;
padding: 12px;
text-align: center;
border-radius: 50%;
align-items: center;
justify-content: center;
position: absolute;
right: 40%;
top: -20px;
}
.icon-shape .fa{
font-size: 20px;
}
.text-white {
color: #fff!important;
}
.btn-meet{
color: #fff;
border-color: #5e72e4;
background-color: #5e72e4;
box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08);
}
.btn-meet:hover {
color: #fff;
border-color: #5e72e4;
background-color: #5e72e4;
}
.btn:hover {
transform: translateY(-1px);
box-shadow: 0 7px 14px rgba(50,50,93,.1), 0 3px 6px rgba(0,0,0,.08);
}
.float-right {
position: absolute;
top: 5px;
right: 5px;
}
.btn-add-meet{
color: #fff;
border-color: #1cc88a;
background-color: #1cc88a;
font-weight: bold;
}
.btn-add-meet:hover {
color: #fff;
border-color: #17a673;
background-color: #169b6b;
}
.meet-list{
display: grid;
grid-template-columns: repeat(3, 1fr);
}
.meet-list .meet-item{
margin: 10px;
}
.meet-list .meet-item .card-meet{
min-height: 220px;
}
@media (min-width: 768px) and (max-width: 979px) {
.meet-list {
display: grid;
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 767px) {
.meet-list {
display: grid;
grid-template-columns: repeat(2, 1fr);
}
}
/* Landscape phones and down */
@media (max-width: 480px) {
.meet-list {
display: grid;
grid-template-columns: repeat(1, 1fr);
}
}
Loading…
Cancel
Save