removed file pop-ups; merged from MOODLE_15_STABLE

This commit is contained in:
skodak 2005-07-12 18:59:21 +00:00
parent 24fb69e111
commit 2a1975cbc9

View File

@ -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 />";
}
}
}