Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
.
require_once('../config.php');
require_once('lib.php');
require_once('edit_form.php');
require_once($CFG->dirroot . '/course/lib.php');
$noteid = optional_param('id', 0, PARAM_INT);
$url = new moodle_url('/notes/edit.php');
if ($noteid) {
// Existing note.
$url->param('id', $noteid);
if (!$note = note_load($noteid)) {
throw new \moodle_exception('invalidid', 'notes');
}
} else {
// Adding new note.
$courseid = required_param('courseid', PARAM_INT);
$userid = required_param('userid', PARAM_INT);
$state = optional_param('publishstate', NOTES_STATE_PUBLIC, PARAM_ALPHA);
$note = new stdClass();
$note->courseid = $courseid;
$note->userid = $userid;
$note->publishstate = $state;
$url->param('courseid', $courseid);
$url->param('userid', $userid);
if ($state !== NOTES_STATE_PUBLIC) {
$url->param('publishstate', $state);
}
}
$PAGE->set_url($url);
if (!$course = $DB->get_record('course', array('id' => $note->courseid))) {
throw new \moodle_exception('invalidcourseid');
}
require_login($course);
if (empty($CFG->enablenotes)) {
throw new \moodle_exception('notesdisabled', 'notes');
}
$context = context_course::instance($course->id);
require_capability('moodle/notes:manage', $context);
if (!$user = $DB->get_record('user', array('id' => $note->userid))) {
throw new \moodle_exception('invaliduserid');
}
$noteform = new note_edit_form();
$noteform->set_data($note);
// If form was cancelled then return to the notes list of the note.
if ($noteform->is_cancelled()) {
redirect($CFG->wwwroot . '/notes/index.php?course=' . $note->courseid . '&user=' . $note->userid);
}
// If data was submitted and validated, then save it to database.
if ($note = $noteform->get_data()) {
if ($noteid) {
// A noteid has been used, we don't allow editing of course or user so
// lets unset them to be sure we never change that by accident.
unset($note->courseid);
unset($note->userid);
}
note_save($note);
// Redirect to notes list that contains this note.
redirect($CFG->wwwroot . '/notes/index.php?course=' . $note->courseid . '&user=' . $note->userid);
}
if ($noteid) {
$strnotes = get_string('editnote', 'notes');
} else {
$strnotes = get_string('addnewnote', 'notes');
}
// Output HTML.
$link = null;
if (course_can_view_participants($context) || course_can_view_participants(context_system::instance())) {
$link = new moodle_url('/user/index.php', array('id' => $course->id));
}
$PAGE->navbar->add(get_string('participants'), $link);
$PAGE->navbar->add(fullname($user), new moodle_url('/user/view.php', array('id' => $user->id, 'course' => $course->id)));
$PAGE->navbar->add(get_string('notes', 'notes'),
new moodle_url('/notes/index.php', array('user' => $user->id, 'course' => $course->id)));
$PAGE->navbar->add($strnotes);
$PAGE->set_title($course->shortname . ': ' . $strnotes);
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
echo $OUTPUT->heading(fullname($user));
$noteform->display();
echo $OUTPUT->footer();