MDL-73975 course: Final deprecation methods in management_renderer

Final deprecation for management_heading() and course_search_form()
in core_course_management_renderer.
This commit is contained in:
Sara Arjona
2024-04-02 16:42:31 +02:00
parent 4da813d35e
commit 8efe31ee96
5 changed files with 18 additions and 143 deletions
+16 -48
View File
@@ -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__]);
}
/**
+2
View File
@@ -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).
-37
View File
@@ -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;
-29
View File
@@ -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;
-29
View File
@@ -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;