Skip to content

Commit

Permalink
Merged zip file exception into HEAD MDL-9478
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Aug 11, 2007
1 parent c9bd927 commit fc4e126
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mod/resource/type/file/resource.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@ function display() {

} else if ($mimetype == "text/html") { // It's a web page
$resourcetype = "html";

} else if ($mimetype == "application/zip") { // It's a zip archive
$resourcetype = "zip";
$embedded = true;

} else if ($mimetype == 'application/pdf' || $mimetype == 'application/x-pdf') {
$resourcetype = "pdf";
$embedded = true;
Expand Down Expand Up @@ -579,6 +584,12 @@ function display() {
echo '<!--<![endif]-->';
echo '</object>';
echo '</div>';

} elseif ($resourcetype == 'zip') {
echo '<div class="resourcepdf">';
echo get_string('clicktoopen', 'resource') . '<a href="' . $fullurl . '">' . format_string($resource->name) . '</a>';
echo '</div>';

} elseif ($resourcetype == 'pdf') {
echo '<div class="resourcepdf">';
echo '<object data="' . $fullurl . '" type="application/pdf">';
Expand Down

0 comments on commit fc4e126

Please sign in to comment.