mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
webservice MDL-24372 manage token doesn't appear twice in the admin menu when create a new token
This commit is contained in:
parent
c8ea6c60ab
commit
fc0c3d6fbe
1 changed files with 8 additions and 13 deletions
|
@ -32,21 +32,16 @@ $action = optional_param('action', '', PARAM_ACTION);
|
||||||
$tokenid = optional_param('tokenid', '', PARAM_SAFEDIR);
|
$tokenid = optional_param('tokenid', '', PARAM_SAFEDIR);
|
||||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||||
|
|
||||||
$PAGE->set_url('/' . $CFG->admin . '/webservice/tokens.php');
|
|
||||||
$PAGE->navbar->ignore_active(true);
|
|
||||||
$PAGE->navbar->add(get_string('administrationsite'));
|
|
||||||
$PAGE->navbar->add(get_string('plugins', 'admin'));
|
|
||||||
$PAGE->navbar->add(get_string('webservices', 'webservice'));
|
|
||||||
$PAGE->navbar->add(get_string('managetokens', 'webservice'),
|
|
||||||
new moodle_url('/' . $CFG->admin . '/settings.php?section=webservicetokens'));
|
|
||||||
if ($action == "delete") {
|
|
||||||
$PAGE->navbar->add(get_string('delete'));
|
|
||||||
} else {
|
|
||||||
$PAGE->navbar->add(get_string('createtoken', 'webservice'));
|
|
||||||
}
|
|
||||||
|
|
||||||
admin_externalpage_setup('addwebservicetoken');
|
admin_externalpage_setup('addwebservicetoken');
|
||||||
|
|
||||||
|
//Deactivate the second 'Manage token' navigation node, and use the main 'Manage token' navigation node
|
||||||
|
$node = $PAGE->settingsnav->find('addwebservicetoken', navigation_node::TYPE_SETTING);
|
||||||
|
$newnode = $PAGE->settingsnav->find('webservicetokens', navigation_node::TYPE_SETTING);
|
||||||
|
if ($node && $newnode) {
|
||||||
|
$node->display = false;
|
||||||
|
$newnode->make_active();
|
||||||
|
}
|
||||||
|
|
||||||
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
|
||||||
|
|
||||||
$tokenlisturl = new moodle_url("/" . $CFG->admin . "/settings.php", array('section' => 'webservicetokens'));
|
$tokenlisturl = new moodle_url("/" . $CFG->admin . "/settings.php", array('section' => 'webservicetokens'));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue