Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added help link to course pages (for teachers) and tidied up the

course admin links in general (new fucntion and reorder)
  • Loading branch information...
commit 44dad7350b4fb940ac7fee7a68f3638cc5ca88a5 1 parent fddd5bd
martin authored
28 course/lib.php
@@ -528,6 +528,34 @@ function print_admin_links ($siteid) {
528 528 echo "<IMG SRC=\"$CFG->wwwroot/pix/spacer.gif\" WIDTH=200 HEIGHT=0><BR>";
529 529 }
530 530
  531 +function print_course_admin_links($courseid) {
  532 + global $THEME, $CFG;
  533 +
  534 + echo "<BR>";
  535 + $adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/edit.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
  536 + if (isediting($courseid)) {
  537 + $admindata[]="<A HREF=\"view.php?id=$courseid&edit=off\">".get_string("turneditingoff")."</A>";
  538 + } else {
  539 + $admindata[]="<A HREF=\"view.php?id=$courseid&edit=on\">".get_string("turneditingon")."</A>";
  540 + }
  541 + $admindata[]="<A HREF=\"edit.php?id=$courseid\">".get_string("settings")."...</A>";
  542 + $adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
  543 + $admindata[]="<A HREF=\"log.php?id=$courseid\">".get_string("logs")."...</A>";
  544 + $adminicon[]="<IMG SRC=\"$CFG->wwwroot/pix/i/log.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
  545 + $admindata[]="<A HREF=\"$CFG->wwwroot/files/index.php?id=$courseid\">".get_string("files")."...</A>";
  546 + $adminicon[]="<IMG SRC=\"$CFG->wwwroot/files/pix/files.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
  547 +
  548 + $admindata[]="<A TARGET=helpwindow HREF=\"$CFG->wwwroot/doc/teacher.html\">".get_string("help")."...</A>";
  549 + $adminicon[]="<IMG SRC=\"$CFG->wwwroot/mod/reading/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
  550 +
  551 + if ($teacherforum = forum_get_course_forum($courseid, "teacher")) {
  552 + $admindata[]="<A HREF=\"$CFG->wwwroot/mod/forum/view.php?f=$teacherforum->id\">".get_string("teacherforum")."</A>";
  553 + $adminicon[]="<IMG SRC=\"$CFG->wwwroot/mod/forum/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
  554 + }
  555 +
  556 + print_simple_box(get_string("administration"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
  557 + print_side_block("", $admindata, "", $adminicon);
  558 +}
531 559
532 560
533 561 function print_log_graph($course, $userid=0, $type="course.png", $date=0) {
25 course/social.php
@@ -49,30 +49,9 @@
49 49 forum_print_search_form($course);
50 50 echo "</DIV>";
51 51
52   - // Print Admin links for teachers and admin.
  52 + // Admin links and controls
53 53 if (isteacher($course->id)) {
54   - echo "<BR>";
55   - $admindata[]="<A HREF=\"edit.php?id=$course->id\">".get_string("settings")."...</A>";
56   - $adminicon[]="<IMG SRC=\"../pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
57   - $admindata[]="<A HREF=\"log.php?id=$course->id\">".get_string("logs")."...</A>";
58   - $adminicon[]="<IMG SRC=\"../pix/i/log.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
59   - $admindata[]="<A HREF=\"../files/index.php?id=$course->id\">".get_string("files")."...</A>";
60   - $adminicon[]="<IMG SRC=\"../files/pix/files.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
61   -
62   - if ($teacherforum = forum_get_course_forum($course->id, "teacher")) {
63   - $admindata[]="<A HREF=\"../mod/forum/view.php?f=$teacherforum->id\">".get_string("teacherforum")."</A>";
64   - $adminicon[]="<IMG SRC=\"../mod/forum/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
65   - }
66   -
67   - $adminicon[]="<IMG SRC=\"../pix/i/edit.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
68   - if (isediting($course->id)) {
69   - $admindata[]="<A HREF=\"view.php?id=$course->id&edit=off\">".get_string("turneditingoff")."</A>";
70   - } else {
71   - $admindata[]="<A HREF=\"view.php?id=$course->id&edit=on\">".get_string("turneditingon")."</A>";
72   - }
73   -
74   - print_simple_box(get_string("administration"),"CENTER", "100%", $THEME->cellheading);
75   - print_side_block("", $admindata, "", $adminicon);
  54 + print_course_admin_links($course->id);
76 55 }
77 56
78 57 echo "</TD>";
25 course/topics.php
@@ -78,33 +78,10 @@
78 78 echo "</DIV>";
79 79
80 80 // Admin links and controls
81   -
82 81 if (isteacher($course->id)) {
83   - echo "<BR>";
84   - $admindata[]="<A HREF=\"edit.php?id=$course->id\">".get_string("settings")."...</A>";
85   - $adminicon[]="<IMG SRC=\"../pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
86   - $admindata[]="<A HREF=\"log.php?id=$course->id\">".get_string("logs")."...</A>";
87   - $adminicon[]="<IMG SRC=\"../pix/i/log.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
88   - $admindata[]="<A HREF=\"../files/index.php?id=$course->id\">".get_string("files")."...</A>";
89   - $adminicon[]="<IMG SRC=\"../files/pix/files.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
90   -
91   - if ($teacherforum = forum_get_course_forum($course->id, "teacher")) {
92   - $admindata[]="<A HREF=\"../mod/forum/view.php?f=$teacherforum->id\">".get_string("teacherforum")."</A>";
93   - $adminicon[]="<IMG SRC=\"../mod/forum/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
94   - }
95   -
96   - $adminicon[]="<IMG SRC=\"../pix/i/edit.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
97   - if (isediting($course->id)) {
98   - $admindata[]="<A HREF=\"view.php?id=$course->id&edit=off\">".get_string("turneditingoff")."</A>";
99   - } else {
100   - $admindata[]="<A HREF=\"view.php?id=$course->id&edit=on\">".get_string("turneditingon")."</A>";
101   - }
102   -
103   - print_simple_box(get_string("administration"),"CENTER", "100%", $THEME->cellheading);
104   - print_side_block("", $admindata, "", $adminicon);
  82 + print_course_admin_links($course->id);
105 83 }
106 84
107   -
108 85 // Start main column
109 86 echo "</TD><TD WIDTH=\"*\">";
110 87
25 course/weeks.php
@@ -65,33 +65,10 @@
65 65 echo "</DIV>";
66 66
67 67 // Admin links and controls
68   -
69 68 if (isteacher($course->id)) {
70   - echo "<BR>";
71   - $admindata[]="<A HREF=\"edit.php?id=$course->id\">".get_string("settings")."...</A>";
72   - $adminicon[]="<IMG SRC=\"../pix/i/settings.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
73   - $admindata[]="<A HREF=\"log.php?id=$course->id\">".get_string("logs")."...</A>";
74   - $adminicon[]="<IMG SRC=\"../pix/i/log.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
75   - $admindata[]="<A HREF=\"../files/index.php?id=$course->id\">".get_string("files")."...</A>";
76   - $adminicon[]="<IMG SRC=\"../files/pix/files.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
77   -
78   - if ($teacherforum = forum_get_course_forum($course->id, "teacher")) {
79   - $admindata[]="<A HREF=\"../mod/forum/view.php?f=$teacherforum->id\">".get_string("teacherforum")."</A>";
80   - $adminicon[]="<IMG SRC=\"../mod/forum/icon.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
81   - }
82   - $adminicon[]="<IMG SRC=\"../pix/i/edit.gif\" HEIGHT=16 WIDTH=16 ALT=\"\">";
83   - if (isediting($course->id)) {
84   - $admindata[]="<A HREF=\"view.php?id=$course->id&edit=off\">".get_string("turneditingoff")."</A>";
85   - } else {
86   - $admindata[]="<A HREF=\"view.php?id=$course->id&edit=on\">".get_string("turneditingon")."</A>";
87   - }
88   -
89   -
90   - print_simple_box(get_string("administration"), $align="CENTER", $width="100%", $color="$THEME->cellheading");
91   - print_side_block("", $admindata, "", $adminicon);
  69 + print_course_admin_links($course->id);
92 70 }
93 71
94   -
95 72 // Start main column
96 73 echo "</TD><TD WIDTH=\"*\">";
97 74
1  lang/en/moodle.php
@@ -142,6 +142,7 @@
142 142 $string[grade] = "Grade";
143 143 $string[guestsno] = "No, do not allow guests in";
144 144 $string[guestsyes] = "Yes, allow 'guest' student in";
  145 +$string[help] = "Help";
145 146 $string[helppicture] = "How to upload a picture";
146 147 $string[helptext] = "How to write text";
147 148 $string[helpquestions] = "How to ask questions";

0 comments on commit 44dad73

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