Merge branch 'MDL-77572_402' of https://github.com/santoshndev/moodle into MOODLE_402_STABLE
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
namespace core_courseformat\output\local\content;
|
||||
|
||||
use cm_info;
|
||||
use context_course;
|
||||
use core\activity_dates;
|
||||
use core\output\named_templatable;
|
||||
use core_availability\info_module;
|
||||
@@ -278,7 +279,13 @@ class cm implements named_templatable, renderable {
|
||||
* @return bool if the cm has editor data
|
||||
*/
|
||||
protected function add_editor_data(stdClass &$data, renderer_base $output): bool {
|
||||
if (!$this->format->show_editor()) {
|
||||
$course = $this->format->get_course();
|
||||
$coursecontext = context_course::instance($course->id);
|
||||
$editcaps = [];
|
||||
if (has_capability('moodle/course:activityvisibility', $coursecontext)) {
|
||||
$editcaps = ['moodle/course:activityvisibility'];
|
||||
}
|
||||
if (!$this->format->show_editor($editcaps)) {
|
||||
return false;
|
||||
}
|
||||
$returnsection = $this->format->get_section_number();
|
||||
|
||||
@@ -283,11 +283,16 @@ class section implements named_templatable, renderable {
|
||||
* @return bool if the cm has name data
|
||||
*/
|
||||
protected function add_editor_data(stdClass &$data, renderer_base $output): bool {
|
||||
if (!$this->format->show_editor()) {
|
||||
$course = $this->format->get_course();
|
||||
$coursecontext = context_course::instance($course->id);
|
||||
$editcaps = [];
|
||||
if (has_capability('moodle/course:sectionvisibility', $coursecontext)) {
|
||||
$editcaps = ['moodle/course:sectionvisibility'];
|
||||
}
|
||||
if (!$this->format->show_editor($editcaps)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$course = $this->format->get_course();
|
||||
if (empty($this->hidecontrols)) {
|
||||
$controlmenu = new $this->controlmenuclass($this->format, $this->section);
|
||||
$data->controlmenu = $controlmenu->export_for_template($output);
|
||||
|
||||
+1
-1
@@ -1691,7 +1691,7 @@ function course_get_cm_edit_actions(cm_info $mod, $indent = -1, $sr = null) {
|
||||
}
|
||||
|
||||
// Move (only for component compatible formats).
|
||||
if ($usecomponents) {
|
||||
if ($hasmanageactivities && $usecomponents) {
|
||||
$actions['move'] = new action_menu_link_secondary(
|
||||
new moodle_url($baseurl, [
|
||||
'sesskey' => sesskey(),
|
||||
|
||||
Reference in New Issue
Block a user