diff --git a/course/tests/behat/course_download_content.feature b/course/tests/behat/course_download_content.feature index 830c2b9fda9..cdbb825c778 100644 --- a/course/tests/behat/course_download_content.feature +++ b/course/tests/behat/course_download_content.feature @@ -30,8 +30,7 @@ Feature: Course content can be downloaded Scenario: A student can download course content when the feature is enabled in their course Given I log in as "student1" When I am on "Hockey 101" course homepage - And "Download course content" "button" should exist - And I press "Download course content" + And I navigate to "Download course content" in current page administration Then I should see "You are about to download a zip file" # Without the ability to check the downloaded file, the absence of an exception being thrown here is considered a success. And I click on "Download" "button" in the "Download course content" "dialogue" diff --git a/course/tests/behat/course_download_content_permissions.feature b/course/tests/behat/course_download_content_permissions.feature index 29fd590d3f0..1050b7a5e01 100644 --- a/course/tests/behat/course_download_content_permissions.feature +++ b/course/tests/behat/course_download_content_permissions.feature @@ -95,10 +95,10 @@ Feature: Access to downloading course content can be controlled And I set the field "Enable download course content" to "Yes" And I press "Save and display" And I log out - # Check student can see download button. + # Check student can see the download link. And I log in as "student1" And I am on "Hockey 101" course homepage - And "Download course content" "button" should exist + And "Download course content" "link" should exist in current page administration And I log out And I log in as "admin" # Remove student's capability for download course content. @@ -106,7 +106,7 @@ Feature: Access to downloading course content can be controlled | capability | permission | | moodle/course:downloadcoursecontent | Prohibit | And I log out - # Check student can no longer see download button. + # Check student can no longer see the download link. And I log in as "student1" And I am on "Hockey 101" course homepage Then "Download course content" "link" should not exist in current page administration diff --git a/course/view.php b/course/view.php index a044882be6e..77ef8fae897 100644 --- a/course/view.php +++ b/course/view.php @@ -219,12 +219,6 @@ if ($PAGE->user_allowed_editing()) { $buttons = $OUTPUT->edit_button($PAGE->url); $PAGE->set_button($buttons); - } else if ($candownloadcourse) { - // Show the download course content button if user has permission to access it. - // Only showing this if user doesn't have edit rights, since those who do will access it via the actions menu. - $buttonattr = \core_course\output\content_export_link::get_attributes($context); - $button = new single_button($buttonattr->url, $buttonattr->displaystring, 'post', false, $buttonattr->elementattributes); - $PAGE->set_button($OUTPUT->render($button)); } // If viewing a section, make the title more specific diff --git a/lib/enrollib.php b/lib/enrollib.php index 3c4847209ca..95daf7b56a7 100644 --- a/lib/enrollib.php +++ b/lib/enrollib.php @@ -517,7 +517,7 @@ function enrol_add_course_navigation(navigation_node $coursenode, $course) { if ($unenrollink = $plugin->get_unenrolself_link($instance)) { $shortname = format_string($course->shortname, true, array('context' => $coursecontext)); $coursenode->add(get_string('unenrolme', 'core_enrol', $shortname), $unenrollink, navigation_node::TYPE_SETTING, null, 'unenrolself', new pix_icon('i/user', '')); - $coursenode->get('unenrolself')->set_force_into_more_menu(); + $coursenode->get('unenrolself')->set_force_into_more_menu(true); break; //TODO. deal with multiple unenrol links - not likely case, but still... } diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 9bb60f9eae7..54cbe6afb6d 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -4737,14 +4737,13 @@ class settings_navigation extends navigation_node { } // Prepare data for course content download functionality if it is enabled. - // Will only be included here if the action menu is already in use, otherwise a button will be added to the UI elsewhere. - if (\core\content::can_export_context($coursecontext, $USER) && !empty($coursenode->get_children_key_list())) { + if (\core\content::can_export_context($coursecontext, $USER)) { $linkattr = \core_course\output\content_export_link::get_attributes($coursecontext); $actionlink = new action_link($linkattr->url, $linkattr->displaystring, null, $linkattr->elementattributes); $coursenode->add($linkattr->displaystring, $actionlink, self::TYPE_SETTING, null, 'download', new pix_icon('t/download', '')); - $coursenode->get('download')->set_force_into_more_menu(); + $coursenode->get('download')->set_force_into_more_menu(true); } // Return we are done