Skip to content

Commit

Permalink
webservice MDL-24372 manage token doesn't appear twice in the admin m…
Browse files Browse the repository at this point in the history
…enu when create a new token
  • Loading branch information
mouneyrac committed Oct 6, 2010
1 parent c8ea6c6 commit fc0c3d6
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions admin/webservice/tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,16 @@
$tokenid = optional_param('tokenid', '', PARAM_SAFEDIR);
$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');

//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));

$tokenlisturl = new moodle_url("/" . $CFG->admin . "/settings.php", array('section' => 'webservicetokens'));
Expand Down

0 comments on commit fc0c3d6

Please sign in to comment.