mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 08:55:15 +02:00
MDL-73379 admin: consistent secondary navigation on settings pages.
Co-authored-by: Adrian Greeve <adrian@moodle.com>
This commit is contained in:
parent
58a729f088
commit
7d61928cfb
@ -140,13 +140,7 @@ if ($errormsg !== '') {
|
||||
echo $OUTPUT->notification($statusmsg, 'notifysuccess');
|
||||
}
|
||||
|
||||
$path = array_reverse($settingspage->visiblepath);
|
||||
if (is_array($path)) {
|
||||
$visiblename = join(' / ', $path);
|
||||
} else {
|
||||
$visiblename = $path;
|
||||
}
|
||||
echo $OUTPUT->heading(get_string('admincategory', 'admin', $visiblename), 2);
|
||||
echo $OUTPUT->heading(get_string('admincategory', 'admin', $settingspage->visiblename), 2);
|
||||
|
||||
echo html_writer::start_tag('form', array('action' => '', 'method' => 'post', 'id' => 'adminsettings'));
|
||||
echo html_writer::start_tag('div');
|
||||
|
@ -13,7 +13,6 @@ $PAGE->set_context(context_system::instance());
|
||||
$PAGE->set_url('/admin/settings.php', array('section' => $section));
|
||||
$PAGE->set_pagetype('admin-setting-' . $section);
|
||||
$PAGE->set_pagelayout('admin');
|
||||
$PAGE->has_secondary_navigation_setter(false);
|
||||
$PAGE->navigation->clear_cache();
|
||||
navigation_node::require_admin_tree();
|
||||
|
||||
|
21
admin/tests/behat/site_administration.feature
Normal file
21
admin/tests/behat/site_administration.feature
Normal file
@ -0,0 +1,21 @@
|
||||
@core @core_admin
|
||||
Feature: Navigate site administration pages
|
||||
In order to configure my site
|
||||
As an admin
|
||||
I need to be able to navigate the site administration pages
|
||||
|
||||
@javascript
|
||||
Scenario: Navigate to an admin category page
|
||||
Given I log in as "admin"
|
||||
When I navigate to "Plugins > Activity modules > Assignment" in site administration
|
||||
# Ensure secondary navigation is still present and "Plugins" is selected.
|
||||
Then "//a[@aria-current = 'true' and normalize-space() = 'Plugins']" "xpath" should exist in the ".secondary-navigation" "css_element"
|
||||
And I should see "Category: Assignment"
|
||||
|
||||
@javascript
|
||||
Scenario: Navigate to an admin settings page
|
||||
Given I log in as "admin"
|
||||
When I navigate to "Plugins > Activity modules > Forum" in site administration
|
||||
# Ensure secondary navigation is still present and "Plugins" is selected.
|
||||
Then "//a[@aria-current = 'true' and normalize-space() = 'Plugins']" "xpath" should exist in the ".secondary-navigation" "css_element"
|
||||
And I should see "Forum"
|
@ -4,6 +4,7 @@
|
||||
],
|
||||
"features": [
|
||||
"lib/tests/behat/action_menu.feature",
|
||||
"admin/tests/behat/site_administration.feature",
|
||||
"blocks/tests/behat/hide_blocks.feature",
|
||||
"blocks/tests/behat/move_blocks.feature",
|
||||
"course/format/tests/behat/course_courseindex.feature",
|
||||
|
Loading…
x
Reference in New Issue
Block a user