Exemplo n.º 1
0
 /**
  * Resorts the sub categories of the given category.
  *
  * @param \coursecat $category
  * @param string $sort One of idnumber or name.
  * @param bool $cleanup If true cleanup will be done, if false you will need to do it manually later.
  * @return bool
  * @throws \moodle_exception
  */
 public static function action_category_resort_subcategories(\coursecat $category, $sort, $cleanup = true)
 {
     if (!$category->can_resort_subcategories()) {
         throw new \moodle_exception('permissiondenied', 'error', '', null, 'coursecat::can_resort');
     }
     return $category->resort_subcategories($sort, $cleanup);
 }