Format code, move URL into functions

1.10.x
jmontoyaa 9 years ago
parent b603d25e43
commit d2bf4a3b35
  1. 2
      plugin/bbb/index.php
  2. 5
      plugin/bbb/install.php
  3. 41
      plugin/bbb/lang/english.php
  4. 41
      plugin/bbb/lang/french.php
  5. 41
      plugin/bbb/lang/spanish.php
  6. 4
      plugin/bbb/lib/VM.php
  7. 163
      plugin/bbb/lib/bbb.lib.php
  8. 23
      plugin/bbb/lib/bbb_plugin.class.php
  9. 20
      plugin/bbb/listing.php
  10. 2
      plugin/bbb/plugin.php
  11. 3
      plugin/bbb/readme.txt
  12. 9
      plugin/bbb/start.php
  13. 7
      plugin/bbb/uninstall.php

@ -4,9 +4,6 @@
* includes things to execute in the main database (settings_current table)
* @package chamilo.plugin.bigbluebutton
*/
/**
* Initialization
*/
require_once dirname(__FILE__).'/config.php';
require_once __DIR__.'/config.php';
BBBPlugin::create()->install();

@ -5,35 +5,34 @@
* @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
* @author Laurent Opprecht <laurent@opprecht.info>
*/
// Needed in order to show the plugin title
$strings['plugin_title'] = "Videoconference";
$strings['plugin_comment'] = "Add a videoconference room in a Chamilo course using BigBlueButton (BBB)";
//Needed in order to show the plugin title
$strings['plugin_title'] = "Videoconference";
$strings['plugin_comment'] = "Add a videoconference room in a Chamilo course using BigBlueButton (BBB)";
$strings['Videoconference'] = "Videoconference";
$strings['MeetingOpened'] = "Meeting opened";
$strings['MeetingClosed'] = "Meeting closed";
$strings['Videoconference'] = "Videoconference";
$strings['MeetingOpened'] = "Meeting opened";
$strings['MeetingClosed'] = "Meeting closed";
$strings['MeetingClosedComment'] = "If you have asked for your sessions to be recorded, the recording will be available in the list below when it has been completely generated.";
$strings['CloseMeeting'] = "Close meeting";
$strings['CloseMeeting'] = "Close meeting";
$strings['VideoConferenceXCourseX'] = "Videoconference #%s course %s";
$strings['VideoConferenceAddedToTheCalendar'] = "Videoconference added to the calendar";
$strings['VideoConferenceAddedToTheLinkTool'] = "Videoconference added to the link tool";
$strings['VideoConferenceXCourseX'] = "Videoconference #%s course %s";
$strings['VideoConferenceAddedToTheCalendar'] = "Videoconference added to the calendar";
$strings['VideoConferenceAddedToTheLinkTool'] = "Videoconference added to the link tool";
$strings['GoToTheVideoConference'] = "Go to the videoconference";
$strings['GoToTheVideoConference'] = "Go to the videoconference";
$strings['Records'] = "Recording";
$strings['Meeting'] = "Meeting";
$strings['Records'] = "Recording";
$strings['Meeting'] = "Meeting";
$strings['ViewRecord'] = "View recording";
$strings['CopyToLinkTool'] = "Copy to link tool";
$strings['ViewRecord'] = "View recording";
$strings['CopyToLinkTool'] = "Copy to link tool";
$strings['EnterConference'] = "Enter the videoconference";
$strings['RecordList'] = "Recording list";
$strings['ServerIsNotRunning'] = "Videoconference server is not running";
$strings['ServerIsNotConfigured'] = "Videoconference server is not configured";
$strings['EnterConference'] = "Enter the videoconference";
$strings['RecordList'] = "Recording list";
$strings['ServerIsNotRunning'] = "Videoconference server is not running";
$strings['ServerIsNotConfigured'] = "Videoconference server is not configured";
$strings['XUsersOnLine'] = "%s user(s) online";
$strings['XUsersOnLine'] = "%s user(s) online";
$strings['host'] = 'BigBlueButton host';
$strings['host_help'] = 'This is the name of the server where your BigBlueButton server is running. Might be localhost, an IP address (e.g. 192.168.13.54) or a domain name (e.g. my.video.com).';

