]> git.mjollnir.org Git - moodle.git/commitdiff
Added file size and table headings to Directory resource
authormoodler <moodler>
Sun, 2 May 2004 15:22:00 +0000 (15:22 +0000)
committermoodler <moodler>
Sun, 2 May 2004 15:22:00 +0000 (15:22 +0000)
mod/resource/view.php

index 6290cc425d996331fdd98aea9db8d18f9ef69cab..c330f672c125a6ca451751b625b35f4bd3fe9055 100644 (file)
                 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";
 
             $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);
 
                 } 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>';
                 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>';