From 65ffd0a33a188a2515e0ed5cf0896f950199353b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 13 Nov 2018 12:09:03 +0100 Subject: [PATCH 1/2] MDL-63991 badges: Fix links on badge render --- badges/renderer.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/badges/renderer.php b/badges/renderer.php index 5810e572d61..d7c31e1033a 100644 --- a/badges/renderer.php +++ b/badges/renderer.php @@ -150,8 +150,7 @@ class core_badges_renderer extends plugin_renderer_base { $dl[get_string('description', 'badges')] = $badge->description; $dl[get_string('createdon', 'search')] = userdate($badge->timecreated); $dl[get_string('badgeimage', 'badges')] = print_badge_image($badge, $context, 'large'); - $dl[get_string('imageauthorname', 'badges')] = - html_writer::link($badge->imageauthorname, $badge->imageauthorname, array('target' => '_blank')); + $dl[get_string('imageauthorname', 'badges')] = $badge->imageauthorname; $dl[get_string('imageauthoremail', 'badges')] = html_writer::tag('a', $badge->imageauthoremail, array('href' => 'mailto:' . $badge->imageauthoremail)); $dl[get_string('imageauthorurl', 'badges')] = @@ -352,8 +351,7 @@ class core_badges_renderer extends plugin_renderer_base { $dl[get_string('version', 'badges')] = $badge->version; $dl[get_string('language')] = $languages[$badge->language]; $dl[get_string('description', 'badges')] = $badge->description; - $dl[get_string('imageauthorname', 'badges')] = - html_writer::link($badge->imageauthorname, $badge->imageauthorname, array('target' => '_blank')); + $dl[get_string('imageauthorname', 'badges')] = $badge->imageauthorname; $dl[get_string('imageauthoremail', 'badges')] = html_writer::tag('a', $badge->imageauthoremail, array('href' => 'mailto:' . $badge->imageauthoremail)); $dl[get_string('imageauthorurl', 'badges')] = @@ -1048,7 +1046,8 @@ class core_badges_renderer extends plugin_renderer_base { $output .= $this->heading(get_string('endorsement', 'badges'), 3); if (!empty($endorsement)) { $dl[get_string('issuername', 'badges')] = $endorsement->issuername; - $dl[get_string('issueremail', 'badges')] = $endorsement->issueremail; + $dl[get_string('issueremail', 'badges')] = + html_writer::tag('a', $endorsement->issueremail, array('href' => 'mailto:' . $endorsement->issueremail)); $dl[get_string('issuerurl', 'badges')] = html_writer::link($endorsement->issuerurl, $endorsement->issuerurl, array('target' => '_blank')); $dl[get_string('dateawarded', 'badges')] = date('c', $endorsement->dateissued); From f687f1459eda6269e19886ad9ce9dd461c7bd639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 13 Nov 2018 15:51:53 +0100 Subject: [PATCH 2/2] MDL-63991 badges: Translate notification on endorsement --- badges/endorsement.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/badges/endorsement.php b/badges/endorsement.php index ec3e145a0f4..d7b2345d62a 100644 --- a/badges/endorsement.php +++ b/badges/endorsement.php @@ -63,6 +63,10 @@ $output = $PAGE->get_renderer('core', 'badges'); $msg = optional_param('msg', '', PARAM_TEXT); $emsg = optional_param('emsg', '', PARAM_TEXT); +if ($msg !== '') { + $msg = get_string($msg, 'badges'); +} + echo $OUTPUT->header(); echo $OUTPUT->heading(print_badge_image($badge, $context, 'small') . ' ' . $badge->name);