mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-56656 messages: Proper multilang formating in messaging pages
This commit is contained in:
parent
873a7e1e86
commit
7597ab0b99
@ -56,9 +56,9 @@ class user_search_results implements templatable, renderable {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param array $contacts
|
||||
* @param array $courses
|
||||
* @param array $noncontacts
|
||||
* @param array $contacts list of contacts.
|
||||
* @param array $courses list of courses.
|
||||
* @param array $noncontacts list of nonconcat users.
|
||||
*/
|
||||
public function __construct($contacts, $courses = array(), $noncontacts = array()) {
|
||||
$this->contacts = $contacts;
|
||||
@ -88,7 +88,13 @@ class user_search_results implements templatable, renderable {
|
||||
// Check if there are any courses.
|
||||
if (!empty($this->courses)) {
|
||||
$data->hascourses = true;
|
||||
$data->courses = $this->courses;
|
||||
$data->courses = [];
|
||||
foreach ($this->courses as $course) {
|
||||
$coursecontext = \context_course::instance($course->id);
|
||||
$course->shortname = external_format_string($course->shortname, $coursecontext->id, true);
|
||||
$course->fullname = external_format_string($course->fullname, $coursecontext->id, true);
|
||||
$data->courses[] = $course;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if there are any non-contacts.
|
||||
|
@ -670,8 +670,8 @@ class core_message_external extends external_api {
|
||||
new external_single_structure(
|
||||
array(
|
||||
'id' => new external_value(PARAM_INT, 'The course id'),
|
||||
'shortname' => new external_value(PARAM_NOTAGS, 'The course shortname'),
|
||||
'fullname' => new external_value(PARAM_NOTAGS, 'The course fullname'),
|
||||
'shortname' => new external_value(PARAM_TEXT, 'The course shortname'),
|
||||
'fullname' => new external_value(PARAM_TEXT, 'The course fullname'),
|
||||
)
|
||||
)
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user