Fix for bug 2491:

Implementing a "parent folder" icon in the file manager.
This commit is contained in:
defacer 2005-02-08 18:03:43 +00:00
parent 210eddc7df
commit f4b351a30e

View File

@ -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 "<tr>";
print_cell("center", "<input type=\"checkbox\" name=\"file$count\" value=\"$fileurl\" />");
print_cell("left", "<a href=\"index.php?id=$id&amp;wdir=$fileurl&amp;choose=$choose\"><img src=\"$CFG->pixpath/f/folder.gif\" height=\"16\" width=\"16\" border=\"0\" alt=\"Folder\" /></a> <a href=\"index.php?id=$id&amp;wdir=$fileurl&amp;choose=$choose\">".htmlspecialchars($dir)."</a>");
print_cell("right", "<b>$filesize</b>");
print_cell("right", $filedate);
print_cell("right", "<a href=\"index.php?id=$id&amp;wdir=$wdir&amp;file=$filesafe&amp;action=rename&amp;choose=$choose\">$strrename</a>");
if($dir == '..') {
$fileurl = rawurlencode(dirname($wdir));
print_cell();
print_cell('left', '<a href="index.php?id='.$id.'&amp;wdir='.$fileurl.'"><img src="'.$CFG->pixpath.'/f/parent.gif" height="16" width="16" alt="'.get_string('parentfolder').'" /></a> <a href="index.php?id='.$id.'&amp;wdir='.$fileurl.'">'.get_string('parentfolder').'</a>');
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", "<input type=\"checkbox\" name=\"file$count\" value=\"$fileurl\" />");
print_cell("left", "<a href=\"index.php?id=$id&amp;wdir=$fileurl&amp;choose=$choose\"><img src=\"$CFG->pixpath/f/folder.gif\" height=\"16\" width=\"16\" border=\"0\" alt=\"Folder\" /></a> <a href=\"index.php?id=$id&amp;wdir=$fileurl&amp;choose=$choose\">".htmlspecialchars($dir)."</a>");
print_cell("right", "<b>$filesize</b>");
print_cell("right", $filedate);
print_cell("right", "<a href=\"index.php?id=$id&amp;wdir=$wdir&amp;file=$filesafe&amp;action=rename&amp;choose=$choose\">$strrename</a>");
}
echo "</tr>";
}
@ -771,7 +781,7 @@ function displaydir ($wdir) {
link_to_popup_window ($ffurl, "display",
"<img src=\"$CFG->pixpath/f/$icon\" height=\"16\" width=\"16\" border=\"0\" alt=\"File\" />",
480, 640);
echo "<font size=\"-1\" face=\"Arial, Helvetica\">";
echo " <font size=\"-1\" face=\"Arial, Helvetica\">";
link_to_popup_window ($ffurl, "display",
htmlspecialchars($file),
480, 640);