Commit 5ce14ec2 authored by Dan Poltawski's avatar Dan Poltawski
Browse files

Merge branch 'MDL-52338' of https://github.com/dg711/moodle

parents a8b33e8e f58c96f6
......@@ -325,7 +325,7 @@ class block_course_overview_renderer extends plugin_renderer_base {
* @return string html string for welcome area.
*/
public function welcome_area($msgcount) {
global $USER;
global $CFG, $USER;
$output = $this->output->box_start('welcome_area');
$picture = $this->output->user_picture($USER, array('size' => 75, 'class' => 'welcome_userpicture'));
......@@ -334,16 +334,19 @@ class block_course_overview_renderer extends plugin_renderer_base {
$output .= $this->output->box_start('welcome_message');
$output .= $this->output->heading(get_string('welcome', 'block_course_overview', $USER->firstname));
$plural = 's';
if ($msgcount > 0) {
$output .= get_string('youhavemessages', 'block_course_overview', $msgcount);
if ($msgcount == 1) {
$plural = '';
if (!empty($CFG->messaging)) {
$plural = 's';
if ($msgcount > 0) {
$output .= get_string('youhavemessages', 'block_course_overview', $msgcount);
if ($msgcount == 1) {
$plural = '';
}
} else {
$output .= get_string('youhavenomessages', 'block_course_overview');
}
} else {
$output .= get_string('youhavenomessages', 'block_course_overview');
$output .= html_writer::link(new moodle_url('/message/index.php'),
get_string('message'.$plural, 'block_course_overview'));
}
$output .= html_writer::link(new moodle_url('/message/index.php'), get_string('message'.$plural, 'block_course_overview'));
$output .= $this->output->box_end();
$output .= $this->output->box('', 'flush');
$output .= $this->output->box_end();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment