mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +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
|
@ -16,6 +16,10 @@ require_login($course->id);
|
|||
// to create notes the current user needs a capability
|
||||
require_capability('moodle/notes:manage', $context);
|
||||
|
||||
if (empty($CFG->enablenotes)) {
|
||||
print_error('notesdisabled', 'notes');
|
||||
}
|
||||
|
||||
if (!empty($users) && confirm_sesskey()) {
|
||||
if (count($users) != count($contents) || count($users) != count($states)) {
|
||||
print_error('invalidformdata', '', $CFG->wwwroot.'/user/index.php?id='.$id);
|
||||
|
@ -25,7 +29,7 @@ if (!empty($users) && confirm_sesskey()) {
|
|||
$note->courseid = $id;
|
||||
$note->format = FORMAT_PLAIN;
|
||||
foreach ($users as $k => $v) {
|
||||
if(!$user = $DB->get_record('user', array('id'=>$v)) || empty($contents[$k])) {
|
||||
if (!$user = $DB->get_record('user', array('id'=>$v)) || empty($contents[$k])) {
|
||||
continue;
|
||||
}
|
||||
$note->id = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue