Skip to content
Browse files

Make the Help link in the course look like a seamless part of the cou…

…rse.
  • Loading branch information...
1 parent 44dad73 commit 3c7331da30bbc904bd3f7dffa3ad59b42e6b89ad martin committed
Showing with 32 additions and 1 deletion.
  1. +1 −1 course/lib.php
  2. +1 −0 doc/teacher.html
  3. +30 −0 doc/view.php
View
2 course/lib.php
@@ -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")) {
View
1 doc/teacher.html
@@ -170,6 +170,7 @@
They can be given to students early in the course as a diagnostic tool and at the end of the
course as an evaluation tool (I use one every week in my courses).</dd>
</dl>
+ <BR>
<p>After adding your activities you can move them up and down in your course
layout by clicking on the little arrow icons (<img src="../pix/t/up.gif" width="9" height="10">
<img src="../pix/t/down.gif" width="9" height="10">) next to each one. You
View
30 doc/view.php
@@ -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);
+
+?>
+

0 comments on commit 3c7331d

Please sign in to comment.
Something went wrong with that request. Please try again.