original_string: public static function action_course_change_sortorder_after_course($courserecordorid, $moveaftercourseid) {
          $course = \get_course($courserecordorid);
          $category = \core_course_category::get($course->category);
          if (!$category->can_resort_courses()) {
              $url = '/course/management.php?categoryid='.$course->category;
              throw new \moodle_exception('nopermissions', 'error', $url, \get_string('resortcourses', 'moodle'));
          }
          return \course_change_sortorder_after_course($course, $moveaftercourseid);
      }
code: public static function action_course_change_sortorder_after_course($courserecordorid, $moveaftercourseid) {
          $course = \get_course($courserecordorid);
          $category = \core_course_category::get($course->category);
          if (!$category->can_resort_courses()) {
              $url = '/course/management.php?categoryid='.$course->category;
              throw new \moodle_exception('nopermissions', 'error', $url, \get_string('resortcourses', 'moodle'));
          }
          return \course_change_sortorder_after_course($course, $moveaftercourseid);
      }
code_tokens: public static function action_course_change_sortorder_after_course ( $ courserecordorid , $ moveaftercourseid ) { $ course = \ get_course ( $ courserecordorid ) ; $ category = \ core_course_category :: get ( $ course -> category ) ; if ( ! $ category -> can_resort_courses ( ) ) { $ url = '/course/management.php?categoryid=' . $ course -> category ; throw new \ moodle_exception ( 'nopermissions' , 'error' , $ url , \ get_string ( 'resortcourses' , 'moodle' ) ) ; } return \ course_change_sortorder_after_course ( $ course , $ moveaftercourseid ) ; }
docstring: Changes the sort order so that the first course appears after the second course.
  
  @param int|\stdClass $courserecordorid
  @param int $moveaftercourseid
  @return bool
  @throws \moodle_exception
docstring_tokens: Changes the sort order so that the first course appears after the second course .