mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
Merge branch 'MDL-80809' of https://github.com/paulholden/moodle
This commit is contained in:
commit
5f3729eb63
1 changed files with 3 additions and 5 deletions
|
@ -52,9 +52,7 @@ class content_notification_task extends adhoc_task {
|
||||||
|
|
||||||
// Get only active users.
|
// Get only active users.
|
||||||
$coursecontext = \context_course::instance($course->id);
|
$coursecontext = \context_course::instance($course->id);
|
||||||
$modcontext = \context_module::instance($cm->id);
|
|
||||||
$users = get_enrolled_users($coursecontext, '', 0, 'u.*', null, 0, 0, true);
|
$users = get_enrolled_users($coursecontext, '', 0, 'u.*', null, 0, 0, true);
|
||||||
|
|
||||||
if (empty($users)) {
|
if (empty($users)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -80,9 +78,9 @@ class content_notification_task extends adhoc_task {
|
||||||
// Get module names in the user's language.
|
// Get module names in the user's language.
|
||||||
$modnames = get_module_types_names();
|
$modnames = get_module_types_names();
|
||||||
$a = [
|
$a = [
|
||||||
'coursename' => format_string(get_course_display_name_for_list($course), true, ['context' => $modcontext]),
|
'coursename' => format_string(get_course_display_name_for_list($course), true, ['context' => $coursecontext]),
|
||||||
'courselink' => (new \moodle_url('/course/view.php', ['id' => $course->id]))->out(false),
|
'courselink' => (new \moodle_url('/course/view.php', ['id' => $course->id]))->out(false),
|
||||||
'modulename' => format_string($cm->name, $modcontext->id),
|
'modulename' => $cm->get_formatted_name(),
|
||||||
'moduletypename' => $modnames[$cm->modname],
|
'moduletypename' => $modnames[$cm->modname],
|
||||||
'link' => (new \moodle_url('/mod/' . $cm->modname . '/view.php', ['id' => $cm->id]))->out(false),
|
'link' => (new \moodle_url('/mod/' . $cm->modname . '/view.php', ['id' => $cm->id]))->out(false),
|
||||||
'notificationpreferenceslink' =>
|
'notificationpreferenceslink' =>
|
||||||
|
@ -109,7 +107,7 @@ class content_notification_task extends adhoc_task {
|
||||||
$eventdata->fullmessagehtml = $messagebody;
|
$eventdata->fullmessagehtml = $messagebody;
|
||||||
$eventdata->smallmessage = strip_tags($eventdata->fullmessagehtml);
|
$eventdata->smallmessage = strip_tags($eventdata->fullmessagehtml);
|
||||||
$eventdata->contexturl = (new \moodle_url('/mod/' . $cm->modname . '/view.php', ['id' => $cm->id]))->out(false);
|
$eventdata->contexturl = (new \moodle_url('/mod/' . $cm->modname . '/view.php', ['id' => $cm->id]))->out(false);
|
||||||
$eventdata->contexturlname = $cm->name;
|
$eventdata->contexturlname = $cm->get_formatted_name();
|
||||||
$eventdata->notification = 1;
|
$eventdata->notification = 1;
|
||||||
|
|
||||||
// Add notification custom data.
|
// Add notification custom data.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue