MDL-63253 admin: Show location of the found items at search results page
The search results page showed just the titles of the found matching pages / sections but not their location within the admin tree. In certain cases, we even have multiple admin pages with the same title - making it impossible to distinguish which is which. The patch makes it so that the path of the found admin page / section is displayed below the title.
This commit is contained in:
@@ -8179,6 +8179,15 @@ function admin_search_settings_html($query) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Locate the page in the admin root and populate its visiblepath attribute.
|
||||
$path = array();
|
||||
$located = $adminroot->locate($page->name, true);
|
||||
if ($located) {
|
||||
foreach ($located->visiblepath as $pathitem) {
|
||||
array_unshift($path, (string) $pathitem);
|
||||
}
|
||||
}
|
||||
|
||||
$sectionsettings = [];
|
||||
if (!empty($settings)) {
|
||||
foreach ($settings as $setting) {
|
||||
@@ -8198,6 +8207,7 @@ function admin_search_settings_html($query) {
|
||||
|
||||
$tpldata->results[] = (object) [
|
||||
'title' => $heading,
|
||||
'path' => $path,
|
||||
'url' => $headingurl->out(false),
|
||||
'settings' => $sectionsettings
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user