]> git.mjollnir.org Git - moodle.git/commitdiff
Make the Help link in the course look like a seamless part of the course.
authormartin <martin>
Sun, 18 Aug 2002 16:31:23 +0000 (16:31 +0000)
committermartin <martin>
Sun, 18 Aug 2002 16:31:23 +0000 (16:31 +0000)
course/lib.php
doc/teacher.html
doc/view.php [new file with mode: 0644]

index 8da6a722bbdd5e73857b71bce9f9f3e6b0433fb6..ab57aa1fdb94a4f1209d54a0a0a01cbdbd7a5dbd 100644 (file)
@@ -545,7 +545,7 @@ function print_course_admin_links($courseid) {
     $admindata[]="<A HREF=\"$CFG->wwwroot/files/index.php?id=$courseid\">".get_string("files")."...</A>";
     $adminicon[]="<IMG SRC=\"$CFG->wwwroot/files/pix/files.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
 
-    $admindata[]="<A TARGET=helpwindow HREF=\"$CFG->wwwroot/doc/teacher.html\">".get_string("help")."...</A>";
+    $admindata[]="<A HREF=\"$CFG->wwwroot/doc/view.php?id=$courseid&file=teacher.html\">".get_string("help")."...</A>";
     $adminicon[]="<IMG SRC=\"$CFG->wwwroot/mod/reading/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
 
     if ($teacherforum = forum_get_course_forum($courseid, "teacher")) {
index 6e19c70f94c5e9b7d8e4776c7ca304e7a6dd1e6c..cd5f726c6cac9d7573c4ba81b2de455b626d372c 100755 (executable)
          They can be given to students early in the course as a diagnostic tool and at the end of the \r
          course as an evaluation tool (I use one every week in my courses).</dd>\r
   </dl>\r
+  <BR>\r
   <p>After adding your activities you can move them up and down in your course \r
     layout by clicking on the little arrow icons (<img src="../pix/t/up.gif" width="9" height="10"> \r
     <img src="../pix/t/down.gif" width="9" height="10">) next to each one. You \r
diff --git a/doc/view.php b/doc/view.php
new file mode 100644 (file)
index 0000000..522c187
--- /dev/null
@@ -0,0 +1,30 @@
+<?PHP  // $Id$
+
+    require("../config.php");
+
+    require_variable($id);      // course context
+    require_variable($file);    // file in this directory to view
+
+    if (! $course = get_record("course", "id", $id)) {
+        error("Course is misconfigured");
+    }
+
+    if (!isteacher($course->id)) {
+        error("Only teachers can look at this page");
+    }
+
+    $file = clean_filename($file);
+
+    if (file_exists($file)) {
+        $strhelp = get_string("help");
+        print_header("$course->shortname: $strhelp", "$course->fullname", 
+                     "<A HREF=\"../course/view.php?id=$course->id\">$course->shortname</A> -> $strhelp");
+        echo "<BLOCKQUOTE>";
+        include($file);
+        echo "</BLOCKQUOTE>";
+    }
+
+    print_footer($course);
+
+?>
+