Skip to content

Commit

Permalink
Fix for bug 2491:
Browse files Browse the repository at this point in the history
Implementing a "parent folder" icon in the file manager.
  • Loading branch information
defacer committed Feb 8, 2005
1 parent 210eddc commit f4b351a
Showing 1 changed file with 25 additions and 15 deletions.
40 changes: 25 additions & 15 deletions files/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>";
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f4b351a

Please sign in to comment.