Skip to content

Commit

Permalink
MDL-21097 Allow user to change current section if he does not have an…
Browse files Browse the repository at this point in the history
…y other manageing capability
  • Loading branch information
marinaglancy committed May 31, 2013
1 parent 1fda836 commit 53dda4f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions course/format/topics/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@
*/
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.
Expand Down

0 comments on commit 53dda4f

Please sign in to comment.