]> git.mjollnir.org Git - moodle.git/commitdiff
Add a link across to the Files area
authormoodler <moodler>
Sun, 16 May 2004 09:11:17 +0000 (09:11 +0000)
committermoodler <moodler>
Sun, 16 May 2004 09:11:17 +0000 (09:11 +0000)
mod/resource/view.php

index 37436a2b2996668fbe40896906917de6c62e49f1..12dcd6b530a90044b42a7aae03f686ee3e23d7be 100644 (file)
                          "", "", true, update_module_button($cm->id, $course->id, $strresource), 
                          navmenu($course, $cm));
 
+            if (isteacheredit($course->id)) {
+                echo "<div align=\"right\"><img src=\"$CFG->pixpath/i/files.gif\" height=16 width=16 alt=\"\">&nbsp".
+                     "<a href=\"$CFG->wwwroot/files/index.php?id=$course->id&wdir=/$resource->reference$subdir\">".
+                      get_string("editfiles")."...</a></div>";
+            }
+
+
             if (trim($resource->summary)) {
                 print_simple_box(text_to_html($resource->summary), "center");
                 print_spacer(10,10);
             }
 
+            $files = get_directory_list("$CFG->dataroot/$relativepath", 'moddata', false, true, true);
+
+
+            if (!$files) {
+                print_heading(get_string("nofilesyet"));
+                print_footer($course);
+                exit;
+            }
+
             print_simple_box_start("center", "", "$THEME->cellcontent", '0' );
 
-            $files = get_directory_list("$CFG->dataroot/$relativepath", 'moddata', false, true, true);
             $strftime = get_string('strftimedatetime');
             $strname = get_string("name");
             $strsize = get_string("size");