From b6c1273289fc9ed08345b50c5d0ee1f8b684c10b Mon Sep 17 00:00:00 2001
From: moodler <moodler>
Date: Sat, 16 Aug 2003 06:44:03 +0000
Subject: [PATCH] Only editing teachers see controls and things

---
 lib/weblib.php | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/weblib.php b/lib/weblib.php
index 0c27d72af6..155ed61e03 100644
--- a/lib/weblib.php
+++ b/lib/weblib.php
@@ -1076,7 +1076,7 @@ function print_table($table) {
 function print_editing_switch($courseid) {
     global $CFG, $USER;
 
-    if (isteacher($courseid)) {
+    if (isteacheredit($courseid)) {
         if ($USER->editing) {
             echo "<a href=\"$CFG->wwwroot/course/view.php?id=$courseid&edit=off\">turn editing off</a>";
         } else {
@@ -1116,7 +1116,7 @@ function update_course_icon($courseid) {
 // Used to be an icon, but it's now a simple form button
     global $CFG, $USER;
 
-    if (isteacher($courseid) and iscreator()) {
+    if (isteacheredit($courseid)) {
         if (!empty($USER->editing)) {
             $string = get_string("turneditingoff");
             $edit = "off";
@@ -1135,12 +1135,14 @@ function update_module_button($moduleid, $courseid, $string) {
 // Prints the editing button on a module "view" page
     global $CFG;
 
-    if (isteacher($courseid)) {
+    if (isteacheredit($courseid)) {
         $string = get_string("updatethis", "", $string);
         return "<form target=_parent method=get action=\"$CFG->wwwroot/course/mod.php\">".
                "<input type=hidden name=update value=\"$moduleid\">".
                "<input type=hidden name=return value=\"true\">".
                "<input type=submit value=\"$string\"></form>";
+    } else {
+        return "";
     }
 }
 
-- 
2.39.5