From 8efe31ee9671e77ced832968ab039d4c2080fc7d Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Tue, 26 Mar 2024 13:28:58 +0100 Subject: [PATCH 1/2] MDL-73975 course: Final deprecation methods in management_renderer Final deprecation for management_heading() and course_search_form() in core_course_management_renderer. --- course/classes/management_renderer.php | 64 +++++++------------------- course/upgrade.txt | 2 + theme/boost/scss/moodle/course.scss | 37 --------------- theme/boost/style/moodle.css | 29 ------------ theme/classic/style/moodle.css | 29 ------------ 5 files changed, 18 insertions(+), 143 deletions(-) diff --git a/course/classes/management_renderer.php b/course/classes/management_renderer.php index 60a4844b548..3d64a3a7eaf 100644 --- a/course/classes/management_renderer.php +++ b/course/classes/management_renderer.php @@ -62,40 +62,16 @@ class core_course_management_renderer extends plugin_renderer_base { } /** - * Displays a heading for the management pages. - * * @deprecated since Moodle 4.0. This is now handled/replaced with the tertiary navigation - * @todo Final deprecation MDL-73975 - * @param string $heading The heading to display - * @param string|null $viewmode The current view mode if there are options. - * @param int|null $categoryid The currently selected category if there is one. - * @return string */ - public function management_heading($heading, $viewmode = null, $categoryid = null) { - debugging('management_heading() is deprecated. Use the class manage_categories_action_bar instead.', DEBUG_DEVELOPER); - - $html = html_writer::start_div('coursecat-management-header clearfix'); - if (!empty($heading)) { - $html .= $this->heading($heading); - } - if ($viewmode !== null) { - $html .= html_writer::start_div(); - $html .= $this->view_mode_selector(\core_course\management\helper::get_management_viewmodes(), $viewmode); - if ($viewmode === 'courses') { - $categories = core_course_category::make_categories_list(array('moodle/category:manage', 'moodle/course:create')); - $nothing = false; - if ($categoryid === null) { - $nothing = array('' => get_string('selectacategory')); - $categoryid = ''; - } - $select = new single_select($this->page->url, 'categoryid', $categories, $categoryid, $nothing); - $select->attributes['aria-label'] = get_string('selectacategory'); - $html .= $this->render($select); - } - $html .= html_writer::end_div(); - } - $html .= html_writer::end_div(); - return $html; + #[\core\attribute\deprecated( + replacement: 'manage_categories_action_bar', + since: '4.0', + mdl: 'MDL-73462', + final: true, + )] + public function management_heading() { + \core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]); } /** @@ -1301,24 +1277,16 @@ class core_course_management_renderer extends plugin_renderer_base { } /** - * Renders html to display a course search form - * * @deprecated since Moodle 4.0. This is now handled within manage_categories_action_bar - * @todo Final deprecation MDL-73975 - * @param string $value default value to populate the search field - * @return string */ - public function course_search_form($value = '') { - debugging('course_search_form() is deprecated. Use the class manage_categories_action_bar instead.', DEBUG_DEVELOPER); - $data = [ - 'action' => new moodle_url('/course/management.php'), - 'btnclass' => 'btn-primary', - 'extraclasses' => 'my-3 d-flex justify-content-center', - 'inputname' => 'search', - 'searchstring' => get_string('searchcourses'), - 'value' => $value - ]; - return $this->render_from_template('core/search_input', $data); + #[\core\attribute\deprecated( + replacement: 'manage_categories_action_bar', + since: '4.0', + mdl: 'MDL-73462', + final: true, + )] + public function course_search_form() { + \core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]); } /** diff --git a/course/upgrade.txt b/course/upgrade.txt index 2131c56c033..77eff50c0dd 100644 --- a/course/upgrade.txt +++ b/course/upgrade.txt @@ -19,6 +19,8 @@ information provided here is intended especially for developers. - `course_purge_section_cache` - `course_purge_module_cache` - `get_array_of_activities` + - `core_course_management_renderer::management_heading` + - `core_course_management_renderer::course_search_form` * New format actions classes. Those classes will eventually replace all course/lib.php content editing functions. All new methods are distributed in three classes formats can extend. Method can be accessed using static methods (see doc block of core_courseformat\formatactions for more information). diff --git a/theme/boost/scss/moodle/course.scss b/theme/boost/scss/moodle/course.scss index 7a3c5c47fa0..a0eeb56ec1d 100644 --- a/theme/boost/scss/moodle/course.scss +++ b/theme/boost/scss/moodle/course.scss @@ -985,43 +985,6 @@ span.editinstructions { } /** Management header styling **/ -.coursecat-management-header { - vertical-align: middle; - - h2 { - display: inline-block; - text-align: left; - } - - > div { - float: right; - - > div { - margin: 10px 0 10px 1em; - display: inline-block; - } - } - - select { - max-width: 300px; - cursor: pointer; - padding: 0.4em 0.5em 0.45em 1em; - vertical-align: baseline; - white-space: nowrap; - } - - .view-mode-selector { - .moodle-actionmenu { - white-space: nowrap; - display: inline-block; - } - - .moodle-actionmenu[data-enhanced].show .menu a { - padding-left: 1em; - } - } -} - .course-being-dragged-proxy { border: 0; color: $link-color; diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index 9a190efab09..127b39d4fe1 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -28884,35 +28884,6 @@ span.editinstructions .alert-link { } /** Management header styling **/ -.coursecat-management-header { - vertical-align: middle; -} -.coursecat-management-header h2 { - display: inline-block; - text-align: left; -} -.coursecat-management-header > div { - float: right; -} -.coursecat-management-header > div > div { - margin: 10px 0 10px 1em; - display: inline-block; -} -.coursecat-management-header select { - max-width: 300px; - cursor: pointer; - padding: 0.4em 0.5em 0.45em 1em; - vertical-align: baseline; - white-space: nowrap; -} -.coursecat-management-header .view-mode-selector .moodle-actionmenu { - white-space: nowrap; - display: inline-block; -} -.coursecat-management-header .view-mode-selector .moodle-actionmenu[data-enhanced].show .menu a { - padding-left: 1em; -} - .course-being-dragged-proxy { border: 0; color: #0f6cbf; diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index 2ce2cd99c84..f120e6a6dda 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -28884,35 +28884,6 @@ span.editinstructions .alert-link { } /** Management header styling **/ -.coursecat-management-header { - vertical-align: middle; -} -.coursecat-management-header h2 { - display: inline-block; - text-align: left; -} -.coursecat-management-header > div { - float: right; -} -.coursecat-management-header > div > div { - margin: 10px 0 10px 1em; - display: inline-block; -} -.coursecat-management-header select { - max-width: 300px; - cursor: pointer; - padding: 0.4em 0.5em 0.45em 1em; - vertical-align: baseline; - white-space: nowrap; -} -.coursecat-management-header .view-mode-selector .moodle-actionmenu { - white-space: nowrap; - display: inline-block; -} -.coursecat-management-header .view-mode-selector .moodle-actionmenu[data-enhanced].show .menu a { - padding-left: 1em; -} - .course-being-dragged-proxy { border: 0; color: #0f6cbf; From c188ec80be38605d96cc8d6924d5611d302f36a3 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Tue, 26 Mar 2024 13:46:53 +0100 Subject: [PATCH 2/2] MDL-73975 course: Remove course_search_form template The template core_course/course_search_form has been removed following its cessation of use upon MDL-69454 in Moodle 3.11. --- course/templates/course_search_form.mustache | 46 -------------------- course/upgrade.txt | 1 + lang/en/deprecated.txt | 2 + lang/en/moodle.php | 12 ++--- theme/boost/scss/moodle/course.scss | 5 --- theme/boost/scss/moodle/forms.scss | 4 -- theme/boost/style/moodle.css | 9 ---- theme/classic/style/moodle.css | 9 ---- 8 files changed, 9 insertions(+), 79 deletions(-) delete mode 100644 course/templates/course_search_form.mustache diff --git a/course/templates/course_search_form.mustache b/course/templates/course_search_form.mustache deleted file mode 100644 index a128979588d..00000000000 --- a/course/templates/course_search_form.mustache +++ /dev/null @@ -1,46 +0,0 @@ -{{! - This file is part of Moodle - http://moodle.org/ - - Moodle is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Moodle is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Moodle. If not, see . -}} -{{! - @template core_course/course_search_form - - This template renders the form for course search. - - Example context (json): - { - "searchurl": "https://moodlesite/course/search.php", - "id": "coursesearch", - "inputid": "coursesearchbox", - "inputsize": 30, - "value": "certificate", - "name" : "q", - "helpicon": [{ - "heading": "Search courses", - "text": "You can search for multiple words at once and can refine your search as follows:" - }] - } -}} -
-
- - - - - {{#helpicon}} - {{>core/help_icon}} - {{/helpicon}} -
-
diff --git a/course/upgrade.txt b/course/upgrade.txt index 77eff50c0dd..12b741b01b7 100644 --- a/course/upgrade.txt +++ b/course/upgrade.txt @@ -38,6 +38,7 @@ The colors for all these purposes and the filters applied to outline them are de * New behat step using the URL resolvers: - When I am on the "Course >
"course > section" page logged in as "". When utilizing 'Section x' it first searches by section name (Section x). If it's not found, then it searches by the section number (x). +* The template core_course/course_search_form has been removed following its cessation of use upon MDL-69454 in version 3.11. === 4.3 === * The `core_course_renderer::course_section_cm_completion` method has been removed, and can no longer be used diff --git a/lang/en/deprecated.txt b/lang/en/deprecated.txt index 42b5148ed5f..7a186215d14 100644 --- a/lang/en/deprecated.txt +++ b/lang/en/deprecated.txt @@ -125,3 +125,5 @@ from,core aria-toggledropdown,core_grades aria:dropdowngrades,core_grades viewresults,core +coursesearch,core +coursesearch_help,core diff --git a/lang/en/moodle.php b/lang/en/moodle.php index ceb8ba9be58..6e5bb1382f4 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -430,12 +430,6 @@ $string['coursesectiontitleediting'] = 'Edit {$a->sectionname}: {$a->sectiontitl $string['coursesettings'] = 'Course default settings'; $string['coursesmovedout'] = 'Courses moved out from {$a}'; $string['coursespending'] = 'Courses pending approval'; -$string['coursesearch'] = 'Search courses'; -$string['coursesearch_help'] = 'You can search for multiple words at once and can refine your search as follows: - -* word - find any match of this word within the text -* +word - only exact matching words will be found -* -word - don\'t include results containing this word.'; $string['coursestart'] = 'Course start'; $string['coursesummary'] = 'Course summary'; $string['coursesummary_help'] = 'A short description of your course. The content you add here is searchable.'; @@ -2504,3 +2498,9 @@ $string['summaryof'] = 'Summary of {$a}'; $string['from'] = 'From'; $string['to'] = 'To'; $string['viewresults'] = 'View results for {$a}'; +$string['coursesearch'] = 'Search courses'; +$string['coursesearch_help'] = 'You can search for multiple words at once and can refine your search as follows: + +* word - find any match of this word within the text +* +word - only exact matching words will be found +* -word - don\'t include results containing this word.'; diff --git a/theme/boost/scss/moodle/course.scss b/theme/boost/scss/moodle/course.scss index a0eeb56ec1d..f2b2464d611 100644 --- a/theme/boost/scss/moodle/course.scss +++ b/theme/boost/scss/moodle/course.scss @@ -556,11 +556,6 @@ span.editinstructions { vertical-align: text-bottom; } -#coursesearch { - margin-top: 1em; - text-align: left; -} - #page-course-pending .pendingcourserequests { margin-bottom: 1em; } diff --git a/theme/boost/scss/moodle/forms.scss b/theme/boost/scss/moodle/forms.scss index fc01d186902..86e06174d8a 100644 --- a/theme/boost/scss/moodle/forms.scss +++ b/theme/boost/scss/moodle/forms.scss @@ -197,10 +197,6 @@ div#dateselector-calendar-panel { z-index: 3100; /* Set higher than the z-index of the filemanager - see MDL-39047. */ } -fieldset.coursesearchbox label { - display: inline; -} - /** * Show the labels above text editors and file managers except on wide screens. */ diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index 127b39d4fe1..f5b33365328 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -28485,11 +28485,6 @@ span.editinstructions .alert-link { vertical-align: text-bottom; } -#coursesearch { - margin-top: 1em; - text-align: left; -} - #page-course-pending .pendingcourserequests { margin-bottom: 1em; } @@ -33079,10 +33074,6 @@ div#dateselector-calendar-panel { z-index: 3100; /* Set higher than the z-index of the filemanager - see MDL-39047. */ } -fieldset.coursesearchbox label { - display: inline; -} - /** * Show the labels above text editors and file managers except on wide screens. */ diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index f120e6a6dda..5a75c81337b 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -28485,11 +28485,6 @@ span.editinstructions .alert-link { vertical-align: text-bottom; } -#coursesearch { - margin-top: 1em; - text-align: left; -} - #page-course-pending .pendingcourserequests { margin-bottom: 1em; } @@ -33079,10 +33074,6 @@ div#dateselector-calendar-panel { z-index: 3100; /* Set higher than the z-index of the filemanager - see MDL-39047. */ } -fieldset.coursesearchbox label { - display: inline; -} - /** * Show the labels above text editors and file managers except on wide screens. */