Skip to content

Commit

Permalink
feat: prepare Pimcore 10 compatibility fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mike4git committed Sep 29, 2024
1 parent 803e53d commit 5f6be1e
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions src/EventListener/PimcoreAdminListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Neusta\Pimcore\AreabrickConfigBundle\EventListener;

use Pimcore\Event\BundleManager\PathsEvent;
use Pimcore\Version;

class PimcoreAdminListener
{
Expand All @@ -18,12 +19,24 @@ public function addCSSFiles(PathsEvent $event): void

public function addJSFiles(PathsEvent $event): void
{
$event->setPaths(array_merge(
$event->getPaths(),
[
'/bundles/neustapimcoreareabrickconfig/js/areabricksOverviewMenuItem.js',
'/bundles/neustapimcoreareabrickconfig/js/areabricksOverviewTabPanel.js',
],
));
if (11 === Version::getMajorVersion()) {
$event->setPaths(array_merge(
$event->getPaths(),
[
'/bundles/neustapimcoreareabrickconfig/js/areabricksOverviewMenuItem.js',
'/bundles/neustapimcoreareabrickconfig/js/areabricksOverviewTabPanel.js',
],
));
} elseif (10 === Version::getMajorVersion()) {
$event->setPaths(array_merge(
$event->getPaths(),
[
// '/bundles/neustapimcoreareabrickconfig/js/areabricksOverviewMenuItem_Pimcore10.js',
// '/bundles/neustapimcoreareabrickconfig/js/areabricksOverviewTabPanel_Pimcore10.js',
],
));
} else {
throw new \Exception("You're using an unsupported version of Pimcore");
}
}
}

0 comments on commit 5f6be1e

Please sign in to comment.