@ -1,32 +1,33 @@
<?php /* License: see /license.txt */
<?php
/* License: see /license.txt */
//Needed in order to show the plugin title
$strings['plugin_title'] = "Vidéoconférence";
$strings['plugin_comment'] = "Ajoutez un espace de vidéoconférences aux cours de Chamilo avec BigBlueButton (BBB)";
$strings['plugin_title'] = "Vidéoconférence";
$strings['plugin_comment'] = "Ajoutez un espace de vidéoconférences aux cours de Chamilo avec BigBlueButton (BBB)";
$strings['Videoconference'] = "Vidéoconférence";
$strings['MeetingOpened'] = "Session ouverte";
$strings['MeetingClosed'] = "Session fermée";
$strings['Videoconference'] = "Vidéoconférence";
$strings['MeetingOpened'] = "Session ouverte";
$strings['MeetingClosed'] = "Session fermée";
$strings['MeetingClosedComment'] = "Si vous avez demandé l'enregistrement des sessions de conférence, cet enregistrement apparaîtra dans la liste ci-dessous dans quelques instants.";
$strings['CloseMeeting'] = "Fermer la session";
$strings['CloseMeeting'] = "Fermer la session";
$strings['VideoConferenceXCourseX'] = "Vidéoconférence #%s, cours %s";
$strings['VideoConferenceAddedToTheCalendar'] = "Vidéoconférence ajoutée au calendrier";
$strings['VideoConferenceAddedToTheLinkTool'] = "Vidéoconférence ajoutée comme lien. Vous pouvez éditer et publier le lien sur la page principale du cours depuis l'outil liens.";
$strings['VideoConferenceXCourseX'] = "Vidéoconférence #%s, cours %s";
$strings['VideoConferenceAddedToTheCalendar'] = "Vidéoconférence ajoutée au calendrier";
$strings['VideoConferenceAddedToTheLinkTool'] = "Vidéoconférence ajoutée comme lien. Vous pouvez éditer et publier le lien sur la page principale du cours depuis l'outil liens.";
$strings['GoToTheVideoConference'] = "Entrer dans la salle de conférence";
$strings['GoToTheVideoConference'] = "Entrer dans la salle de conférence";
$strings['Records'] = "Enregistrement";
$strings['Meeting'] = "Salle de conférence";
$strings['Records'] = "Enregistrement";
$strings['Meeting'] = "Salle de conférence";
$strings['ViewRecord'] = "Voir l'enregistrement";
$strings['CopyToLinkTool'] = "Ajouter comme lien du cours";
$strings['ViewRecord'] = "Voir l'enregistrement";
$strings['CopyToLinkTool'] = "Ajouter comme lien du cours";
$strings['EnterConference'] = "Entrer dans la salle de conférence";
$strings['RecordList'] = "Liste des enregistrements";
$strings['ServerIsNotRunning'] = "Le serveur de vidéoconférence ne fonctionne pas";
$strings['ServerIsNotConfigured'] = "Le serveur de vidéoconférence n'est pas configuré correctement";
$strings['EnterConference'] = "Entrer dans la salle de conférence";
$strings['RecordList'] = "Liste des enregistrements";
$strings['ServerIsNotRunning'] = "Le serveur de vidéoconférence ne fonctionne pas";
$strings['ServerIsNotConfigured'] = "Le serveur de vidéoconférence n'est pas configuré correctement";
$strings['XUsersOnLine'] = "%s utilisateurs dans la salle";
$strings['XUsersOnLine'] = "%s utilisateurs dans la salle";
$strings['host'] = 'Hôte de BigBlueButton';
$strings['host_help'] = "C'est le nom du serveur où le serveur de vidéoconférence a été habilité. Cela peut être localhost, une adresse IP (du genre 192.168.13.54) ou un nom de domaine (du genre ma.video.com).";

