mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-72163 admin: Plugins overview page should link to categories
This commit is contained in:
parent
8453fe0ddb
commit
78c96c6f44
@ -810,6 +810,20 @@ class admin_category implements parentable_part_of_admin_tree {
|
||||
$this->hidden = $hidden;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the URL to view this page.
|
||||
*
|
||||
* @return moodle_url
|
||||
*/
|
||||
public function get_settings_page_url(): moodle_url {
|
||||
return new moodle_url(
|
||||
'/admin/category.php',
|
||||
[
|
||||
'category' => $this->name,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a reference to the part_of_admin_tree object with internal name $name.
|
||||
*
|
||||
|
@ -509,13 +509,22 @@ abstract class base {
|
||||
return null;
|
||||
}
|
||||
$settings = admin_get_root()->locate($section);
|
||||
if ($settings && $settings instanceof \admin_settingpage) {
|
||||
return new moodle_url('/admin/settings.php', array('section' => $section));
|
||||
} else if ($settings && $settings instanceof \admin_externalpage) {
|
||||
return new moodle_url($settings->url);
|
||||
} else {
|
||||
return null;
|
||||
if ($settings) {
|
||||
if ($settings instanceof \admin_settingpage) {
|
||||
return new moodle_url('/admin/settings.php', [
|
||||
'section' => $section,
|
||||
]);
|
||||
}
|
||||
|
||||
if ($settings instanceof \admin_externalpage) {
|
||||
return new moodle_url($settings->url);
|
||||
}
|
||||
|
||||
if ($settings instanceof \admin_category) {
|
||||
return $settings->get_settings_page_url();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user