mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-21097 Allow user to change current section if he does not have any other manageing capability
This commit is contained in:
parent
1fda836ca6
commit
53dda4f2fc
@ -35,6 +35,20 @@ require_once($CFG->dirroot.'/course/format/renderer.php');
|
||||
*/
|
||||
class format_topics_renderer extends format_section_renderer_base {
|
||||
|
||||
/**
|
||||
* Constructor method, calls the parent constructor
|
||||
*
|
||||
* @param moodle_page $page
|
||||
* @param string $target one of rendering target constants
|
||||
*/
|
||||
public function __construct(moodle_page $page, $target) {
|
||||
parent::__construct($page, $target);
|
||||
|
||||
// Since format_topics_renderer::section_edit_controls() only displays the 'Set current section' control when editing mode is on
|
||||
// we need to be sure that the link 'Turn editing mode on' is available for a user who does not have any other managing capability.
|
||||
$page->set_other_editing_capability('moodle/course:setcurrentsection');
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the starting container html for a list of sections
|
||||
* @return string HTML to output.
|
||||
|
Loading…
x
Reference in New Issue
Block a user