Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added file size and table headings to Directory resource
  • Loading branch information
moodler committed May 2, 2004
1 parent 7ba54e1 commit cd2dea0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion mod/resource/view.php
Expand Up @@ -423,7 +423,7 @@
print_spacer(10,10);
}

print_simple_box_start("center", "", "$THEME->cellcontent", "20" );
print_simple_box_start("center", "", "$THEME->cellcontent", '0' );

if ($resource->reference) {
$relativepath = "$course->id/$resource->reference";
Expand All @@ -433,8 +433,15 @@

$files = get_directory_list("$CFG->dataroot/$relativepath", 'moddata', false);
$strftime = get_string('strftimedatetime');
$strname = get_string("name");
$strsize = get_string("size");
$strmodified = get_string("modified");

echo '<table cellpadding="4">';
echo "<tr><th colspan=\"2\">$strname</th>".
"<th align=\"right\" colspan=\"2\">$strsize</th>".
"<th align=\"right\">$strmodified</th>".
"</tr>";
foreach ($files as $file) {
$icon = mimeinfo("icon", $file);

Expand All @@ -443,6 +450,7 @@
} else {
$relativeurl = "/file.php?file=/$course->id/$resource->reference/$file";
}
$filesize = display_size(filesize("$CFG->dataroot/$course->id/$resource->reference/$file"));

echo '<tr>';
echo '<td>';
Expand All @@ -453,6 +461,9 @@
echo '</p></td>';
echo '<td>&nbsp;</td>';
echo '<td align="right" nowrap="nowrap"><p><font size="-1">';
echo $filesize;
echo '</font></p></td>';
echo '<td align="right" nowrap="nowrap"><p><font size="-1">';
echo userdate(filectime("$CFG->dataroot/$course->id/$resource->reference/$file"), $strftime);
echo '</font></p></td>';
echo '</tr>';
Expand Down

0 comments on commit cd2dea0

Please sign in to comment.