MDL-87708 core: Remove MoodleNet navigation entries
Part of MDL-87350
This commit is contained in:
committed by
Huong Nguyen
parent
f594589084
commit
338ab0f0dd
@@ -16,7 +16,6 @@
|
||||
|
||||
namespace core_courseformat\output\local\content;
|
||||
|
||||
use core\moodlenet\utilities;
|
||||
use core\output\named_templatable;
|
||||
use core_courseformat\base as course_format;
|
||||
use core_courseformat\output\local\courseformat_named_templatable;
|
||||
@@ -132,18 +131,6 @@ class bulkedittools implements named_templatable, renderable {
|
||||
];
|
||||
}
|
||||
|
||||
$usercanshare = utilities::can_user_share($context, $user->id, 'course');
|
||||
if ($CFG->enablesharingtomoodlenet && $usercanshare) {
|
||||
$controls['sharetomoodlenet'] = [
|
||||
'id' => 'cmShareToMoodleNet',
|
||||
'icon' => 'i/share',
|
||||
'action' => 'cmShareToMoodleNet',
|
||||
'name' => get_string('moodlenet:sharetomoodlenet'),
|
||||
'title' => get_string('moodlenet:sharetomoodlenet'),
|
||||
'bulk' => 'cm',
|
||||
];
|
||||
}
|
||||
|
||||
return $controls;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ use core\exception\coding_exception;
|
||||
use core\output\action_link;
|
||||
use core\output\pix_icon;
|
||||
use core\url;
|
||||
use core\moodlenet\utilities;
|
||||
use core_contentbank\contentbank;
|
||||
use core_plugin_manager;
|
||||
use dml_missing_record_exception;
|
||||
@@ -425,46 +424,6 @@ class settings_navigation extends navigation_node {
|
||||
$coursenode->force_open();
|
||||
}
|
||||
|
||||
// MoodleNet links.
|
||||
if ($this->page->user_is_editing()) {
|
||||
$this->page->requires->js_call_amd('core/moodlenet/mutations', 'init');
|
||||
}
|
||||
$usercanshare = utilities::can_user_share($coursecontext, $USER->id, 'course');
|
||||
$issuerid = get_config('moodlenet', 'oauthservice');
|
||||
try {
|
||||
$issuer = \core\oauth2\api::get_issuer($issuerid);
|
||||
$isvalidinstance = utilities::is_valid_instance($issuer);
|
||||
if ($usercanshare && $isvalidinstance) {
|
||||
$this->page->requires->js_call_amd('core/moodlenet/send_resource', 'init');
|
||||
$action = new action_link(new url(''), '', null, [
|
||||
'data-action' => 'sendtomoodlenet',
|
||||
'data-type' => 'course',
|
||||
]);
|
||||
// Share course to MoodleNet link.
|
||||
$coursenode->add(
|
||||
get_string('moodlenet:sharetomoodlenet', 'moodle'),
|
||||
$action,
|
||||
self::TYPE_SETTING,
|
||||
null,
|
||||
'exportcoursetomoodlenet'
|
||||
)->set_force_into_more_menu(true);
|
||||
// MoodleNet share progress link.
|
||||
$url = new url('/moodlenet/shareprogress.php');
|
||||
$coursenode->add(
|
||||
get_string('moodlenet:shareprogress'),
|
||||
$url,
|
||||
self::TYPE_SETTING,
|
||||
null,
|
||||
'moodlenetshareprogress'
|
||||
)->set_force_into_more_menu(true);
|
||||
}
|
||||
} catch (dml_missing_record_exception $e) {
|
||||
debugging(
|
||||
"Invalid MoodleNet OAuth 2 service set in site administration: 'moodlenet | oauthservice'. " .
|
||||
"This must be a valid issuer."
|
||||
);
|
||||
}
|
||||
|
||||
if ($adminoptions->update) {
|
||||
// Add the course settings link.
|
||||
$url = new url('/course/edit.php', ['id' => $course->id]);
|
||||
@@ -884,31 +843,6 @@ class settings_navigation extends navigation_node {
|
||||
$function($this, $modulenode);
|
||||
}
|
||||
|
||||
// Send activity to MoodleNet.
|
||||
$usercanshare = utilities::can_user_share($this->context->get_course_context(), $USER->id);
|
||||
$issuerid = get_config('moodlenet', 'oauthservice');
|
||||
try {
|
||||
$issuer = \core\oauth2\api::get_issuer($issuerid);
|
||||
$isvalidinstance = utilities::is_valid_instance($issuer);
|
||||
if ($usercanshare && $isvalidinstance) {
|
||||
$this->page->requires->js_call_amd('core/moodlenet/send_resource', 'init');
|
||||
$action = new action_link(new url(''), '', null, [
|
||||
'data-action' => 'sendtomoodlenet',
|
||||
'data-type' => 'activity',
|
||||
]);
|
||||
$modulenode->add(
|
||||
get_string('moodlenet:sharetomoodlenet', 'moodle'),
|
||||
$action,
|
||||
self::TYPE_SETTING,
|
||||
null,
|
||||
'exportmoodlenet'
|
||||
)->set_force_into_more_menu(true);
|
||||
}
|
||||
} catch (dml_missing_record_exception $e) {
|
||||
debugging("Invalid MoodleNet OAuth 2 service set in site administration: 'moodlenet | oauthservice'. " .
|
||||
"This must be a valid issuer.");
|
||||
}
|
||||
|
||||
// Remove the module node if there are no children.
|
||||
if ($modulenode->children->count() <= 0) {
|
||||
$modulenode->remove();
|
||||
|
||||
@@ -124,7 +124,6 @@ class secondary extends view {
|
||||
'backup' => 9,
|
||||
'restore' => 10,
|
||||
'competencybreakdown' => 11,
|
||||
'sendtomoodlenet' => 16,
|
||||
],
|
||||
self::TYPE_CUSTOM => [
|
||||
'advgrading' => 2,
|
||||
|
||||
Reference in New Issue
Block a user