Skip to content

Commit

Permalink
Make the Help link in the course look like a seamless part of the cou…
Browse files Browse the repository at this point in the history
…rse.
  • Loading branch information
martin committed Aug 18, 2002
1 parent 44dad73 commit 3c7331d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down
1 change: 1 addition & 0 deletions doc/teacher.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ <H3><A NAME="activities"></A>Setting up activities</H3>
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
Expand Down
30 changes: 30 additions & 0 deletions doc/view.php
Original file line number Diff line number Diff line change
@@ -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.