MDL-43526 course: links to restore from management and admin structure.

This commit is contained in:
Sam Hemelryk
2014-01-07 12:08:34 +08:00
committed by Dan Poltawski
parent 812cc702ad
commit 39bd07f732
6 changed files with 46 additions and 6 deletions
+8
View File
@@ -2395,6 +2395,14 @@ class coursecat implements renderable, cacheable_object, IteratorAggregate {
return $this->has_manage_capability();
}
/**
* Returns true if the user is able to restore a course into this category as a new course.
* @return bool
*/
public function can_restore_courses_into() {
return has_capability('moodle/course:create', $this->get_context());
}
/**
* Resorts the sub categories of this category by the given field.
*