From: moodler
Date: Tue, 20 Jan 2004 11:22:09 +0000 (+0000)
Subject: Support for auto embedding of WMV files
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=98a45cd7e7fa5ca550c6ff40394b3346f75b9528;p=moodle.git
Support for auto embedding of WMV files
---
diff --git a/files/mimetypes.php b/files/mimetypes.php
index df21d20d1e..a678626c69 100644
--- a/files/mimetypes.php
+++ b/files/mimetypes.php
@@ -67,6 +67,7 @@ function mimeinfo($element, $filename) {
"tsv" => array ("type"=>"text/tab-separated-values", "icon"=>"text.gif"),
"txt" => array ("type"=>"text/plain", "icon"=>"text.gif"),
"wav" => array ("type"=>"audio/wav", "icon"=>"audio.gif"),
+ "wmv" => array ("type"=>"video/x-ms-wmv", "icon"=>"avi.gif"),
"xls" => array ("type"=>"application/vnd.ms-excel", "icon"=>"excel.gif"),
"xml" => array ("type"=>"text/xml", "icon"=>"xml.gif"),
"xsl" => array ("type"=>"text/xml", "icon"=>"xml.gif"),
diff --git a/lang/en/resource.php b/lang/en/resource.php
index 858e35ea5c..c2786a448c 100644
--- a/lang/en/resource.php
+++ b/lang/en/resource.php
@@ -18,6 +18,7 @@ $string['configpopupstatus'] = 'Should popup windows show the status bar by defa
$string['configpopuptoolbar'] = 'Should popup windows show the tool bar by default?';
$string['configpopupwidth'] = 'What width should be the default width for new popup windows?';
$string['configwebsearch'] = 'When adding a URL as a webpage or weblink, this location is offered as a site to help the user search for the URL they want.';
+$string['directlink'] = 'Direct link to this file';
$string['editingaresource'] = 'Editing a resource';
$string['example'] = 'Example';
$string['examplereference'] = 'Tobin, K. & Tippins, D (1993) Constructivism as a Referent for Teaching and Learning. In: K. Tobin (Ed) The Practice of Constructivism in Science Education, pp 3-21, Lawrence-Erlbaum, Hillsdale, NJ.';
diff --git a/mod/resource/view.php b/mod/resource/view.php
index 199932a28e..bcb1872644 100644
--- a/mod/resource/view.php
+++ b/mod/resource/view.php
@@ -141,6 +141,10 @@
$resourcetype = "mp3";
$embedded = true;
+ } else if ($mimetype == "video/x-ms-wmv") { // It's a Media Player file
+ $resourcetype = "wmv";
+ $embedded = true;
+
} else if ($mimetype == "text/html") { // It's a web page
$resourcetype = "html";
}
@@ -225,11 +229,14 @@
/// Display the actual resource
if ($embedded) { // Display resource embedded in page
+ $strdirectlink = get_string("directlink", "resource");
+
if ($inpopup) {
print_header($pagetitle);
} else {
print_header($pagetitle, "$course->fullname",
- "$navigation framename\" HREF=\"$fullurl\">$resource->name",
+ "$navigation framename\" ".
+ "href=\"$fullurl\">$resource->name",
"", "", true, update_module_button($cm->id, $course->id, $strresource),
navmenu($course, $cm, "self"));
}
@@ -254,11 +261,39 @@
echo '';
echo '';
echo "