mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-34160 mod_forum: Add extra site and course vars to postmailsubject
This commit is contained in:
parent
2f45a11ac4
commit
091420f9e6
@ -378,6 +378,26 @@ class forum_post implements \renderable {
|
||||
return 'p' . $this->post->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* ID number of the course that the forum is in.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_courseidnumber() {
|
||||
return s($this->course->idnumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* The full name of the course that the forum is in.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_coursefullname() {
|
||||
return format_string($this->course->fullname, true, array(
|
||||
'context' => \context_course::instance($this->course->id),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the course that the forum is in.
|
||||
*
|
||||
|
@ -801,10 +801,16 @@ function forum_cron() {
|
||||
$data->viewfullnames = $userto->viewfullnames[$forum->id];
|
||||
}
|
||||
|
||||
// Not all of these variables are used in the default language
|
||||
// string but are made available to support custom subjects.
|
||||
$a = new stdClass();
|
||||
$a->courseshortname = $data->get_coursename();
|
||||
$a->forumname = $cleanforumname;
|
||||
$a->subject = $data->get_subject();
|
||||
$a->forumname = $cleanforumname;
|
||||
$a->sitefullname = format_string($site->fullname);
|
||||
$a->siteshortname = format_string($site->shortname);
|
||||
$a->courseidnumber = $data->get_courseidnumber();
|
||||
$a->coursefullname = $data->get_coursefullname();
|
||||
$a->courseshortname = $data->get_coursename();
|
||||
$postsubject = html_to_text(get_string('postmailsubject', 'forum', $a), 0);
|
||||
|
||||
// Send the post now!
|
||||
|
Loading…
x
Reference in New Issue
Block a user