Пример #1
0
 * @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 = new Template($tool_name);

$bbb = new bbb();
$action = isset($_GET['action']) ? $_GET['action'] : null;

$teacher = $bbb->isTeacher();

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']);
Пример #2
0
                     exit;
                 }
             }
         }
         $meeting_params = array();
         $meeting_params['meeting_name'] = api_get_course_id() . '-' . api_get_session_id();
         if ($bbb->meetingExists($meeting_params['meeting_name'])) {
             $url = $bbb->joinMeeting($meeting_params['meeting_name']);
             if ($url) {
                 $bbb->redirectToBBB($url);
             } else {
                 $url = $bbb->createMeeting($meeting_params);
                 $bbb->redirectToBBB($url);
             }
         } else {
             if ($bbb->isTeacher()) {
                 $url = $bbb->createMeeting($meeting_params);
                 $bbb->redirectToBBB($url);
             } else {
                 $url = 'listing.php?' . api_get_cidreq();
                 $bbb->redirectToBBB($url);
             }
         }
     } else {
         $url = 'listing.php?' . api_get_cidreq();
         header('Location: ' . $url);
         exit;
     }
 } else {
     $message = Display::return_message(get_lang('ServerIsNotRunning'), 'warning');
 }