@ -1,32 +1,33 @@
<?php /* License: see /license.txt */
<?php
/* License: see /license.txt */
//Needed in order to show the plugin title
$strings['plugin_title'] = "Videoconferencia";
$strings['plugin_comment'] = "Añade una sala de videoconferencia en los cursos de Chamilo con BigBlueButton (BBB)";
$strings['plugin_title'] = "Videoconferencia";
$strings['plugin_comment'] = "Añade una sala de videoconferencia en los cursos de Chamilo con BigBlueButton (BBB)";
$strings['Videoconference'] = "Videoconferencia";
$strings['MeetingOpened'] = "Sala abierta";
$strings['MeetingClosed'] = "Sala cerrada";
$strings['Videoconference'] = "Videoconferencia";
$strings['MeetingOpened'] = "Sala abierta";
$strings['MeetingClosed'] = "Sala cerrada";
$strings['MeetingClosedComment'] = "Si ha pedido grabar la sesión de videoconferencia en los parámetros del curso, esta grabación aparecerá en la lista siguiente una vez generada.";
$strings['CloseMeeting'] = "Cerrar sala";
$strings['CloseMeeting'] = "Cerrar sala";
$strings['VideoConferenceXCourseX'] = "Videoconferencia #%s, curso %s";
$strings['VideoConferenceAddedToTheCalendar'] = "Videoconferencia añadida al calendario";
$strings['VideoConferenceAddedToTheLinkTool'] = "Videoconferencia añadida como enlace. Puede editar y publicar el enlace en la página principal del curso desde la herramienta de enlace.";
$strings['VideoConferenceXCourseX'] = "Videoconferencia #%s, curso %s";
$strings['VideoConferenceAddedToTheCalendar'] = "Videoconferencia añadida al calendario";
$strings['VideoConferenceAddedToTheLinkTool'] = "Videoconferencia añadida como enlace. Puede editar y publicar el enlace en la página principal del curso desde la herramienta de enlace.";
$strings['GoToTheVideoConference'] = "Ir a la videoconferencia";
$strings['GoToTheVideoConference'] = "Ir a la videoconferencia";
$strings['Records'] = "Grabación";
$strings['Meeting'] = "Sala de conferencia";
$strings['Records'] = "Grabación";
$strings['Meeting'] = "Sala de conferencia";
$strings['ViewRecord'] = "Ver grabación";
$strings['CopyToLinkTool'] = "Añadir como enlace del curso";
$strings['ViewRecord'] = "Ver grabación";
$strings['CopyToLinkTool'] = "Añadir como enlace del curso";
$strings['EnterConference'] = "Entrar a la videoconferencia";
$strings['RecordList'] = "Lista de grabaciones";
$strings['ServerIsNotRunning'] = "El servidor de videoconferencia no está funcionando";
$strings['ServerIsNotConfigured'] = "El servidor de videoconferencia no está configurado correctamente";
$strings['EnterConference'] = "Entrar a la videoconferencia";
$strings['RecordList'] = "Lista de grabaciones";
$strings['ServerIsNotRunning'] = "El servidor de videoconferencia no está funcionando";
$strings['ServerIsNotConfigured'] = "El servidor de videoconferencia no está configurado correctamente";
$strings['XUsersOnLine'] = "%s usuario(s) en la sala";
$strings['XUsersOnLine'] = "%s usuario(s) en la sala";
$strings['host'] = 'Host de BigBlueButton';
$strings['host_help'] = 'Este es el nombre del servidor donde su servidor BigBlueButton está corriendo. Puede ser localhost, una dirección IP (ej: 192.168.13.54) o un nombre de dominio (ej: mi.video.com).';

