diff --git a/lib/weblib.php b/lib/weblib.php index 3fd2e540c96..d66d5154442 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -4441,6 +4441,8 @@ function print_editor_config($editorhidebuttons='', $return=false) { * Returns a turn edit on/off button for course in a self contained form. * Used to be an icon, but it's now a simple form button * + * Note that the caller is responsible for capchecks. + * * @uses $CFG * @uses $USER * @param int $courseid The course to update by id as found in 'course' table @@ -4449,23 +4451,21 @@ function print_editor_config($editorhidebuttons='', $return=false) { function update_course_icon($courseid) { global $CFG, $USER; - if (editcourseallowed($courseid)) { - if (!empty($USER->editing)) { - $string = get_string('turneditingoff'); - $edit = '0'; - } else { - $string = get_string('turneditingon'); - $edit = '1'; - } - - return '
frametarget.' method="get" action="'.$CFG->wwwroot.'/course/view.php">'. - '
'. - ''. - ''. - ''. - ''. - '
'; + if (!empty($USER->editing)) { + $string = get_string('turneditingoff'); + $edit = '0'; + } else { + $string = get_string('turneditingon'); + $edit = '1'; } + + return '
frametarget.' method="get" action="'.$CFG->wwwroot.'/course/view.php">'. + '
'. + ''. + ''. + ''. + ''. + '
'; } /**