if (isset($data->descsave) && !empty($data->recordingid) && ($canmanageanyrecordings || $canmanagerecordings)) { if ($recording = $DB->get_record('elluminate_recordings', array('id' => $data->recordingid))) { $recording->description = $data->recordingdesc; if (!$DB->update_record('elluminate_recordings', $recording)) { debugging('Unable to edit recording description!'); } } } } /// Handle a request to delete a recording. if (!empty($delrecording) && ($candeleteanyrecordings || $candeleterecordings && $elluminate->creator == $USER->id)) { if (!($recording = $DB->get_record('elluminate_recordings', array('id' => $delrecording)))) { print_error('Could not find meeting recording record'); } if (optional_param('confirm', '', PARAM_ALPHANUM) == $sesskey) { if (elluminate_delete_recording($recording->recordingid)) { redirect($CFG->wwwroot . '/mod/elluminate/view.php?id=' . $cm->id . '&group=' . $elluminate->groupid, get_string('deleterecordingsuccess', 'elluminate'), 4); } else { redirect($CFG->wwwroot . '/mod/elluminate/view.php?id=' . $cm->id . '&group=' . $elluminate->groupid, get_string('deleterecordingfailure', 'elluminate'), 4); } } else { echo $OUTPUT->confirm(get_string('deleterecordingconfirm', 'elluminate', userdate($recording->created)), $CFG->wwwroot . '/mod/elluminate/view.php?id=' . $cm->id . '&delrecording=' . $recording->id . '&confirm=' . $sesskey . '&group=' . $elluminate->groupid, $CFG->wwwroot . '/mod/elluminate/view.php?id=' . $cm->id . '&group=' . $elluminate->groupid); } echo $OUTPUT->box_end(); echo $OUTPUT->footer($course); exit; } /// Hide a recording. if (!empty($hiderecording) && ($canmanageanyrecordings || $canmanagerecordings)) { if ($recording = $DB->get_record('elluminate_recordings', array('id' => $hiderecording))) { $recording->visible = 0;
function elluminate_check_for_orphaned_group_records($elluminate) { global $DB; $group_meetings = $DB->get_records('elluminate', array('groupparentid' => $elluminate->id)); foreach ($group_meetings as $group_meeting) { $DB->delete_records('elluminate_attendance', array('elluminateid' => $group_meeting->id)); elluminate_grade_item_delete($group_meeting); if (!empty($group_meeting->meetingid)) { elluminate_delete_meeting($group_meeting->meetingid); } if (!empty($group_meeting->meetingid)) { $group_recordings = $DB->get_records('elluminate_recordings', array('meetingid' => $group_meeting->meetingid)); foreach ($group_recordings as $group_recording) { elluminate_delete_recording($group_recording->recordingid); } $DB->delete_records('elluminate_recordings', array('meetingid' => $group_meeting->meetingid)); } $DB->delete_records('elluminate', array('id' => $group_meeting->id)); } if (!empty($elluminate->meetingid)) { $group_recordings = $DB->get_records('elluminate_recordings', array('meetingid' => $elluminate->meetingid)); foreach ($group_recordings as $group_recording) { elluminate_delete_recording($group_recording->recordingid); } elluminate_delete_meeting($elluminate->meetingid); } }
function elluminate_check_for_orphaned_group_records($elluminate) { $group_meetings = get_records('elluminate', 'groupparentid', $elluminate->id); foreach ($group_meetings as $group_meeting) { delete_records('elluminate_attendance', 'elluminateid', $group_meeting->id); elluminate_grade_item_delete($group_meeting); if (!empty($group_meeting->meetingid)) { elluminate_delete_meeting($group_meeting->meetingid); } if (!empty($group_meeting->meetingid)) { $group_recordings = get_records('elluminate_recordings', 'meetingid', $group_meeting->meetingid); foreach ($group_recordings as $group_recording) { elluminate_delete_recording($group_recording->recordingid); } delete_records('elluminate_recordings', 'meetingid', $group_meeting->meetingid); } delete_records('elluminate', 'id', $group_meeting->id); } if (!empty($elluminate->meetingid)) { $group_recordings = get_records('elluminate_recordings', 'meetingid', $elluminate->meetingid); foreach ($group_recordings as $group_recording) { elluminate_delete_recording($group_recording->recordingid); } elluminate_delete_meeting($elluminate->meetingid); } }