From a7ccf77d6c8c73c9c6ee7d42539f233a3b9c5c43 Mon Sep 17 00:00:00 2001 From: Neill Magill Date: Mon, 2 Jul 2018 11:36:31 +0100 Subject: [PATCH] Cog menu on teacher page under Boost based themes --- export.php | 1 + manage.php | 1 + preferences.php | 1 + report.php | 1 + sessions.php | 1 + tempusers.php | 1 + tests/behat/report.feature | 14 ++++++-------- 7 files changed, 12 insertions(+), 8 deletions(-) diff --git a/export.php b/export.php index c940070..1dba658 100644 --- a/export.php +++ b/export.php @@ -44,6 +44,7 @@ $att = new mod_attendance_structure($att, $cm, $course, $context); $PAGE->set_url($att->url_export()); $PAGE->set_title($course->shortname. ": ".$att->name); $PAGE->set_heading($course->fullname); +$PAGE->force_settings_menu(true); $PAGE->set_cacheable(true); $PAGE->navbar->add(get_string('export', 'attendance')); diff --git a/manage.php b/manage.php index c8b5514..468cdfe 100644 --- a/manage.php +++ b/manage.php @@ -75,6 +75,7 @@ $PAGE->set_url($att->url_manage()); $PAGE->set_title($course->shortname. ": ".$att->name); $PAGE->set_heading($course->fullname); $PAGE->set_cacheable(true); +$PAGE->force_settings_menu(true); $PAGE->navbar->add($att->name); $output = $PAGE->get_renderer('mod_attendance'); diff --git a/preferences.php b/preferences.php index 3e6305e..f83e555 100644 --- a/preferences.php +++ b/preferences.php @@ -52,6 +52,7 @@ $att = new mod_attendance_structure($att, $cm, $course, $context, $pageparams); $PAGE->set_url($att->url_preferences()); $PAGE->set_title($course->shortname. ": ".$att->name.' - '.get_string('settings', 'attendance')); $PAGE->set_heading($course->fullname); +$PAGE->force_settings_menu(true); $PAGE->set_cacheable(true); $PAGE->navbar->add(get_string('settings', 'attendance')); diff --git a/report.php b/report.php index f30c69c..96e552d 100644 --- a/report.php +++ b/report.php @@ -56,6 +56,7 @@ $PAGE->set_url($att->url_report()); $PAGE->set_pagelayout('report'); $PAGE->set_title($course->shortname. ": ".$att->name.' - '.get_string('report', 'attendance')); $PAGE->set_heading($course->fullname); +$PAGE->force_settings_menu(true); $PAGE->set_cacheable(true); $PAGE->navbar->add(get_string('report', 'attendance')); diff --git a/sessions.php b/sessions.php index 18ebfb0..daf47d2 100644 --- a/sessions.php +++ b/sessions.php @@ -58,6 +58,7 @@ $att = new mod_attendance_structure($att, $cm, $course, $context, $pageparams); $PAGE->set_url($att->url_sessions(array('action' => $pageparams->action))); $PAGE->set_title($course->shortname. ": ".$att->name); $PAGE->set_heading($course->fullname); +$PAGE->force_settings_menu(true); $PAGE->set_cacheable(true); $PAGE->navbar->add($att->name); diff --git a/tempusers.php b/tempusers.php index 657f0dc..4a856d3 100644 --- a/tempusers.php +++ b/tempusers.php @@ -42,6 +42,7 @@ require_capability('mod/attendance:managetemporaryusers', $context); $PAGE->set_title($course->shortname.": ".$att->name.' - '.get_string('tempusers', 'attendance')); $PAGE->set_heading($course->fullname); +$PAGE->force_settings_menu(true); $PAGE->set_cacheable(true); $PAGE->navbar->add(get_string('tempusers', 'attendance')); diff --git a/tests/behat/report.feature b/tests/behat/report.feature index a6e5585..3667b8f 100644 --- a/tests/behat/report.feature +++ b/tests/behat/report.feature @@ -22,8 +22,6 @@ Feature: Visiting reports And I add a "Attendance" to section "1" and I fill the form with: | Name | Attendance | And I follow "Attendance" - And I follow "Add a block" - And I follow "Administration" And I follow "Add session" And I set the following fields to these values: | id_sestime_starthour | 01 | @@ -41,7 +39,7 @@ Feature: Visiting reports Given I log in as "teacher1" And I am on "Course 1" course homepage And I follow "Attendance" - And I follow "Edit settings" + And I navigate to "Edit settings" in current page administration Then I set the following fields to these values: | id_grade_modgrade_type | Point | | id_grade_modgrade_point | 50 | @@ -75,7 +73,7 @@ Feature: Visiting reports Given I log in as "teacher1" And I am on "Course 1" course homepage And I follow "Attendance" - And I follow "Edit settings" + And I navigate to "Edit settings" in current page administration Then I set the following fields to these values: | id_grade_modgrade_type | Point | | id_grade_modgrade_point | 50 | @@ -88,7 +86,7 @@ Feature: Visiting reports And I press "Save attendance" When I follow "Attendance" - And I follow "Edit settings" + And I navigate to "Edit settings" in current page administration Then I set the following fields to these values: | id_grade_modgrade_type | Point | | id_grade_modgrade_point | 70 | @@ -114,7 +112,7 @@ Feature: Visiting reports When I log in as "teacher1" And I am on "Course 1" course homepage And I follow "Attendance" - And I follow "Edit settings" + And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | id_grade_modgrade_type | Point | | id_grade_modgrade_point | 50 | @@ -156,7 +154,7 @@ Feature: Visiting reports Given I log in as "teacher1" And I am on "Course 1" course homepage And I follow "Attendance" - And I follow "Edit settings" + And I navigate to "Edit settings" in current page administration And I set the following fields to these values: | id_grade_modgrade_type | Point | | id_grade_modgrade_point | 50 | @@ -203,7 +201,7 @@ Feature: Visiting reports Given I log in as "teacher1" And I am on "Course 1" course homepage And I follow "Attendance" - And I follow "Edit settings" + And I navigate to "Edit settings" in current page administration Then I set the following fields to these values: | id_grade_modgrade_type | Point | | id_grade_modgrade_point | 50 |