MDL-74284 cohort: set page title on upload tab.

Override active URL when viewing system/all cohorts for consistent
breadcrumb navigation.
This commit is contained in:
Paul Holden
2022-09-20 13:09:11 +01:00
parent b077af7e89
commit 3c3f6abd43
3 changed files with 10 additions and 6 deletions
+7 -5
View File
@@ -71,11 +71,13 @@ 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);
navigation_node::override_active_url(new moodle_url('/cohort/index.php'));
if ($showall) {
$strallcohorts = get_string('allcohorts', 'cohort');
$PAGE->set_title($strallcohorts);
$PAGE->navbar->add($strallcohorts, $PAGE->url);
} else {
$PAGE->set_title(get_string('systemcohorts', 'cohort'));
}
}
+1
View File
@@ -69,6 +69,7 @@ if ($uploadform->is_cancelled()) {
}
$strheading = get_string('uploadcohorts', 'cohort');
$PAGE->set_title($strheading);
$PAGE->navbar->add($strheading);
echo $OUTPUT->header();
@@ -13,10 +13,11 @@ Feature: Verify the breadcrumbs in users account and cohort site administration
And "Add a new user" "text" should exist in the ".breadcrumb" "css_element"
And "Accounts" "link" should exist in the ".breadcrumb" "css_element"
And I navigate to "Users > Accounts > Cohorts" in site administration
And "System cohorts" "text" should exist in the ".breadcrumb" "css_element"
And "Cohorts" "text" should exist in the ".breadcrumb" "css_element"
And "Accounts" "link" should exist in the ".breadcrumb" "css_element"
When I click on "All cohorts" "link"
Then "All cohorts" "text" should exist in the ".breadcrumb" "css_element"
And "Cohorts" "link" should exist in the ".breadcrumb" "css_element"
And "Accounts" "link" should exist in the ".breadcrumb" "css_element"
And I click on "Add new cohort" "link"
And "Add new cohort" "text" should exist in the ".breadcrumb" "css_element"