Fix popups and icons for resources
authormoodler <moodler>
Mon, 26 Jul 2004 16:21:56 +0000 (16:21 +0000)
committermoodler <moodler>
Mon, 26 Jul 2004 16:21:56 +0000 (16:21 +0000)
mod/resource/lib.php

index d5cad951bfa427113fd3a8a8e8e6b87f97da4383..9ce4872ed29096e10a8350aea8786e9e3ff85b10 100644 (file)
@@ -299,7 +299,7 @@ function resource_get_coursemodule_info($coursemodule) {
    $info = NULL;
 
    if ($resource = get_record("resource", "id", $coursemodule->instance)) {
-       if (($resource->type == UPLOADEDFILE or $resource->type == WEBLINK) and !empty($resource->popup)) {
+       if (!empty($resource->popup)) {
            $info->extra =  urlencode("target=\"resource$resource->id\" onClick=\"return ".
                             "openpopup('/mod/resource/view.php?inpopup=true&id=".
                             $coursemodule->id.
@@ -308,11 +308,11 @@ function resource_get_coursemodule_info($coursemodule) {
 
        require_once("$CFG->dirroot/files/mimetypes.php");
 
-       if ($resource->type == 'file' or $resource->type == 'url') {
+       if ($resource->type == 'file') {
               $icon = mimeinfo("icon", $resource->reference);
            if ($icon != 'unknown.gif') {
                       $info->icon ="f/$icon";
-           } else if ($resource->type == 'url') {
+           } else {
                       $info->icon ="f/web.gif";
            }
        } else if ($resource->type == 'directory') {