MDL-73840 mod_feedback: Remove the duplicate navigation selector

The patch removes the duplicate navigation selector which appears in the
'Show non-respondents' page by removing the 'nonrespondents' node from
the module's settings navigation. Additionally, it highlights the
'Responses' item in the secondary navigation and sets it as active in
the module settings navigation.
This commit is contained in:
Mihail Geshoski
2022-02-14 17:48:30 +08:00
parent d24a4ab56f
commit 2a920abd5b
2 changed files with 4 additions and 6 deletions
-6
View File
@@ -2850,12 +2850,6 @@ function feedback_extend_settings_navigation(settings_navigation $settings,
$feedbacknode->add(get_string(($hassecondary ? 'responses' : 'show_entries'), 'feedback'),
new moodle_url('/mod/feedback/show_entries.php', ['id' => $PAGE->cm->id]),
navigation_node::TYPE_CUSTOM, null, 'responses');
if ($feedback->anonymous == FEEDBACK_ANONYMOUS_NO AND $feedback->course != SITEID) {
$feedbacknode->add(get_string('show_nonrespondents', 'feedback'),
new moodle_url('/mod/feedback/show_nonrespondents.php', ['id' => $PAGE->cm->id]),
navigation_node::TYPE_CUSTOM, null, 'nonrespondents');
}
} else {
$feedbackcompletion = new mod_feedback_completion($feedback, $context, $PAGE->course->id);
if ($feedbackcompletion->can_view_analysis()) {
+4
View File
@@ -137,6 +137,10 @@ if ($action == 'sendmessage' AND $canbulkmessaging) {
/// Print the page header
$PAGE->set_heading($course->fullname);
$PAGE->set_title($feedback->name);
$PAGE->set_secondary_active_tab('responses');
if ($responsesnode = $PAGE->settingsnav->find('responses', navigation_node::TYPE_CUSTOM)) {
$responsesnode->make_active();
}
$PAGE->activityheader->set_attrs([
'hidecompletion' => true,
'description' => ''