Пример #1
0
 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()) {
                 $url = $bbb->create_meeting($meeting_params);
                 header('location: ' . $url);
                 exit;
             } else {
                 $url = 'listing.php';
                 header('location: ' . $url);
                 exit;
             }
         }
     } else {
         $url = 'listing.php';
         header('location: ' . $url);
         exit;
     }
 } else {
Пример #2
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';
$plugin = BBBPlugin::create();
$tool_name = $plugin->get_lang('Videoconference');
$tpl = $app['template'];
$bbb = new bbb();
$action = isset($_GET['action']) ? $_GET['action'] : null;
$teacher = $bbb->is_teacher();
api_protect_course_script(true);
$message = null;
if ($teacher) {
    switch ($action) {
        case 'add_to_calendar':
            $course_info = api_get_course_info();
            $agenda = new Agenda();
            $agenda->type = 'course';
            $id = intval($_GET['id']);
            $title = sprintf(get_lang('VideoConferenceXCourseX'), $id, $course_info['name']);
            $content = Display::url(get_lang('GoToTheVideoConference'), $_GET['url']);
            $event_id = $agenda->add_event($_REQUEST['start'], null, 'true', null, $title, $content, array('everyone'));
            if (!empty($event_id)) {
                $message = Display::return_message(get_lang('VideoConferenceAddedToTheCalendar'), 'success');
            } else {