From d60e8020068ae5f603181701be294d83db33a7e2 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Thu, 10 Mar 2022 17:02:46 +0100 Subject: [PATCH] MDL-74159 output: Add icon near docs link An icon has been added near the 'Help and documentation' link in the site footer When the site admin setting 'Open in new window' (doctonewwindow) is enabled, for consistency with other similar links like 'Give feedback about this software'. Apart from that, now the link will be opened using the standard target '_blank' instead of using the new window Javascript, to let users decide whether the new page should be opened in a new tab or a new window. --- lib/outputrenderers.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 461d994c503..408122ffd18 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -2264,11 +2264,14 @@ class core_renderer extends renderer_base { $icon = $this->pix_icon('book', '', 'moodle', array('class' => 'iconhelp icon-pre', 'role' => 'presentation')); $attributes['href'] = new moodle_url(get_docs_url($path)); + $newwindowicon = ''; if (!empty($CFG->doctonewwindow) || $forcepopup) { - $attributes['class'] = 'helplinkpopup'; + $attributes['target'] = '_blank'; + $newwindowicon = $this->pix_icon('i/externallink', get_string('opensinnewwindow'), 'moodle', + ['class' => 'fa fa-externallink fa-fw']); } - return html_writer::tag('a', $icon.$text, $attributes); + return html_writer::tag('a', $icon . $text . $newwindowicon, $attributes); } /**