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:
samhemelryk 2009-09-24 02:30:56 +00:00
parent 1e2134eb10
commit 3468eb2a68

View File

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