public function format_summary_text($section) { return parent::format_summary_text($section); }
/** * Generate the edit controls of a section * * @param stdClass $course The course entry from DB * @param stdClass $section The course_section entry from DB * @param bool $onsectionpage true if being printed on a section page * @return array of links with edit controls */ protected function section_edit_controls($course, $section, $onsectionpage = false) { global $PAGE; if (!$PAGE->user_is_editing()) { return array(); } $coursecontext = context_course::instance($course->id); if ($onsectionpage) { $url = course_get_url($course, $section->section); } else { $url = course_get_url($course); } $url->param('sesskey', sesskey()); $controls = array(); if (has_capability('moodle/course:setcurrentsection', $coursecontext)) { if ($course->marker == $section->section) { // Show the "light globe" on/off. $url->param('marker', 0); $strmarkedthissection = get_string('markedthissection', 'format_grid'); $controls[] = html_writer::link($url, html_writer::empty_tag('img', array('src' => $this->output->pix_url('i/marked'), 'class' => 'icon ', 'alt' => $strmarkedthissection)), array('title' => $strmarkedthissection, 'class' => 'editing_highlight')); } else { $strmarkthissection = get_string('markthissection', 'format_grid'); $url->param('marker', $section->section); $controls[] = html_writer::link($url, html_writer::empty_tag('img', array('src' => $this->output->pix_url('i/marker'), 'class' => 'icon', 'alt' => $strmarkthissection)), array('title' => $strmarkthissection, 'class' => 'editing_highlight')); } } return array_merge($controls, parent::section_edit_controls($course, $section, $onsectionpage)); }