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 {
// 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";
// 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 "";
}
}