From e0af42ef0f396f1b980efc8d7be6f50e5f336810 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Thu, 8 Mar 2007 07:49:33 +0000 Subject: [PATCH] Converted embedded media files (avi, wmv and mov) to xhtml strict compliance. However, this is far from finished, since some browsers are not displaying correctly.
Browsers
File FF 1.5 FF 2.0 IE 1.5 IE 1.6 IE 1.7 Safari 2.0 Opera 9.10 Konqueror
AVI (800x600) ? ? ? ? ? ? ? ?
AVI (300x200) ? OK (pb with size) ? OK OK OK OK ?
WMV (800x600) ? OK ? OK OK NO OK ?
WMV (300x200) ? OK (pb with size) ? OK OK OK OK ?
MOV (800x600) ? OK ? OK OK NO OK ?
MOV (300x200) ? OK ? OK OK NO OK ?
--- mod/resource/type/file/resource.class.php | 67 +++++++++++++---------- theme/standard/styles_layout.css | 5 ++ 2 files changed, 44 insertions(+), 28 deletions(-) diff --git a/mod/resource/type/file/resource.class.php b/mod/resource/type/file/resource.class.php index a00c6f605b..94d885ae72 100644 --- a/mod/resource/type/file/resource.class.php +++ b/mod/resource/type/file/resource.class.php @@ -216,6 +216,7 @@ function display() { $formatoptions->noclean = true; if ($resource->options != "frame") { + if (in_array($mimetype, array('image/gif','image/jpeg','image/png'))) { // It's an image $resourcetype = "image"; $embedded = true; @@ -234,7 +235,7 @@ function display() { } else if ($mimetype == "text/html") { // It's a web page $resourcetype = "html"; - } + } } $isteamspeak = (stripos($resource->reference, 'teamspeak://') === 0); @@ -440,26 +441,26 @@ function display() { } else if ($resourcetype == "mediaplayer") { echo '
'; - echo ''; - echo ""; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo "\n'; - echo ''; + + echo ''; +// Old non-compliant code (but used to work with Opera/Safari) +// echo ''; + echo ''; + echo ''; + echo ""; + echo ''; +// Old non-compliant code +// echo "\n'; +// echo ''; + echo "$fullurl"; echo ''; + echo ''; } else if ($resourcetype == "quicktime") { @@ -467,21 +468,31 @@ function display() { echo '
'; echo ''; + echo ' id="quicktime" type="application/x-oleobject">'; echo ""; echo ''; echo ''; echo ''; echo ''; - echo "\n'; - echo ''; + // New compliant code + echo ''; + echo ""; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + +// Old non-compliant code +// echo "\n'; +// echo ''; echo ''; echo '
'; - } + } if (trim($resource->summary)) { print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $course->id), "center"); diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index 5c1bc01400..de2074916f 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -3023,6 +3023,11 @@ body#question-preview .quemodname, body#question-preview .controls { margin:20px; } +.resourcecontent object { + height:480px; + width:600px; +} + .mod-resource .modified { text-align:center; } -- 2.39.5