print_cell("center", "<input type=\"checkbox\" name=\"file$count\" value=\"$fileurl\" />", 'checkbox');
echo "<td align=\"left\" style=\"white-space:nowrap\" class=\"name\">";
- $ffurl = str_replace('//', '/', get_file_url("$id/$fileurl"));
+ $ffurl = get_file_url($id.'/'.$fileurl);
link_to_popup_window ($ffurl, "display",
"<img src=\"$CFG->pixpath/f/$icon\" class=\"icon\" alt=\"$strfile\" /> ".htmlspecialchars($file),
480, 640);
print_cell("center", "<input type=\"checkbox\" name=\"file$count\" value=\"$fileurl\" onclick=\";return set_rename('$file');\" />");
}
echo "<td align=\"left\" nowrap=\"nowrap\">";
- $ffurl = get_file_url($id$fileurl);
+ $ffurl = get_file_url($id.$fileurl);
link_to_popup_window ($ffurl, "display",
"<img src=\"$CFG->pixpath/f/$icon\" class=\"icon\" alt=\"$strfile\" />",
480, 640);
function get_file_url($path, $options=null, $type='coursefile') {
global $CFG;
+ $path = str_replace('//', '/', $path);
$path = trim($path, '/'); // no leading and trailing slashes
// type of file