@ -9,6 +9,10 @@ class VM
protected $config;
public $virtualMachine;
/**
* VM constructor.
* @param $config
*/
public function __construct($config)
{
$this->config = $config;

@ -51,7 +51,7 @@ class bbb
$bbb_salt = $salt;
}
$this->logout_url = api_get_path(WEB_PLUGIN_PATH).'bbb/listing.php?'.api_get_cidreq();
$this->logout_url = $this->getListingUrl();
$this->table = Database::get_main_table('plugin_bbb_meeting');
if ($bbb_plugin == true) {
@ -149,10 +149,10 @@ class bbb
error_log("create_meeting: $id ");
}
$meetingName = isset($params['meeting_name']) ? $params['meeting_name'] : api_get_course_id().'-'.api_get_session_id();
$welcomeMessage = isset($params['welcome_msg']) ? $params['welcome_msg'] : null;
$record = isset($params['record']) && $params['record'] ? 'true' : 'false';
$duration = isset($params['duration']) ? intval($params['duration']) : 0;
$meetingName = isset($params['meeting_name']) ? $params['meeting_name'] : api_get_course_id().'-'.api_get_session_id();
$welcomeMessage = isset($params['welcome_msg']) ? $params['welcome_msg'] : null;
$record = isset($params['record']) && $params['record'] ? 'true' : 'false';
$duration = isset($params['duration']) ? intval($params['duration']) : 0;
// This setting currently limits the maximum conference duration,
// to avoid lingering sessions on the video-conference server #6261
$duration = 300;
@ -184,8 +184,7 @@ class bbb
$result = $this->api->createMeetingWithXmlResponseArray(
$bbbParams
);
if (isset($result) && strval($result['returncode']) == 'SUCCESS'
) {
if (isset($result) && strval($result['returncode']) == 'SUCCESS') {
if ($this->debug) {
error_log(
"create_meeting result: " . print_r($result, 1)
@ -373,7 +372,18 @@ class bbb
public function getCourseMeetings()
{
$pass = $this->getUserMeetingPassword();
$meetingList = Database::select('*', $this->table, array('where' => array('c_id = ? AND session_id = ? ' => array(api_get_course_int_id(), api_get_session_id()))));
$meetingList = Database::select(
'*',
$this->table,
array(
'where' => array(
'c_id = ? AND session_id = ? ' => array(
api_get_course_int_id(),
api_get_session_id(),
),
),
)
);
$newMeetingList = array();
$item = array();
@ -395,14 +405,14 @@ class bbb
if ($meetingDB['visibility'] == 0 and $this->isTeacher() == false) {
continue;
}
$meetingBBB['end_url'] = api_get_self().'?'.api_get_cidreq().'&action=end&id='.$meetingDB['id'];
$meetingBBB['end_url'] = $this->endUrl($meetingDB);
if ((string)$meetingBBB['returncode'] == 'FAILED') {
if ($meetingDB['status'] == 1 && $this->isTeacher()) {
$this->endMeeting($meetingDB['id']);
}
} else {
$meetingBBB['add_to_calendar_url'] = api_get_self().'?'.api_get_cidreq().'&action=add_to_calendar&id='.$meetingDB['id'].'&start='.api_strtotime($meetingDB['created_at']);
$meetingBBB['add_to_calendar_url'] = $this->addToCalendarUrl($meetingDB);
}
$recordArray = array();
@ -438,9 +448,7 @@ class bbb
array(),
ICON_SIZE_MEDIUM
),
api_get_self().'?'.
api_get_cidreq().
'&action=publish&id='.$meetingDB['id']
$this->publishUrl($meetingDB)
);
} else {
$actionLinksArray[] = Display::url(
@ -450,9 +458,7 @@ class bbb
array(),
ICON_SIZE_MEDIUM
),
api_get_self().'?'.
api_get_cidreq().
'&action=unpublish&id='.$meetingDB['id']
$this->unPublishUrl($meetingDB)
);
}
} else {
@ -477,29 +483,21 @@ class bbb
'link.gif',
get_lang('CopyToLinkTool')
),
api_get_self().'?'.
api_get_cidreq().
'&action=copy_record_to_link_tool&id='.$meetingDB['id']
$this->copyToRecordToLinkTool($meetingDB)
);
$actionLinks .= Display::url(
Display::return_icon(
'agenda.png',
get_lang('AddToCalendar')
),
api_get_self().'?'.
api_get_cidreq().
'&action=add_to_calendar&id='.$meetingDB['id'].
'&start='.api_strtotime($meetingDB['created_at']).
'&url='.$record['playbackFormatUrl']
$this->addToCalendarUrl($meetingDB, $record)
);
$actionLinks .= Display::url(
Display::return_icon(
'delete.png',
get_lang('Delete')
),
api_get_self().'?'.
api_get_cidreq().
'&action=delete_record&id='.$meetingDB['id']
$this->deleteRecordUrl($meetingDB)
);
if ($meetingDB['visibility'] == 0) {
$actionLinks .= Display::url(
@ -509,9 +507,7 @@ class bbb
array(),
ICON_SIZE_MEDIUM
),
api_get_self().'?'.
api_get_cidreq().
'&action=publish&id='.$meetingDB['id']
$this->publishUrl($meetingDB)
);
} else {
$actionLinks .= Display::url(
@ -521,9 +517,7 @@ class bbb
array(),
ICON_SIZE_MEDIUM
),
api_get_self().'?'.
api_get_cidreq().
'&action=unpublish&id='.$meetingDB['id']
$this->unPublishUrl($meetingDB)
);
}
}
@ -565,9 +559,7 @@ class bbb
array(),
ICON_SIZE_MEDIUM
),
api_get_self().'?'.
api_get_cidreq().
'&action=publish&id='.$meetingDB['id']
$this->publishUrl($meetingDB)
);
} else {
$actionLinks .= Display::url(
@ -577,9 +569,7 @@ class bbb
array(),
ICON_SIZE_MEDIUM
),
api_get_self().'?'.
api_get_cidreq().
'&action=unpublish&id='.$meetingDB['id']
$this->unPublishUrl($meetingDB)
);
}
}
@ -595,8 +585,8 @@ class bbb
//created_at
$meetingDB['created_at'] = $item['created_at']; //avoid overwrite in array_merge() below
$item['publish_url'] = api_get_self().'?'.api_get_cidreq().'&action=publish&id='.$meetingDB['id'];
$item['unpublish_url'] = api_get_self().'?'.api_get_cidreq().'&action=unpublish&id='.$meetingDB['id'];
$item['publish_url'] = $this->publishUrl($meetingDB);
$item['unpublish_url'] = $this->unPublishUrl($meetingBBB);
if ($meetingDB['status'] == 1) {
$joinParams = array(
@ -612,6 +602,7 @@ class bbb
$item = array_merge($item, $meetingDB, $meetingBBB);
$newMeetingList[] = $item;
}
return $newMeetingList;
}
@ -622,10 +613,12 @@ class bbb
{
//return BigBlueButtonBN::setPublishRecordings($id, 'true', $this->url, $this->salt);
if (empty($id)) {
return false;
}
$id = intval($id);
Database::update($this->table, array('visibility' => 1), array('id = ? ' => $id));
return true;
}
@ -640,6 +633,7 @@ class bbb
}
$id = intval($id);
Database::update($this->table, array('visibility' => 0), array('id = ? ' => $id));
return true;
}
@ -663,7 +657,11 @@ class bbb
'password' => $pass, // REQUIRED - Must match moderator pass for meeting.
);
$this->api->endMeetingWithXmlResponseArray($endParams);
Database::update($this->table, array('status' => 0, 'closed_at' => api_get_utc_datetime()), array('id = ? ' => $id));
Database::update(
$this->table,
array('status' => 0, 'closed_at' => api_get_utc_datetime()),
array('id = ? ' => $id)
);
}
/**
@ -697,7 +695,12 @@ class bbb
{
$courseId = api_get_course_int_id();
$sessionId = api_get_session_id();
$meetingData = Database::select('*', $this->table, array('where' => array('c_id = ? AND session_id = ? AND status = 1 ' => array($courseId, $sessionId))), 'first');
$meetingData = Database::select(
'*',
$this->table,
array('where' => array('c_id = ? AND session_id = ? AND status = 1 ' => array($courseId, $sessionId))),
'first'
);
if (empty($meetingData)) {
return 0;
}
@ -786,7 +789,6 @@ class bbb
$records = $this->api->getRecordingsWithXmlResponseArray(array('meetingId' => $meetingData['remote_id']));
if (!empty($records)) {
$count = 1;
if (isset($records['message']) && !empty($records['message'])) {
if ($records['messageKey'] == 'noRecordings') {
$recordArray[] = get_lang('NoRecording');
@ -858,4 +860,77 @@ class bbb
echo '</script>';
exit;*/
}
/**
* @return string
*/
public function getConferenceUrl()
{
return api_get_path(WEB_PLUGIN_PATH).'bbb/start.php?launch=1&'.api_get_cidreq();
}
/**
* @return string
*/
public function getListingUrl()
{
return api_get_path(WEB_PLUGIN_PATH).'bbb/listing.php?'.api_get_cidreq();
}
/**
* @param array $meeting
* @return string
*/
public function endUrl($meeting)
{
return api_get_path(WEB_PLUGIN_PATH).'bbb/listing.php?'.api_get_cidreq().'&action=end&id='.$meeting['id'];
}
/**
* @param array $meeting
* @param array $record
* @return string
*/
public function addToCalendarUrl($meeting, $record = [])
{
$url = isset($record['playbackFormatUrl']) ? $record['playbackFormatUrl'] : '';
return api_get_path(WEB_PLUGIN_PATH).'bbb/listing.php?'.api_get_cidreq().'&action=add_to_calendar&id='.$meeting['id'].'&start='.api_strtotime($meeting['created_at']).'&url='.$url;
}
/**
* @param array $meeting
* @return string
*/
public function publishUrl($meeting)
{
return api_get_path(WEB_PLUGIN_PATH).'bbb/listing.php?'.api_get_cidreq().'&action=publish&id='.$meeting['id'];
}
/**
* @param array $meeting
* @return string
*/
public function unPublishUrl($meeting)
{
return api_get_path(WEB_PLUGIN_PATH).'bbb/listing.php?'.api_get_cidreq().'&action=unpublish&id='.$meeting['id'];
}
/**
* @param array $meeting
* @return string
*/
public function deleteRecordUrl($meeting)
{
return api_get_path(WEB_PLUGIN_PATH).'bbb/listing.php?'.api_get_cidreq().'&action=delete_record&id='.$meeting['id'];
}
/**
* @param array $meeting
* @return string
*/
public function copyToRecordToLinkTool($meeting)
{
return api_get_path(WEB_PLUGIN_PATH).'bbb/listing.php?'.api_get_cidreq().'&action=copy_record_to_link_tool&id='.$meeting['id'];
}
}

