protected function section_nav_selection($course, $sections, $displaysection) {
        global $CFG;
        $o = '';
        $sectionmenu = array();
        $sectionmenu[course_get_url($course)->out(false)] = get_string('maincoursepage');
        $modinfo = get_fast_modinfo($course);
        $section = 1;
        $numsections = course_get_format($course)->get_last_section_number();
        while ($section <= $numsections) {
            $thissection = $modinfo->get_section_info($section);
            $showsection = $thissection->uservisible or !$course->hiddensections;
            if (($showsection) && ($section != $displaysection) && ($url = course_get_url($course, $section))) {
                $sectionmenu[$url->out(false)] = get_section_name($course, $section);
            }
            $section++;
        }

        $select = new url_select($sectionmenu, '', array('' => get_string('jumpto')));
        $select->class = 'jumpmenu';
        $select->formid = 'sectionmenu';
        $o .= $this->output->render($select);

        return $o;
    }
protected function section_nav_selection($course, $sections, $displaysection) {
        global $CFG;
        $o = '';
        $sectionmenu = array();
        $sectionmenu[course_get_url($course)->out(false)] = get_string('maincoursepage');
        $modinfo = get_fast_modinfo($course);
        $section = 1;
        $numsections = course_get_format($course)->get_last_section_number();
        while ($section <= $numsections) {
            $thissection = $modinfo->get_section_info($section);
            $showsection = $thissection->uservisible or !$course->hiddensections;
            if (($showsection) && ($section != $displaysection) && ($url = course_get_url($course, $section))) {
                $sectionmenu[$url->out(false)] = get_section_name($course, $section);
            }
            $section++;
        }

        $select = new url_select($sectionmenu, '', array('' => get_string('jumpto')));
        $select->class = 'jumpmenu';
        $select->formid = 'sectionmenu';
        $o .= $this->output->render($select);

        return $o;
    }
protected function section_nav_selection ( $ course , $ sections , $ displaysection ) { global $ CFG ; $ o = '' ; $ sectionmenu = array ( ) ; $ sectionmenu [ course_get_url ( $ course ) -> out ( false ) ] = get_string ( 'maincoursepage' ) ; $ modinfo = get_fast_modinfo ( $ course ) ; $ section = 1 ; $ numsections = course_get_format ( $ course ) -> get_last_section_number ( ) ; while ( $ section <= $ numsections ) { $ thissection = $ modinfo -> get_section_info ( $ section ) ; $ showsection = $ thissection -> uservisible or ! $ course -> hiddensections ; if ( ( $ showsection ) && ( $ section != $ displaysection ) && ( $ url = course_get_url ( $ course , $ section ) ) ) { $ sectionmenu [ $ url -> out ( false ) ] = get_section_name ( $ course , $ section ) ; } $ section ++ ; } $ select = new url_select ( $ sectionmenu , '' , array ( '' => get_string ( 'jumpto' ) ) ) ; $ select -> class = 'jumpmenu' ; $ select -> formid = 'sectionmenu' ; $ o .= $ this -> output -> render ( $ select ) ; return $ o ; }
Generate the html for the 'Jump to' menu on a single section page.

@param stdClass $course The course entry from DB
@param array $sections The course_sections entries from the DB
@param $displaysection the current displayed section number.

@return string HTML to output.
Generate the html for the Jump to menu on a single section page .