mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Fix popups and icons for resources
This commit is contained in:
parent
cb57e6f439
commit
85e8239eac
1 changed files with 3 additions and 3 deletions
|
@ -299,7 +299,7 @@ function resource_get_coursemodule_info($coursemodule) {
|
||||||
$info = NULL;
|
$info = NULL;
|
||||||
|
|
||||||
if ($resource = get_record("resource", "id", $coursemodule->instance)) {
|
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 ".
|
$info->extra = urlencode("target=\"resource$resource->id\" onClick=\"return ".
|
||||||
"openpopup('/mod/resource/view.php?inpopup=true&id=".
|
"openpopup('/mod/resource/view.php?inpopup=true&id=".
|
||||||
$coursemodule->id.
|
$coursemodule->id.
|
||||||
|
@ -308,11 +308,11 @@ function resource_get_coursemodule_info($coursemodule) {
|
||||||
|
|
||||||
require_once("$CFG->dirroot/files/mimetypes.php");
|
require_once("$CFG->dirroot/files/mimetypes.php");
|
||||||
|
|
||||||
if ($resource->type == 'file' or $resource->type == 'url') {
|
if ($resource->type == 'file') {
|
||||||
$icon = mimeinfo("icon", $resource->reference);
|
$icon = mimeinfo("icon", $resource->reference);
|
||||||
if ($icon != 'unknown.gif') {
|
if ($icon != 'unknown.gif') {
|
||||||
$info->icon ="f/$icon";
|
$info->icon ="f/$icon";
|
||||||
} else if ($resource->type == 'url') {
|
} else {
|
||||||
$info->icon ="f/web.gif";
|
$info->icon ="f/web.gif";
|
||||||
}
|
}
|
||||||
} else if ($resource->type == 'directory') {
|
} else if ($resource->type == 'directory') {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue