コード例 #1
0
ファイル: lib.php プロジェクト: ndunand/moodle-mod_opencast
/**
 * mod_opencast cron
 *
 * @return true
 */
function opencast_cron()
{
    mtrace('mod_opencast: processing uploaded clips');
    mod_opencast_series::processUploadedClips();
    return true;
}
コード例 #2
0
ファイル: view.php プロジェクト: ndunand/moodle-mod_opencast
}
$return_course = new moodle_url('/course/view.php', ['id' => $course->id]);
require_course_login($course, false, $cm);
if (!($opencast = opencast_get_opencast($cm->instance))) {
    print_error('invalidcoursemodule', null, $return_course);
}
if (!($context = context_module::instance($cm->id))) {
    print_error('badcontext', null, $return_course);
}
if (!in_array($opencast->organization_domain, mod_opencast_series::getEnabledOrgnanizations())) {
    // TODO remove as we're now only using local org (i.e. unil.ch for us)
    //    print_error('badorganization', 'opencast', $return_course);
}
$PAGE->set_title(format_string($opencast->name));
$PAGE->set_heading($course->fullname);
/// Mark as viewed
$completion = new completion_info($course);
$completion->set_module_viewed($cm);
$eventparams = ['context' => $context, 'objectid' => $opencast->id];
$event = \mod_opencast\event\course_module_viewed::create($eventparams);
$event->add_record_snapshot('course_modules', $cm);
$event->add_record_snapshot('course', $course);
$event->add_record_snapshot('opencast', $opencast);
$event->trigger();
$allclips = [];
echo $OUTPUT->header();
$renderer = $PAGE->get_renderer('mod_opencast');
$renderer->display_channel_content();
echo $OUTPUT->footer();
mod_opencast_series::processUploadedClips();