MDL-73848 administration: Fix the breadcrumbs and nav highlights

Create or update the breadcrumbs in the site administration
pages where it is required.
Highlight the corresponding site adminstration tab.
Highlight the primary nav to Site administration when user
is navigating to any of the site administration pages.

Also changed the boostnavbar so that the nodes in the secondary
navigation are not shown in the breadcrumbs when user is in site
administration page.
This commit is contained in:
Sujith Haridasan 2022-02-24 12:53:46 +05:30 committed by Jun Pataleta
parent 34ce1463cc
commit aa1c2e2382
61 changed files with 187 additions and 13 deletions

View File

@ -825,6 +825,7 @@ $insecuredataroot = is_dataroot_insecure(true);
$SESSION->admin_critical_warning = ($insecuredataroot==INSECURE_DATAROOT_ERROR);
$adminroot = admin_get_root();
$PAGE->set_primary_active_tab('siteadminnode');
// Check if there are any new admin settings which have still yet to be set
if (any_new_admin_settings($adminroot)) {

View File

@ -52,6 +52,8 @@ $pageurl = new moodle_url('/admin/plugins.php', $pageparams);
$pluginman = core_plugin_manager::instance();
$PAGE->set_primary_active_tab('siteadminnode');
if ($uninstall) {
if (!$confirmed) {

View File

@ -49,6 +49,9 @@ if (optional_param('submit', false, PARAM_BOOL) && data_submitted() && confirm_s
redirect($baseurl);
}
$PAGE->set_secondary_active_tab('users');
$PAGE->set_primary_active_tab('siteadminnode');
$controller->load_current_settings();
// Display the editing form.

View File

@ -87,6 +87,10 @@ if ($action === 'add') {
$title = get_string('editingrolex', 'core_role', $rolenames[$roleid]->localname);
}
$PAGE->set_secondary_active_tab('users');
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->navbar->add($title, $baseurl);
// Decide how to create new role.
if ($action === 'add' and $resettype !== 'none') {
$mform = new core_role_preset_form(null, array('action'=>'add', 'roleid'=>0, 'resettype'=>'0', 'return'=>'manage'));

View File

@ -60,6 +60,9 @@ $undeletableroles[$CFG->notloggedinroleid] = 1;
$undeletableroles[$CFG->guestroleid] = 1;
$undeletableroles[$CFG->defaultuserroleid] = 1;
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->navbar->add(get_string('defineroles', 'role'), $PAGE->url);
// Process submitted data.
$confirmed = (optional_param('confirm', false, PARAM_BOOL) && data_submitted() && confirm_sesskey());
switch ($action) {

View File

@ -37,6 +37,8 @@ try {
// In action cases, we'll throw this exception below. In non-action cases, we produce a lang string error.
}
$PAGE->set_primary_active_tab('siteadminnode');
// Handle all the actions.
if ($action) {
// If dealing with an areaid, we need to check that the area exists.

View File

@ -39,6 +39,9 @@ if ($area === false) {
}
$areaname = $area->get_visible_name();
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->set_secondary_active_tab('modules');
// Start page output.
$heading = get_string('gradualreindex', 'search', '');
$PAGE->set_title($PAGE->title . ': ' . $heading);

View File

@ -118,6 +118,11 @@ if (empty($SITE->fullname)) {
$PAGE->set_title("$SITE->shortname: " . implode(": ",$visiblepathtosection));
$PAGE->set_heading($SITE->fullname);
if ($section === 'frontpagesettings') {
$PAGE->navbar->add(get_string('frontpage', 'admin'),
new moodle_url('/admin/category.php', ['category' => 'frontpage']));
$PAGE->navbar->add(get_string('frontpagesettings', 'admin'), $PAGE->url);
}
echo $OUTPUT->header();
if ($errormsg !== '') {

View File

@ -137,6 +137,10 @@ class base {
$PAGE->navbar->add($title);
}
if ($node = $PAGE->settingsnav->find('tool_admin_presets', \navigation_node::TYPE_SETTING)) {
$node->make_active();
}
echo $OUTPUT->header();
echo $OUTPUT->heading($title);
if ($text) {

View File

@ -52,6 +52,7 @@ $url->param('mode', $mode);
$PAGE->set_url($url);
$PAGE->set_pagelayout('admin');
$PAGE->set_context($context);
$PAGE->set_primary_active_tab('siteadminnode');
// Executes the required action.
$instance = new $classname();

View File

@ -76,10 +76,14 @@ class helper {
$PAGE->set_context($context);
$PAGE->set_url($url);
$PAGE->set_secondary_active_tab('siteadminnode');
$PAGE->set_primary_active_tab('siteadminnode');
if ($siteadmin = $PAGE->settingsnav->find('root', \navigation_node::TYPE_SITE_ADMIN)) {
$PAGE->navbar->add($siteadmin->get_content(), $siteadmin->action());
$PAGE->navbar->add($siteadmin->get_content(), $siteadmin->action(),
\breadcrumb_navigation_node::TYPE_SITE_ADMIN, null, 'root');
}
if ($analytics = $PAGE->settingsnav->find('analytics', \navigation_node::TYPE_SETTING)) {
$PAGE->navbar->add($analytics->get_content(), $analytics->action());
}

View File

@ -38,6 +38,11 @@ admin_externalpage_setup('toolcustomlang', '', null,
array('pagelayout' => 'report')); // Hack: allows for wide page contents.
$PAGE->requires->js_init_call('M.tool_customlang.init_editor', array(), true);
$PAGE->set_context(context_system::instance());
$PAGE->set_secondary_active_tab('siteadminnode');
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->navbar->add(get_string('editlangpack', 'tool_customlang'), $PAGE->url);
if (empty($lng)) {
// PARAM_LANG validation failed

View File

@ -38,6 +38,12 @@ $lng = required_param('lng', PARAM_LANG);
admin_externalpage_setup('toolcustomlang', '', null,
new moodle_url('/admin/tool/customlang/import.php', ['lng' => $lng]));
$PAGE->set_context(context_system::instance());
$PAGE->set_secondary_active_tab('siteadminnode');
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->navbar->add(get_string('import', 'tool_customlang'), $PAGE->url);
$output = $PAGE->get_renderer('tool_customlang');
$form = new import(null, ['lng' => $lng]);

View File

@ -40,6 +40,8 @@ $next = optional_param('next', 'edit', PARAM_ALPHA);
admin_externalpage_setup('toolcustomlang');
$langs = get_string_manager()->get_list_of_translations();
$PAGE->set_primary_active_tab('siteadminnode');
// pre-output actions
if ($action === 'checkout') {
require_sesskey();

View File

@ -50,6 +50,7 @@ $string['customlang:export'] = 'Export local translation';
$string['customlang:view'] = 'View local translation';
$string['export'] = 'Export custom strings';
$string['exportfilter'] = 'Select component(s) to export';
$string['editlangpack'] = 'Edit language pack';
$string['filter'] = 'Filter strings';
$string['filtercomponent'] = 'Show strings of these components';
$string['filtercustomized'] = 'Customised only';

View File

@ -66,6 +66,8 @@ class page_helper {
$PAGE->set_pagelayout('admin');
$PAGE->set_title($title);
$PAGE->set_heading($SITE->fullname);
$PAGE->set_secondary_active_tab('users');
$PAGE->set_primary_active_tab('siteadminnode');
// If necessary, override the settings navigation to add this page into the breadcrumb navigation.
if ($attachtoparentnode) {

View File

@ -47,6 +47,8 @@ $PAGE->navbar->add($title);
$PAGE->set_context($context);
$PAGE->set_pagelayout('admin');
$PAGE->set_title($SITE->fullname. ': ' . $title);
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->set_secondary_active_tab('server');
// Display the page.
echo $OUTPUT->header();

View File

@ -100,6 +100,10 @@ if ($mform->is_cancelled()) {
// Page settings.
$context = context_system::instance();
$PAGE->set_url(new \moodle_url('/admin/tool/filetypes/edit.php', array('oldextension' => $oldextension)));
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->set_secondary_active_tab('server');
$PAGE->navbar->add($oldextension ? s($oldextension) : $title);
$PAGE->set_context($context);
$PAGE->set_pagelayout('admin');

View File

@ -112,6 +112,8 @@ if ($mode == UPDATE_ALL_LANG) {
}
get_string_manager()->reset_caches();
$PAGE->set_primary_active_tab('siteadminnode');
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('langimport', 'tool_langimport'));

View File

@ -32,6 +32,10 @@ $classname = optional_param('classname', '', PARAM_RAW);
$pageurl = new moodle_url('/admin/tool/messageinbound/index.php');
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->navbar->add(get_string('message_handlers', 'tool_messageinbound'), $PAGE->url);
if (empty($classname)) {
$renderer = $PAGE->get_renderer('tool_messageinbound');

View File

@ -33,6 +33,8 @@ if (empty($courseid)) {
$context = context_system::instance();
$coursename = format_string($SITE->fullname, true, array('context' => $context));
$PAGE->set_context($context);
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->set_secondary_active_tab('reports');
} else {
$course = get_course($courseid);
require_login($course);
@ -65,6 +67,7 @@ if (empty($courseid)) {
// Mform setup.
if (!empty($ruleid)) {
$PAGE->navbar->add(get_string('editrule', 'tool_monitor'), $PAGE->url);
$rule = \tool_monitor\rule_manager::get_rule($ruleid)->get_mform_set_data();
$rule->minutes = $rule->timewindow / MINSECS;
$subscriptioncount = \tool_monitor\subscription_manager::count_rule_subscriptions($ruleid);
@ -75,6 +78,7 @@ if (!empty($ruleid)) {
return $classname === $rule->eventname || !$classname::is_deprecated();
}, ARRAY_FILTER_USE_KEY);
} else {
$PAGE->navbar->add(get_string('addrule', 'tool_monitor'), $PAGE->url);
$rule = new stdClass();
$subscriptioncount = 0;

View File

@ -39,6 +39,7 @@ if (empty($courseid)) {
$context = context_system::instance();
$coursename = format_string($SITE->fullname, true, array('context' => $context));
$PAGE->set_context($context);
$PAGE->set_primary_active_tab('siteadminnode');
} else {
$course = get_course($courseid);
require_login($course);
@ -56,7 +57,6 @@ $PAGE->set_pagelayout('report');
$PAGE->set_title($coursename);
$PAGE->set_heading($coursename);
if (!empty($action) && $action == 'changestatus') {
require_sesskey();
require_capability('tool/monitor:managetool', context_system::instance());
@ -74,6 +74,9 @@ if (!empty($action) && $ruleid) {
redirect(new moodle_url('/admin/tool/monitor/managerules.php', array('courseid' => $courseid)));
}
if ($action === 'delete') {
$PAGE->navbar->add(get_string('deleterule', 'tool_monitor'), $PAGE->url);
}
echo $OUTPUT->header();
$rule = \tool_monitor\rule_manager::get_rule($rule);
switch ($action) {

View File

@ -42,6 +42,8 @@ if ($taskname) {
}
}
$PAGE->navbar->add(get_string('scheduledtasks', 'tool_task'), $PAGE->url);
if ($action == 'edit') {
$PAGE->navbar->add(get_string('edittaskschedule', 'tool_task', $task->get_name()));
}
@ -51,6 +53,8 @@ if ($task) {
$nexturl = new moodle_url($PAGE->url, ['lastchanged' => $taskname]);
}
$PAGE->set_primary_active_tab('siteadminnode');
$renderer = $PAGE->get_renderer('tool_task');
if ($mform && ($mform->is_cancelled() || !empty($CFG->preventscheduledtaskchanges) || $task->is_overridden())) {

View File

@ -158,7 +158,9 @@ class manager {
* @param string $action The action to perform.
*/
public function execute($action) {
global $PAGE;
$this->setup_admin_externalpage($action);
$PAGE->set_primary_active_tab('siteadminnode');
// Add the main content.
switch($action) {

View File

@ -42,6 +42,9 @@
$returnurl = new moodle_url('/admin/user.php', array('sort' => $sort, 'dir' => $dir, 'perpage' => $perpage, 'page'=>$page));
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->navbar->add(get_string('userlist', 'admin'), $PAGE->url);
// The $user variable is also used outside of these if statements.
$user = null;
if ($confirmuser and confirm_sesskey()) {

View File

@ -17,6 +17,9 @@ if (empty($SESSION->bulk_users)) {
redirect($return);
}
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->set_secondary_active_tab('users');
echo $OUTPUT->header();
//TODO: add support for large number of users

View File

@ -17,6 +17,9 @@ if (empty($SESSION->bulk_users)) {
redirect($return);
}
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->set_secondary_active_tab('users');
echo $OUTPUT->header();
//TODO: add support for large number of users

View File

@ -20,6 +20,9 @@ $usercount = count($users);
$strnever = get_string('never');
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->set_secondary_active_tab('users');
echo $OUTPUT->header();
$countries = get_string_manager()->get_list_of_countries(true);

View File

@ -88,6 +88,9 @@ if ($dataformat) {
exit;
}
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->set_secondary_active_tab('users');
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('download', 'admin'));
echo $OUTPUT->download_dataformat_selector(get_string('userbulkdownload', 'admin'), 'user_bulk_download.php');

View File

@ -18,6 +18,9 @@ if (empty($SESSION->bulk_users)) {
redirect($return);
}
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->set_secondary_active_tab('users');
echo $OUTPUT->header();
if ($confirm and confirm_sesskey()) {

View File

@ -20,6 +20,9 @@ if (empty($CFG->messaging)) {
print_error('messagingdisable', 'error');
}
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->set_secondary_active_tab('users');
//TODO: add support for large number of users
if ($confirm and !empty($msg) and confirm_sesskey()) {

View File

@ -36,7 +36,11 @@ if ($node && $newnode) {
$node->display = false;
$newnode->make_active();
}
$PAGE->navbar->add(get_string('externalservice', 'webservice'));
$PAGE->navbar->add(get_string('externalservices', 'webservice'),
new moodle_url('/admin/settings.php', ['section' => 'externalservices']));
$PAGE->set_primary_active_tab('siteadminnode');
//Retrieve few general parameters
$id = required_param('id', PARAM_INT);
@ -104,6 +108,12 @@ if ($mform->is_cancelled()) {
redirect($returnurl);
}
if ($id == 0) {
$PAGE->navbar->add(get_string('addexternalservice', 'webservice'), $PAGE->url);
} else {
$PAGE->navbar->add(get_string('editexternalservice', 'webservice'), $PAGE->url);
}
//OUTPUT edit/create form
echo $OUTPUT->header();
$mform->display();

View File

@ -41,6 +41,9 @@ $node = $PAGE->settingsnav->find('externalservices', navigation_node::TYPE_SETTI
if ($node) {
$node->make_active();
}
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->navbar->add(get_string('externalservices', 'webservice'),
new moodle_url('/admin/settings.php', ['section' => 'externalservices']));
$PAGE->navbar->add(get_string('functions', 'webservice'),
new moodle_url('/' . $CFG->admin . '/webservice/service_functions.php', array('id' => $serviceid)));

View File

@ -37,7 +37,12 @@ $fservices = optional_param_array('fservices', [], PARAM_INT);
admin_externalpage_setup('webservicetokens');
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->navbar->add(get_string('managetokens', 'webservice'),
new moodle_url('/admin/webservice/tokens.php'));
if ($action === 'create') {
$PAGE->navbar->add(get_string('createtoken', 'webservice'), $PAGE->url);
$webservicemanager = new webservice();
$mform = new \core_webservice\token_form(null, ['action' => 'create']);
$data = $mform->get_data();
@ -81,6 +86,7 @@ if ($action === 'create') {
}
if ($action === 'delete') {
$PAGE->navbar->add(get_string('deletetoken', 'webservice'), $PAGE->url);
$webservicemanager = new webservice();
$token = $webservicemanager->get_token_by_id_with_details($tokenid);

View File

@ -51,18 +51,20 @@ $PAGE->set_context($context);
if ($context->contextlevel == CONTEXT_COURSECAT) {
core_course_category::page_setup();
// Set the restore course node active in the settings navigation block.
if ($restorecoursenode = $PAGE->settingsnav->find('restorecourse', navigation_node::TYPE_SETTING)) {
$restorecoursenode->make_active();
}
$PAGE->set_secondary_active_tab('restorecourse');
} else if ($context->contextlevel == CONTEXT_COURSE) {
$course = get_course($context->instanceid);
$PAGE->set_heading($course->fullname);
$PAGE->set_secondary_active_tab('coursereuse');
} else if ($context->contextlevel == CONTEXT_SYSTEM) {
$PAGE->set_heading($SITE->fullname);
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->set_secondary_active_tab('courses');
} else {
$PAGE->set_heading($SITE->fullname);
}
// Set the restore course node active in the settings navigation block.
navigation_node::override_active_url(new moodle_url('/backup/restorefile.php', ['contextid' => $contextid]));
$title = get_string('managefiles', 'backup');
$PAGE->navbar->add($title);

4
cache/admin.php vendored
View File

@ -48,6 +48,9 @@ $notifications = array();
// Empty array to hold any form information returned from actions.
$forminfo = [];
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->navbar->add(get_string('cacheconfig', 'cache'), new moodle_url('/cache/admin.php'));
// Handle page actions in admin helper class.
if (!empty($action) && confirm_sesskey()) {
$forminfo = $adminhelper->perform_cache_actions($action, $forminfo);
@ -65,6 +68,7 @@ $title = array_key_exists('title', $forminfo) ? $forminfo['title'] : new lang_st
$PAGE->set_title($title);
$PAGE->set_heading($SITE->fullname);
/** @var \core_cache\output\renderer $renderer */
$renderer = $PAGE->get_renderer('core_cache');

View File

@ -463,6 +463,7 @@ class administration_display_helper extends \core_cache\administration_helper {
redirect($PAGE->url, get_string('addstoresuccess', 'cache', $storepluginsummaries[$plugin]['name']), 5);
}
$PAGE->navbar->add(get_string('addstore', 'cache', 'cache'), $PAGE->url);
return array('form' => $mform, 'title' => $title);
}
@ -573,6 +574,7 @@ class administration_display_helper extends \core_cache\administration_helper {
redirect($PAGE->url);
}
$PAGE->navbar->add(get_string('updatedefinitionmapping', 'cache'), $PAGE->url);
return array('form' => $mform, 'title' => $title);
}
@ -611,6 +613,7 @@ class administration_display_helper extends \core_cache\administration_helper {
redirect($PAGE->url);
}
$PAGE->navbar->add(get_string('updatedefinitionsharing', 'cache'), $PAGE->url);
return array('form' => $mform, 'title' => $title);
}

View File

@ -71,6 +71,12 @@ if ($category) {
$showall = false;
} else {
admin_externalpage_setup('cohorts', '', null, '', array('pagelayout'=>'report'));
$PAGE->set_primary_active_tab('siteadminnode');
if ($showall == 1) {
$PAGE->navbar->add(get_string('allcohorts', 'cohort'), $PAGE->url);
} else if (!$showall) {
$PAGE->navbar->add(get_string('systemcohorts', 'cohort'), $PAGE->url);
}
}
echo $OUTPUT->header();

View File

@ -73,6 +73,7 @@ if ($id) {
$context = context_system::instance();
$fullname = $SITE->fullname;
$title = "$SITE->shortname: $strtitle";
$PAGE->set_secondary_active_tab('courses');
}
$category = new stdClass();

View File

@ -58,6 +58,7 @@ if ($context->contextlevel == CONTEXT_SYSTEM or $context->contextlevel == CONTEX
$admin = true;
$returnurl = "$CFG->wwwroot/grade/edit/letter/index.php";
$editparam = '?edit=1';
$PAGE->set_primary_active_tab('siteadminnode');
} else if ($context->contextlevel == CONTEXT_COURSE) {
$PAGE->set_pagelayout('standard');//calling this here to make blocks display

View File

@ -97,6 +97,8 @@ if ($id) {
if (!$courseid) {
require_once $CFG->libdir.'/adminlib.php';
admin_externalpage_setup('outcomes');
$PAGE->set_primary_active_tab('siteadminnode');
} else {
navigation_node::override_active_url(new moodle_url('/grade/edit/outcome/course.php', ['id' => $courseid]));
$PAGE->navbar->add(get_string('manageoutcomes', 'grades'),

View File

@ -53,6 +53,7 @@ if ($courseid) {
require_once $CFG->libdir.'/adminlib.php';
admin_externalpage_setup('outcomes');
$context = context_system::instance();
$PAGE->set_primary_active_tab('siteadminnode');
}
/// return tracking object

View File

@ -88,6 +88,7 @@ if ($id) {
if (!$courseid) {
require_once $CFG->libdir.'/adminlib.php';
admin_externalpage_setup('scales');
$PAGE->set_primary_active_tab('siteadminnode');
}
// default return url

View File

@ -44,6 +44,7 @@ if ($courseid) {
require_once $CFG->libdir.'/adminlib.php';
admin_externalpage_setup('scales');
$context = context_system::instance();
$PAGE->set_primary_active_tab('siteadminnode');
}
/// return tracking object

View File

@ -124,6 +124,7 @@ $string['editmappings'] = 'Edit mappings';
$string['editsharing'] = 'Edit sharing';
$string['editstore'] = 'Edit store';
$string['editstoresuccess'] = 'Succesfully edited the cache store.';
$string['editdefinitionmapping'] = 'Edit definition mapping';
$string['editdefinitionmappings'] = '{$a} definition store mappings';
$string['editdefinitionsharing'] = 'Edit definition sharing for {$a}';
$string['ex_configcannotsave'] = 'Unable to save the cache config to file.';
@ -207,6 +208,8 @@ $string['supports_keyawareness'] = 'key awareness';
$string['supports_searchable'] = 'searching by key';
$string['tested'] = 'Tested';
$string['testperformance'] = 'Test performance';
$string['updatedefinitionmapping'] = 'Edit definition mapping';
$string['updatedefinitionsharing'] = 'Edit definition sharing';
$string['unsupportedmode'] = 'Unsupported mode';
$string['untestable'] = 'Untestable';
$string['usage_items'] = 'Items';

View File

@ -33,6 +33,7 @@ $string['accountnotavailable'] = 'Not available';
$string['paymentaccountsexplained'] = 'Create one or multiple payment accounts for this site. Each account includes configuration for available payment gateways. The person who configures payments on the site (for example, payment for the course enrolment) will be able to choose from the available accounts.';
$string['createaccount'] = 'Create payment account';
$string['deleteorarchive'] = 'Delete or archive';
$string['editpaymentaccount'] = 'Edit payment account';
$string['eventaccountcreated'] = 'Payment account created';
$string['eventaccountdeleted'] = 'Payment account deleted';
$string['eventaccountupdated'] = 'Payment account updated';

View File

@ -27,6 +27,7 @@ $string['actwebserviceshhdr'] = 'Active web service protocols';
$string['addaservice'] = 'Add service';
$string['addcapabilitytousers'] = 'Check users capability';
$string['addcapabilitytousersdescription'] = 'Users should have two capabilities - webservice:createtoken and a capability matching the protocols used, for example webservice/rest:use, webservice/soap:use. To achieve this, create a web services role with the appropriate capabilities allowed and assign it to the web services user as a system role.';
$string['addexternalservice'] = 'Add external service';
$string['addfunction'] = 'Add function';
$string['addfunctionhelp'] = 'Select the function to add to the service.';
$string['addfunctions'] = 'Add functions';
@ -56,6 +57,7 @@ $string['default'] = 'Default to "{$a}"';
$string['deleteaservice'] = 'Delete service';
$string['deleteservice'] = 'Delete the service: {$a->name} (id: {$a->id})';
$string['deleteserviceconfirm'] = 'Deleting a service will also delete the tokens related to this service. Do you really want to delete external service "{$a}"?';
$string['deletetoken'] = 'Delete token';
$string['deletetokenconfirm'] = 'Do you really want to delete this web service token for <strong>{$a->user}</strong> on the service <strong>{$a->service}</strong>?';
$string['disabledwarning'] = 'All web service protocols are disabled. The "Enable web services" setting can be found in Advanced features.';
$string['doc'] = 'Documentation';
@ -63,6 +65,7 @@ $string['docaccessrefused'] = 'You are not allowed to see the documentation for
$string['downloadfiles'] = 'Can download files';
$string['downloadfiles_help'] = 'If enabled, any user can download files with their security keys. Of course they are restricted to the files they are allowed to download in the site.';
$string['editaservice'] = 'Edit service';
$string['editexternalservice'] = 'Edit external service';
$string['editservice'] = 'Edit the service: {$a->name} (id: {$a->id})';
$string['enabled'] = 'Enabled';
$string['enabledocumentation'] = 'Enable developer documentation';

View File

@ -73,6 +73,9 @@ if ($isupdate) {
$data['isupdate'] = true;
}
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->set_secondary_active_tab('modules');
$form = new mod_lti_register_types_form($pageurl, (object)$data);
if ($form->is_cancelled()) {

View File

@ -144,7 +144,10 @@ if ($data = $form->get_data()) {
}
$PAGE->set_title("$SITE->shortname: " . get_string('toolsetup', 'lti'));
$PAGE->navbar->add(get_string('lti_administration', 'lti'), $CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=modsettinglti');
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->set_secondary_active_tab('ltitoolconfigure');
$PAGE->navbar->add(get_string('manage_external_tools', 'lti'), new moodle_url('/mod/lti/toolconfigure.php'));
$PAGE->navbar->add(get_string('toolsetup', 'lti'), $PAGE->url);
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('toolsetup', 'lti'));

View File

@ -44,7 +44,9 @@ $resetall = optional_param('resetall', false, PARAM_BOOL);
$pagetitle = get_string('mypage', 'admin');
$PAGE->set_secondary_active_tab('appearance');
$PAGE->set_blocks_editing_capability('moodle/my:configsyspages');
$PAGE->set_url(new moodle_url('/my/indexsys.php'));
admin_externalpage_setup('mypage', '', null, '', array('pagelayout' => 'mydashboard'));
$PAGE->add_body_class('limitedwidth');
$PAGE->set_pagetype('my-index');

View File

@ -30,6 +30,8 @@ $showarchived = optional_param('showarchived', false, PARAM_BOOL);
admin_externalpage_setup('paymentaccounts');
$PAGE->set_heading(get_string('paymentaccounts', 'payment'));
$PAGE->set_primary_active_tab('siteadminnode');
$enabledplugins = \core\plugininfo\paygw::get_enabled_plugins();
echo $OUTPUT->header();

View File

@ -46,6 +46,14 @@ if ($restore && $account->get('archived') && confirm_sesskey()) {
redirect(new moodle_url('/payment/accounts.php'));
}
$PAGE->set_secondary_active_tab('siteadminnode');
$PAGE->set_primary_active_tab('siteadminnode');
if ($id == 0) {
$PAGE->navbar->add(get_string('createaccount', 'payment'), $PAGE->url);
} else {
$PAGE->navbar->add(get_string('editpaymentaccount', 'payment'), $PAGE->url);
}
$PAGE->set_heading($id ? format_string($account->get('name')) : get_string('createaccount', 'payment'));
$form = new \core_payment\form\account($pageurl->out(false), ['persistent' => $account]);

View File

@ -47,6 +47,10 @@ if (empty($account) || empty($gateway)) {
}
require_capability('moodle/payment:manageaccounts', $account->get_context());
$PAGE->set_secondary_active_tab('siteadminnode');
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->navbar->add(get_string('createaccount', 'payment'), $PAGE->url);
$PAGE->set_heading($id ? format_string($account->get('name')) : get_string('createaccount', 'payment'));
$form = new \core_payment\form\account_gateway($pageurl->out(false), ['persistent' => $gateway]);

View File

@ -134,6 +134,9 @@ if (isset($allobserverslist[$eventname])) {
$observers = array_merge($observers, $allobserverslist[$eventname]);
}
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->set_secondary_active_tab('reports');
// OUTPUT.
$renderer = $PAGE->get_renderer('report_eventlist');
echo $renderer->render_event_detail($observers, $eventinformation);

View File

@ -144,6 +144,7 @@ if ($PAGE->user_allowed_editing() && $adminediting != -1) {
if ($course->id == $SITE->id) {
admin_externalpage_setup('reportlog', '', null, '', array('pagelayout' => 'report'));
$PAGE->set_title($SITE->shortname .': '. $strlogs);
$PAGE->set_primary_active_tab('siteadminnode');
} else {
$PAGE->set_title($course->shortname .': '. $strlogs);
$PAGE->set_heading($course->fullname);

View File

@ -32,6 +32,7 @@ $requestedqtype = optional_param('qtype', '', PARAM_SAFEDIR);
// Print the header & check permissions.
admin_externalpage_setup('reportquestioninstances', '', null, '', array('pagelayout'=>'report'));
$PAGE->set_primary_active_tab('siteadminnode');
echo $OUTPUT->header();
// Log.

View File

@ -76,6 +76,8 @@ if ($tagcoll) {
$PAGE->set_blocks_editing_capability('moodle/tag:editblocks');
$PAGE->set_primary_active_tab('siteadminnode');
switch($action) {
case 'colladd':

View File

@ -110,9 +110,7 @@ class boostnavbar implements \renderable {
$courseformat->coursedisplay != COURSE_DISPLAY_MULTIPAGE;
}
if (!is_null($this->get_item('root'))) { // We are in site administration.
// Remove the 'Site administration' navbar node as it already exists in the primary navigation menu.
$this->remove('root');
if ($this->page->context->contextlevel == CONTEXT_SYSTEM) {
// Remove the navbar nodes that already exist in the secondary navigation menu.
$this->remove_items_that_exist_in_navigation($PAGE->secondarynav);
}

View File

@ -43,6 +43,9 @@ if (!empty($device)) {
unset($SESSION->theme);
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->navbar->add(get_string('themeselector', 'admin'), $PAGE->url);
if ($reset and confirm_sesskey()) {
theme_reset_all_caches();
} else if ($choose && $confirmation) {

View File

@ -73,6 +73,8 @@ if ($id == -1) {
$user->timezone = '99';
require_capability('moodle/user:create', $systemcontext);
admin_externalpage_setup('addnewuser', '', array('id' => -1));
$PAGE->set_primary_active_tab('siteadminnode');
$PAGE->navbar->add(get_string('addnewuser', 'moodle'), $PAGE->url);
} else {
// Editing existing user.
require_capability('moodle/user:update', $systemcontext);

View File

@ -34,7 +34,7 @@ require_once($CFG->libdir.'/adminlib.php');
$resetall = optional_param('resetall', null, PARAM_BOOL);
$header = "$SITE->shortname: ".get_string('publicprofile')." (".get_string('myprofile', 'admin').")";
$header = "$SITE->fullname: ".get_string('publicprofile')." (".get_string('myprofile', 'admin').")";
$PAGE->set_blocks_editing_capability('moodle/my:configsyspages');
admin_externalpage_setup('profilepage', '', null, '', array('pagelayout' => 'mypublic'));