diff --git a/files/index.php b/files/index.php
index 3357e259c9f..a7a4f6efe62 100644
--- a/files/index.php
+++ b/files/index.php
@@ -712,28 +712,38 @@ function displaydir ($wdir) {
if ($wdir == "/") {
$wdir = "";
}
+ if (!empty($wdir)) {
+ $dirlist[] = '..';
+ }
$count = 0;
if (!empty($dirlist)) {
asort($dirlist);
foreach ($dirlist as $dir) {
-
- $count++;
-
- $filename = $fullpath."/".$dir;
- $fileurl = rawurlencode($wdir."/".$dir);
- $filesafe = rawurlencode($dir);
- $filesize = display_size(get_directory_size("$fullpath/$dir"));
- $filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p");
-
echo "
";
- print_cell("center", "");
- print_cell("left", "
pixpath/f/folder.gif\" height=\"16\" width=\"16\" border=\"0\" alt=\"Folder\" /> ".htmlspecialchars($dir)."");
- print_cell("right", "$filesize");
- print_cell("right", $filedate);
- print_cell("right", "$strrename");
+ if($dir == '..') {
+ $fileurl = rawurlencode(dirname($wdir));
+ print_cell();
+ print_cell('left', '
'.get_string('parentfolder').'');
+ print_cell();
+ print_cell();
+ print_cell();
+ }
+ else {
+ $count++;
+ $filename = $fullpath."/".$dir;
+ $fileurl = rawurlencode($wdir."/".$dir);
+ $filesafe = rawurlencode($dir);
+ $filesize = display_size(get_directory_size("$fullpath/$dir"));
+ $filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p");
+ print_cell("center", "");
+ print_cell("left", "
pixpath/f/folder.gif\" height=\"16\" width=\"16\" border=\"0\" alt=\"Folder\" /> ".htmlspecialchars($dir)."");
+ print_cell("right", "$filesize");
+ print_cell("right", $filedate);
+ print_cell("right", "$strrename");
+ }
echo "
";
}
@@ -771,7 +781,7 @@ function displaydir ($wdir) {
link_to_popup_window ($ffurl, "display",
"
pixpath/f/$icon\" height=\"16\" width=\"16\" border=\"0\" alt=\"File\" />",
480, 640);
- echo "";
+ echo " ";
link_to_popup_window ($ffurl, "display",
htmlspecialchars($file),
480, 640);