original_string: protected function load_course_sections(stdClass $course, navigation_node $coursenode, $sectionnum = null, $cm = null) {
          global $CFG, $SITE;
          require_once($CFG->dirroot.'/course/lib.php');
          if (isset($cm->sectionnum)) {
              $sectionnum = $cm->sectionnum;
          }
          if ($sectionnum !== null) {
              $this->includesectionnum = $sectionnum;
          }
          course_get_format($course)->extend_course_navigation($this, $coursenode, $sectionnum, $cm);
          if (isset($cm->id)) {
              $activity = $coursenode->find($cm->id, self::TYPE_ACTIVITY);
              if (empty($activity)) {
                  $activity = $this->load_stealth_activity($coursenode, get_fast_modinfo($course));
              }
          }
     }
code: protected function load_course_sections(stdClass $course, navigation_node $coursenode, $sectionnum = null, $cm = null) {
          global $CFG, $SITE;
          require_once($CFG->dirroot.'/course/lib.php');
          if (isset($cm->sectionnum)) {
              $sectionnum = $cm->sectionnum;
          }
          if ($sectionnum !== null) {
              $this->includesectionnum = $sectionnum;
          }
          course_get_format($course)->extend_course_navigation($this, $coursenode, $sectionnum, $cm);
          if (isset($cm->id)) {
              $activity = $coursenode->find($cm->id, self::TYPE_ACTIVITY);
              if (empty($activity)) {
                  $activity = $this->load_stealth_activity($coursenode, get_fast_modinfo($course));
              }
          }
     }
code_tokens: protected function load_course_sections ( stdClass $ course , navigation_node $ coursenode , $ sectionnum = null , $ cm = null ) { global $ CFG , $ SITE ; require_once ( $ CFG -> dirroot . '/course/lib.php' ) ; if ( isset ( $ cm -> sectionnum ) ) { $ sectionnum = $ cm -> sectionnum ; } if ( $ sectionnum !== null ) { $ this -> includesectionnum = $ sectionnum ; } course_get_format ( $ course ) -> extend_course_navigation ( $ this , $ coursenode , $ sectionnum , $ cm ) ; if ( isset ( $ cm -> id ) ) { $ activity = $ coursenode -> find ( $ cm -> id , self :: TYPE_ACTIVITY ) ; if ( empty ( $ activity ) ) { $ activity = $ this -> load_stealth_activity ( $ coursenode , get_fast_modinfo ( $ course ) ) ; } } }
docstring: Loads all of the courses section into the navigation.
  
  This function calls method from current course format, see
  {@link format_base::extend_course_navigation()}
  If course module ($cm) is specified but course format failed to create the node,
  the activity node is created anyway.
  
  By default course formats call the method {@link global_navigation::load_generic_course_sections()}
  
  @param stdClass $course Database record for the course
  @param navigation_node $coursenode The course node within the navigation
  @param null|int $sectionnum If specified load the contents of section with this relative number
  @param null|cm_info $cm If specified make sure that activity node is created (either
  in containg section or by calling load_stealth_activity() )
docstring_tokens: Loads all of the courses section into the navigation .