MDL-79283 core: add title to embedded iframe, for accessibility.

This commit is contained in:
Paul Holden 2023-09-06 16:07:44 +01:00
parent d1bc94905e
commit 00d7ed9518
No known key found for this signature in database
GPG Key ID: A81A96D6045F6164

View File

@ -262,13 +262,13 @@ function resourcelib_embed_general($fullurl, $title, $clicktoopen, $mimetype) {
$fullurl = $fullurl->out();
}
$param = '<param name="src" value="'.$fullurl.'" />';
$title = s($title);
// Always use iframe embedding because object tag does not work much,
// this is ok in HTML5.
$code = <<<EOT
<div class="resourcecontent resourcegeneral">
<iframe id="resourceobject" src="$fullurl">
<iframe id="resourceobject" src="$fullurl" title="$title">
$clicktoopen
</iframe>
</div>