示例#1
0
/**
 * Trigger user_list_viewed event.
 *
 * @param stdClass  $course course  object
 * @param stdClass  $context course context object
 * @since Moodle 2.9
 */
function user_list_view($course, $context)
{
    $event = \core\event\user_list_viewed::create(array('objectid' => $course->id, 'courseid' => $course->id, 'context' => $context, 'other' => array('courseshortname' => $course->shortname, 'coursefullname' => $course->fullname)));
    $event->trigger();
}
示例#2
0
文件: index.php 项目: covex-nn/moodle
    $rolenames[0] = get_string('allparticipants');
}
// make sure other roles may not be selected by any means
if (empty($rolenames[$roleid])) {
    print_error('noparticipants');
}
// no roles to display yet?
// frontpage course is an exception, on the front page course we should display all users
if (empty($rolenames) && !$isfrontpage) {
    if (has_capability('moodle/role:assign', $context)) {
        redirect($CFG->wwwroot . '/' . $CFG->admin . '/roles/assign.php?contextid=' . $context->id);
    } else {
        print_error('noparticipants');
    }
}
$event = \core\event\user_list_viewed::create(array('context' => $context, 'objectid' => $course->id, 'other' => array('courseid' => $course->id, 'courseshortname' => $course->shortname, 'coursefullname' => $course->fullname)));
$event->trigger();
$bulkoperations = has_capability('moodle/course:bulkmessaging', $context);
$countries = get_string_manager()->get_list_of_countries();
$strnever = get_string('never');
$datestring = new stdClass();
$datestring->year = get_string('year');
$datestring->years = get_string('years');
$datestring->day = get_string('day');
$datestring->days = get_string('days');
$datestring->hour = get_string('hour');
$datestring->hours = get_string('hours');
$datestring->min = get_string('min');
$datestring->mins = get_string('mins');
$datestring->sec = get_string('sec');
$datestring->secs = get_string('secs');