Ejemplo n.º 1
0
/**
 * This script initiates a videoconference 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';
$tool_name = get_lang('Videoconference');
$app['title'] = $tool_name;
$tpl = $app['template'];
$bbb = new bbb();
if ($bbb->plugin_enabled) {
    if ($bbb->is_server_running()) {
        if (isset($_GET['launch']) && $_GET['launch'] == 1) {
            $meeting_params = array();
            $meeting_params['meeting_name'] = api_get_course_id();
            if ($bbb->meeting_exists($meeting_params['meeting_name'])) {
                $url = $bbb->join_meeting($meeting_params['meeting_name']);
                if ($url) {
                    header('location: ' . $url);
                    exit;
                } else {
                    $url = $bbb->create_meeting($meeting_params);
                    header('location: ' . $url);
                    exit;
                }
            } else {
                if ($bbb->is_teacher()) {
Ejemplo n.º 2
0
        case 'publish':
            //$result = $bbb->publish_meeting($_GET['id']);
            break;
        case 'unpublish':
            //$result = $bbb->unpublish_meeting($_GET['id']);
            break;
        default:
            break;
    }
}
$meetings = $bbb->get_course_meetings();
if (!empty($meetings)) {
    $meetings = array_reverse($meetings);
}
$users_online = $bbb->get_users_online_in_current_room();
$status = $bbb->is_server_running();
$meeting_exists = $bbb->meeting_exists(api_get_course_id());
$show_join_button = false;
if ($meeting_exists || $teacher) {
    $show_join_button = true;
}
$tpl->assign('allow_to_edit', $teacher);
$tpl->assign('meetings', $meetings);
$conference_url = api_get_path(WEB_PLUGIN_PATH) . 'bbb/start.php?launch=1&' . api_get_cidreq();
$tpl->assign('conference_url', $conference_url);
$tpl->assign('users_online', $users_online);
$tpl->assign('bbb_status', $status);
$tpl->assign('show_join_button', $show_join_button);
$tpl->assign('message', $message);
$listing_tpl = 'bbb/listing.tpl';
$content = $tpl->fetch($listing_tpl);