mirror of
https://github.com/moodle/moodle.git
synced 2025-02-14 12:55:23 +01:00
removed file pop-ups; merged from MOODLE_15_STABLE
This commit is contained in:
parent
24fb69e111
commit
2a1975cbc9
@ -2185,30 +2185,28 @@ function forum_print_attachments($post, $return=NULL) {
|
||||
if ($basedir = forum_file_area($post)) {
|
||||
if ($files = get_directory_list($basedir)) {
|
||||
$strattachment = get_string("attachment", "forum");
|
||||
$strpopupwindow = get_string("popupwindow");
|
||||
foreach ($files as $file) {
|
||||
$icon = mimeinfo("icon", $file);
|
||||
if ($CFG->slasharguments) {
|
||||
$ffurl = "file.php/$filearea/$file";
|
||||
$ffurl = "$CFG->wwwroot/file.php/$filearea/$file";
|
||||
} else {
|
||||
$ffurl = "file.php?file=/$filearea/$file";
|
||||
$ffurl = "$CFG->wwwroot/file.php?file=/$filearea/$file";
|
||||
}
|
||||
$image = "<img border=\"0\" src=\"$CFG->pixpath/f/$icon\" height=\"16\" width=\"16\" alt=\"$strpopupwindow\" />";
|
||||
$image = "<img border=\"0\" src=\"$CFG->pixpath/f/$icon\" height=\"16\" width=\"16\" alt=\"\" />";
|
||||
|
||||
if ($return == "html") {
|
||||
$output .= "<a href=\"$CFG->wwwroot/$ffurl\">$image</a> ";
|
||||
$output .= "<a href=\"$CFG->wwwroot/$ffurl\">$file</a><br />";
|
||||
$output .= "<a href=\"$ffurl\">$image</a> ";
|
||||
$output .= "<a href=\"$ffurl\">$file</a><br />";
|
||||
|
||||
} else if ($return == "text") {
|
||||
$output .= "$strattachment $file:\n$CFG->wwwroot/$ffurl\n";
|
||||
$output .= "$strattachment $file:\n$ffurl\n";
|
||||
|
||||
} else {
|
||||
if ($icon == "image.gif") { // Image attachments don't get printed as links
|
||||
$imagereturn .= "<br /><img src=\"$CFG->wwwroot/$ffurl\" alt=\"\" />";
|
||||
$imagereturn .= "<br /><img src=\"$ffurl\" alt=\"\" />";
|
||||
} else {
|
||||
link_to_popup_window("/$ffurl", "attachment", $image, 500, 500, $strattachment);
|
||||
echo "<a href=\"$CFG->wwwroot/$ffurl\">$file</a>";
|
||||
echo "<br />";
|
||||
echo "<a href=\"$ffurl\">$image</a> ";
|
||||
echo "<a href=\"$ffurl\">$file</a><br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user