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.
This commit is contained in:
Sara Arjona 2022-03-10 17:02:46 +01:00
parent 01eb6d2e9b
commit d60e802006

View File

@ -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);
}
/**