mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
output MDL-20327 Made moodle_core_renderer::link set a target attribute if CFG->frametarget is not empty
This only occurs if the administrator sets the frame name setting for Moodle to something other than default _top or if frametarget has been overriden manually
This commit is contained in:
parent
1e2134eb10
commit
3468eb2a68
@ -1054,6 +1054,8 @@ class moodle_core_renderer extends moodle_renderer_base {
|
||||
* @return string HTML fragment
|
||||
*/
|
||||
public function link($link, $text=null) {
|
||||
global $CFG;
|
||||
|
||||
$attributes = array();
|
||||
|
||||
if (is_a($link, 'html_link')) {
|
||||
@ -1085,6 +1087,10 @@ class moodle_core_renderer extends moodle_renderer_base {
|
||||
$attributes['href'] = prepare_url($link);
|
||||
}
|
||||
|
||||
if (!empty($CFG->frametarget)) {
|
||||
$attributes['target'] = $CFG->framename;
|
||||
}
|
||||
|
||||
return $this->output_tag('a', $attributes, $text);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user