original_string: public static function get_module($id, $sectionreturn = null) {
          global $PAGE;
          // Validate and normalize parameters.
          $params = self::validate_parameters(self::get_module_parameters(),
              array('id' => $id, 'sectionreturn' => $sectionreturn));
          $id = $params['id'];
          $sectionreturn = $params['sectionreturn'];
  
          // Set of permissions an editing user may have.
          $contextarray = [
              'moodle/course:update',
              'moodle/course:manageactivities',
              'moodle/course:activityvisibility',
              'moodle/course:sectionvisibility',
              'moodle/course:movesections',
              'moodle/course:setcurrentsection',
          ];
          $PAGE->set_other_editing_capability($contextarray);
  
          // Validate access to the course (note, this is html for the course view page, we don't validate access to the module).
          list($course, $cm) = get_course_and_cm_from_cmid($id);
          self::validate_context(context_course::instance($course->id));
  
          $courserenderer = $PAGE->get_renderer('core', 'course');
          $completioninfo = new completion_info($course);
          return $courserenderer->course_section_cm_list_item($course, $completioninfo, $cm, $sectionreturn);
      }
code: public static function get_module($id, $sectionreturn = null) {
          global $PAGE;
          // Validate and normalize parameters.
          $params = self::validate_parameters(self::get_module_parameters(),
              array('id' => $id, 'sectionreturn' => $sectionreturn));
          $id = $params['id'];
          $sectionreturn = $params['sectionreturn'];
  
          // Set of permissions an editing user may have.
          $contextarray = [
              'moodle/course:update',
              'moodle/course:manageactivities',
              'moodle/course:activityvisibility',
              'moodle/course:sectionvisibility',
              'moodle/course:movesections',
              'moodle/course:setcurrentsection',
          ];
          $PAGE->set_other_editing_capability($contextarray);
  
          // Validate access to the course (note, this is html for the course view page, we don't validate access to the module).
          list($course, $cm) = get_course_and_cm_from_cmid($id);
          self::validate_context(context_course::instance($course->id));
  
          $courserenderer = $PAGE->get_renderer('core', 'course');
          $completioninfo = new completion_info($course);
          return $courserenderer->course_section_cm_list_item($course, $completioninfo, $cm, $sectionreturn);
      }
code_tokens: public static function get_module ( $ id , $ sectionreturn = null ) { global $ PAGE ; // Validate and normalize parameters. $ params = self :: validate_parameters ( self :: get_module_parameters ( ) , array ( 'id' => $ id , 'sectionreturn' => $ sectionreturn ) ) ; $ id = $ params [ 'id' ] ; $ sectionreturn = $ params [ 'sectionreturn' ] ; // Set of permissions an editing user may have. $ contextarray = [ 'moodle/course:update' , 'moodle/course:manageactivities' , 'moodle/course:activityvisibility' , 'moodle/course:sectionvisibility' , 'moodle/course:movesections' , 'moodle/course:setcurrentsection' , ] ; $ PAGE -> set_other_editing_capability ( $ contextarray ) ; // Validate access to the course (note, this is html for the course view page, we don't validate access to the module). list ( $ course , $ cm ) = get_course_and_cm_from_cmid ( $ id ) ; self :: validate_context ( context_course :: instance ( $ course -> id ) ) ; $ courserenderer = $ PAGE -> get_renderer ( 'core' , 'course' ) ; $ completioninfo = new completion_info ( $ course ) ; return $ courserenderer -> course_section_cm_list_item ( $ course , $ completioninfo , $ cm , $ sectionreturn ) ; }
docstring: Returns html for displaying one activity module on course page
  
  @since Moodle 3.3
  @param int $id
  @param null|int $sectionreturn
  @return string
docstring_tokens: Returns html for displaying one activity module on course page