@ -24,17 +24,27 @@ class BBBPlugin extends Plugin
)
);
public static function create()
/**
* BBBPlugin constructor.
*/
protected function __construct()
{
static $result = null;
return $result ? $result : $result = new self();
parent::__construct(
'2.2',
'Julio Montoya, Yannick Warnier',
array('tool_enable' => 'boolean', 'host' => 'text', 'salt' => 'text')
);
}
protected function __construct()
public static function create()
{
parent::__construct('2.2', 'Julio Montoya, Yannick Warnier', array('tool_enable' => 'boolean', 'host' =>'text', 'salt' => 'text'));
static $result = null;
return $result ? $result : $result = new self();
}
/**
* Install
*/
public function install()
{
$table = Database::get_main_table('plugin_bbb_meeting');
@ -61,6 +71,9 @@ class BBBPlugin extends Plugin
$this->install_course_fields_in_all_courses();
}
/**
* Uninstall
*/
public function uninstall()
{
$t_settings = Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT);

@ -1,14 +1,12 @@
<?php
/**
* This script initiates a videoconference session, calling the BigBlueButton API
* This script initiates a video conference session, calling the BigBlueButton API
* @package chamilo.plugin.bigbluebutton
*/
/**
* Initialization
*/
$course_plugin = 'bbb'; //needed in order to load the plugin lang variables
require_once dirname(__FILE__).'/config.php';
require_once __DIR__.'/config.php';
$plugin = BBBPlugin::create();
$tool_name = $plugin->get_lang('Videoconference');
$tpl = new Template($tool_name);
@ -17,6 +15,7 @@ $bbb = new bbb();
$action = isset($_GET['action']) ? $_GET['action'] : null;
$teacher = $bbb->isTeacher();
$courseInfo = api_get_course_info();
api_protect_course_script(true);
$message = null;
@ -32,7 +31,7 @@ if ($teacher) {
$title = sprintf(get_lang('VideoConferenceXCourseX'), $id, $course_info['name']);
$content = Display::url(get_lang('GoToTheVideoConference'), $_GET['url']);
$event_id = $agenda->addEvent(
$eventId = $agenda->addEvent(
$_REQUEST['start'],
null,
'true',
@ -40,7 +39,7 @@ if ($teacher) {
$content,
array('everyone')
);
if (!empty($event_id)) {
if (!empty($eventId)) {
$message = Display::return_message(get_lang('VideoConferenceAddedToTheCalendar'), 'success');
} else {
$message = Display::return_message(get_lang('Error'), 'error');
@ -102,8 +101,8 @@ $meetings = $bbb->getCourseMeetings();
if (!empty($meetings)) {
$meetings = array_reverse($meetings);
}
$users_online = $bbb->getUsersOnlineInCurrentRoom();
$status = $bbb->isServerRunning();
$users_online = $bbb->getUsersOnlineInCurrentRoom();
$status = $bbb->isServerRunning();
$meeting_exists = $bbb->meetingExists(api_get_course_id().'-'.api_get_session_id());
$show_join_button = false;
if ($meeting_exists || $teacher) {
@ -112,13 +111,12 @@ if ($meeting_exists || $teacher) {
$tpl->assign('allow_to_edit', $teacher);
$tpl->assign('meetings', $meetings);
$conferenceUrl = api_get_path(WEB_PLUGIN_PATH).'bbb/start.php?launch=1&'.api_get_cidreq();
$conferenceUrl = $bbb->getConferenceUrl();
$tpl->assign('conference_url', $conferenceUrl);
$tpl->assign('users_online', $users_online);
$tpl->assign('bbb_status', $status);
$tpl->assign('show_join_button', $show_join_button);
//$tpl->assign('actions', $actions);
$tpl->assign('message', $message);
$listing_tpl = 'bbb/listing.tpl';
$content = $tpl->fetch($listing_tpl);

@ -1,5 +1,5 @@
<?php
require_once dirname(__FILE__).'/config.php';
require_once __DIR__.'/config.php';
$plugin_info = BBBPlugin::create()->get_info();

@ -1 +1,2 @@
This plugin will create a link in existing and new courses for the teachers to start a videoconference room, as well as the administration settings to configure this tool.
This plugin will create a link in existing and new courses for the teachers to start a videoconference room,
as well as the administration settings to configure this tool.

@ -1,5 +1,4 @@
<?php
/**
* This script initiates a video conference session, calling the BigBlueButton API
* @package chamilo.plugin.bigbluebutton
@ -8,7 +7,7 @@
require __DIR__ . '/../../vendor/autoload.php';
$course_plugin = 'bbb'; //needed in order to load the plugin lang variables
require_once dirname(__FILE__).'/config.php';
require_once __DIR__.'/config.php';
$tool_name = get_lang('Videoconference');
$tpl = new Template($tool_name);
@ -16,8 +15,6 @@ $tpl = new Template($tool_name);
$vmIsEnabled = false;
$host = null;
$salt = null;
$bbb = new bbb();
if ($bbb->plugin_enabled) {
@ -64,12 +61,12 @@ if ($bbb->plugin_enabled) {
$url = $bbb->createMeeting($meeting_params);
$bbb->redirectToBBB($url);
} else {
$url = 'listing.php?'.api_get_cidreq();
$url = $bbb->getListingUrl();
$bbb->redirectToBBB($url);
}
}
} else {
$url = 'listing.php?'.api_get_cidreq();
$url = $bbb->getListingUrl();
header('Location: ' . $url);
exit;
}

@ -1,13 +1,10 @@
<?php
/**
* This script is included by main/admin/settings.lib.php when unselecting a plugin
* and is meant to remove things installed by the install.php script in both
* the global database and the courses tables
* @package chamilo.plugin.bigbluebutton
*/
/**
* Queries
*/
require_once dirname(__FILE__).'/config.php';
require_once __DIR__.'/config.php';
BBBPlugin::create()->uninstall();
Loading…
Cancel
Save