diff --git a/src/EventListener/PimcoreAdminListener.php b/src/EventListener/PimcoreAdminListener.php index 4feada1..a4da129 100755 --- a/src/EventListener/PimcoreAdminListener.php +++ b/src/EventListener/PimcoreAdminListener.php @@ -3,6 +3,7 @@ namespace Neusta\Pimcore\AreabrickConfigBundle\EventListener; use Pimcore\Event\BundleManager\PathsEvent; +use Pimcore\Version; class PimcoreAdminListener { @@ -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"); + } } }