function elluminate_set_meeting($meeting, $start, $end, $name, $facilitator, $password, $sessiontype, $seats, $boundaryTime, $maxTalkers, $recordingModeType, $cmid = '', $creatorid = '') { global $USER; global $CFG; $args = array(); $i = 0; if (!empty($meeting)) { $args[0]['name'] = 'meetingId'; $args[0]['value'] = $meeting; $args[0]['type'] = 'xsd:integer'; } if (empty($creatorid)) { $args[1]['name'] = 'creatorId'; $args[1]['value'] = $USER->id; $args[1]['type'] = 'xsd:string'; } else { $args[1]['name'] = 'creatorId'; $args[1]['value'] = $creatorid; $args[1]['type'] = 'xsd:string'; } $args[2]['name'] = 'startTime'; $args[2]['value'] = $start . '000'; $args[2]['type'] = 'xsd:long'; $args[3]['name'] = 'endTime'; $args[3]['value'] = $end . '000'; $args[3]['type'] = 'xsd:long'; $args[4]['name'] = 'name'; $args[4]['value'] = $name; $args[4]['type'] = 'xsd:string'; $args[5]['name'] = 'reserveSeats'; $args[5]['value'] = $seats; $args[5]['type'] = 'xsd:integer'; $currChairList = ''; if (!empty($meeting)) { if ($meeting != '') { if ($sessiontype == 1) { $moderators = elluminate_get_meeting_participants($meeting, '', true); foreach ($moderators as $moderator) { if ($currChairList == '') { $currChairList = $moderator->id; } else { $currChairList = $currChairList . ',' . $moderator->id; } } } } else { if ($CFG->elluminate_pre_populate_moderators == 1) { $moderators = elluminate_get_course_moderators($cmid); foreach ($moderators as $moderator) { if ($currChairList == '') { $currChairList = $moderator->id; } else { $currChairList = $currChairList . ',' . $moderator->id; } } } else { if (empty($creatorid)) { $currChairList = $USER->id; } else { $currChairList = $creatorid; } } } } else { if ($CFG->elluminate_pre_populate_moderators == 1) { $moderators = elluminate_get_course_moderators($cmid); foreach ($moderators as $moderator) { if ($currChairList == '') { $currChairList = $moderator->id; } else { $currChairList = $currChairList . ',' . $moderator->id; } } } else { if (empty($creatorid)) { $currChairList = $USER->id; } else { $currChairList = $creatorid; } } } $args[6]['name'] = 'chairList'; $args[6]['value'] = $currChairList; $args[6]['type'] = 'xsd:string'; $args[7]['name'] = 'boundaryTime'; $args[7]['value'] = $boundaryTime; $args[7]['type'] = 'xsd:integer'; $args[8]['name'] = 'recordingModeType'; $args[8]['value'] = $recordingModeType; $args[8]['type'] = 'xsd:integer'; $args[9]['name'] = 'mustBeSupervised'; if ($CFG->elluminate_must_be_supervised == 1) { $args[9]['value'] = true; } else { $args[9]['value'] = false; } $args[9]['type'] = 'xsd:boolean'; $args[10]['name'] = 'raiseHandOnEnter'; if ($CFG->elluminate_raise_hand == 1) { $args[10]['value'] = true; } else { $args[10]['value'] = false; } $args[10]['type'] = 'xsd:boolean'; $args[11]['name'] = 'permissionsOn'; if ($CFG->elluminate_permissions_on == 1) { $args[11]['value'] = true; } else { $args[11]['value'] = false; } $args[11]['type'] = 'xsd:boolean'; $args[12]['name'] = 'openChair'; if ($CFG->elluminate_all_moderators == 1) { $args[12]['value'] = true; } else { $args[12]['value'] = false; } $args[12]['type'] = 'xsd:boolean'; $args[13]['name'] = 'maxTalkers'; $args[13]['value'] = $maxTalkers; $args[13]['type'] = 'xsd:integer'; $result = elluminate_send_command('setMeeting', $args); if (is_string($result)) { return false; } else { if (is_object($result)) { return $result; } } return false; }
} } } /// Get a list of existing moderators for this meeting (if any) and assosciated /// information. $curmods = elluminate_get_meeting_participants($elluminate->id, true); $modsexist = array(); if (!empty($curmods)) { foreach ($curmods as $curmod) { $modsexist[] = $curmod->id; } reset($curmods); } /// Get a list of existing participants for this meeting (if any) and assosciated /// information. $curusers = elluminate_get_meeting_participants($elluminate->id); if (!empty($curusers)) { foreach ($curusers as $curuser) { $modsexist[] = $curuser->id; } } /// Available moderators are teachers in this course who have an account on the /// Elluminate server. $allmods = elive_get_users_by_capability($modcontext, 'mod/elluminate:moderatemeeting', 'u.id, u.firstname, u.lastname, u.username', 'u.lastname, u.firstname', '', '', '', '', false); $ausers = array_keys($allmods); // if groupmembersonly used, only include members of the appropriate groups. if ($allmods and !empty($CFG->enablegroupings) and $cm->groupmembersonly) { if ($groupingusers = groups_get_grouping_members($cm->groupingid, 'u.id', 'u.id')) { $ausers = array_intersect($ausers, array_keys($groupingusers)); } }