mirror of
https://github.com/moodle/moodle.git
synced 2025-08-03 16:13:28 +02:00
MDL-16166 centralised enabling of subsystems, fixed some warnings and general cleanup
This commit is contained in:
parent
3c184e1464
commit
90658eefb0
24 changed files with 84 additions and 48 deletions
|
@ -32,6 +32,10 @@ if (!has_capability('moodle/notes:manage', $context)) {
|
|||
print_error('nopermissiontodelete', 'notes');
|
||||
}
|
||||
|
||||
if (empty($CFG->enablenotes)) {
|
||||
print_error('notesdisabled', 'notes');
|
||||
}
|
||||
|
||||
if (data_submitted() && confirm_sesskey()) {
|
||||
//if data was submitted and is valid, then delete note
|
||||
$returnurl = $CFG->wwwroot . '/notes/index.php?course=' . $course->id . '&user=' . $note->userid;
|
||||
|
|
|
@ -42,6 +42,10 @@
|
|||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
require_capability('moodle/notes:manage', $context);
|
||||
|
||||
if (empty($CFG->enablenotes)) {
|
||||
print_error('notesdisabled', 'notes');
|
||||
}
|
||||
|
||||
/// create form
|
||||
$noteform = new note_edit_form();
|
||||
|
||||
|
|
|
@ -54,6 +54,9 @@
|
|||
require_login($course);
|
||||
add_to_log($courseid, 'notes', 'view', 'index.php?course='.$courseid.'&user='.$userid, 'view notes');
|
||||
|
||||
if (empty($CFG->enablenotes)) {
|
||||
print_error('notesdisabled', 'notes');
|
||||
}
|
||||
|
||||
/// output HTML
|
||||
if ($course->id == SITEID) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue