MDL-80458 core: Hide MoodleNet share bulk option if feature disabled

This commit is contained in:
Michael Hawkins 2024-01-23 19:21:57 +08:00
parent 580c009cac
commit d1d85aa711
No known key found for this signature in database
GPG Key ID: 81FCB1395B8AA779

View File

@ -83,7 +83,7 @@ class bulkedittools implements named_templatable, renderable {
* @return array of edit control items
*/
protected function cm_control_items(): array {
global $USER;
global $CFG, $USER;
$format = $this->format;
$context = $format->get_context();
$user = $USER;
@ -133,7 +133,7 @@ class bulkedittools implements named_templatable, renderable {
}
$usercanshare = utilities::can_user_share($context, $user->id, 'course');
if ($usercanshare) {
if ($CFG->enablesharingtomoodlenet && $usercanshare) {
$controls['sharetomoodlenet'] = [
'id' => 'cmShareToMoodleNet',
'icon' => 'i/share',