mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Fix for bug 2491:
Implementing a "parent folder" icon in the file manager.
This commit is contained in:
parent
210eddc7df
commit
f4b351a30e
@ -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&wdir=$fileurl&choose=$choose\"><img src=\"$CFG->pixpath/f/folder.gif\" height=\"16\" width=\"16\" border=\"0\" alt=\"Folder\" /></a> <a href=\"index.php?id=$id&wdir=$fileurl&choose=$choose\">".htmlspecialchars($dir)."</a>");
|
||||
print_cell("right", "<b>$filesize</b>");
|
||||
print_cell("right", $filedate);
|
||||
print_cell("right", "<a href=\"index.php?id=$id&wdir=$wdir&file=$filesafe&action=rename&choose=$choose\">$strrename</a>");
|
||||
if($dir == '..') {
|
||||
$fileurl = rawurlencode(dirname($wdir));
|
||||
print_cell();
|
||||
print_cell('left', '<a href="index.php?id='.$id.'&wdir='.$fileurl.'"><img src="'.$CFG->pixpath.'/f/parent.gif" height="16" width="16" alt="'.get_string('parentfolder').'" /></a> <a href="index.php?id='.$id.'&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&wdir=$fileurl&choose=$choose\"><img src=\"$CFG->pixpath/f/folder.gif\" height=\"16\" width=\"16\" border=\"0\" alt=\"Folder\" /></a> <a href=\"index.php?id=$id&wdir=$fileurl&choose=$choose\">".htmlspecialchars($dir)."</a>");
|
||||
print_cell("right", "<b>$filesize</b>");
|
||||
print_cell("right", $filedate);
|
||||
print_cell("right", "<a href=\"index.php?id=$id&wdir=$wdir&file=$filesafe&action=rename&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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user