mirror of
https://github.com/moodle/moodle.git
synced 2025-03-19 15:10:05 +01:00
Merge branch 'MDL-62334-master' of https://github.com/danielneis/moodle
This commit is contained in:
commit
0ddc272116
@ -43,6 +43,12 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
|
||||
array('moodle/category:manage')
|
||||
)
|
||||
);
|
||||
$ADMIN->add('courses',
|
||||
new admin_externalpage('addnewcourse', new lang_string('addnewcourse'),
|
||||
new moodle_url('/course/edit.php', array('category' => 0)),
|
||||
array('moodle/category:manage')
|
||||
)
|
||||
);
|
||||
$ADMIN->add('courses',
|
||||
new admin_externalpage('restorecourse', new lang_string('restorecourse', 'admin'),
|
||||
new moodle_url('/backup/restorefile.php', array('contextid' => context_system::instance()->id)),
|
||||
|
@ -103,8 +103,13 @@ if ($id) {
|
||||
$PAGE->set_context($catcontext);
|
||||
|
||||
} else {
|
||||
// Creating new course in default category.
|
||||
$course = null;
|
||||
require_login();
|
||||
print_error('needcoursecategroyid');
|
||||
$category = core_course_category::get_default();
|
||||
$catcontext = context_coursecat::instance($category->id);
|
||||
require_capability('moodle/course:create', $catcontext);
|
||||
$PAGE->set_context($catcontext);
|
||||
}
|
||||
|
||||
// Prepare course and the editor.
|
||||
|
Loading…
x
Reference in New Issue
Block a user