<?php
namespace App\EventListener;
use Pimcore\Event\BundleManager\PathsEvent;
use Pimcore\Event\BundleManagerEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class EditmodeListener implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return [
BundleManagerEvents::EDITMODE_JS_PATHS => 'onEditmodeJsPaths'
];
}
public static function addJSFiles(PathsEvent $event)
{
$event->setPaths(
array_merge(
$event->getPaths(),
[
'/static/js/editmode/editmode.js'
]
)
);
}
public function onEditmodeJsPaths(PathsEvent $event)
{
$event->setPaths(array_merge($event->getPaths(), [
'/static/js/editmode/editmode.js'
]));
}
}