refactor(core): use array_merge to get sidebar for toolbox

Spread syntax is not supported before PHP 7.4
This commit is contained in:
alistair3149 2022-05-28 14:26:32 -04:00
parent 828f9f7c95
commit 0a68a178cc
No known key found for this signature in database
GPG key ID: 94D081060FD3DD9C
2 changed files with 8 additions and 6 deletions

View file

@ -39,6 +39,7 @@ final class PageTools extends Partial {
/**
* Render page-related tools
* TODO: Break this down and clean up when 1.39
* TODO: Use SkinTemplateNavigation::Universal instead of dirty CSS when 1.39
*
* Possible visibility conditions:
* * true: always visible (bool)
@ -97,14 +98,15 @@ final class PageTools extends Partial {
$languageshtml['is-empty'] = true;
}
// Finds the toolbox in the sidebar.
// The reason we do this is because we removed some site-wide tools from
// the toolbar in Drawer.php, now we just want the leftovers
$sidebar = [ $parentData['data-portlets-sidebar']['data-portlets-first'],
...$parentData['data-portlets-sidebar']['array-portlets-rest'] ];
// The reason we do this is because:
// 1. We removed some site-wide tools from the toolbar in Drawer.php,
// now we just want the leftovers
// 2. Toolbox is not currently avaliable as data-portlet, have to wait
// till Desktop Improvements
$toolboxhtml = [
'is-empty' => true,
];
foreach ( $sidebar as $portlet ) {
foreach ( $parentData['data-portlets-sidebar']['array-portlets-rest'] as $portlet ) {
if ( $portlet['id'] === 'p-tb' ) {
$toolboxhtml = $portlet;
$toolboxhtml['is-empty'] = false;

View file

@ -267,7 +267,7 @@ class SkinCitizen extends SkinMustache {
],
$content
);
}
}
foreach ( $items as $key => $item ) {
$data['html-items'] .= $this->makeListItem( $key, $item );