1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Query Manager |
4
|
|
|
* Copyright (c) Webmatch GmbH |
5
|
|
|
* |
6
|
|
|
* This program is free software: you can redistribute it and/or modify |
7
|
|
|
* it under the terms of the GNU General Public License as published by |
8
|
|
|
* the Free Software Foundation, either version 3 of the License, or |
9
|
|
|
* (at your option) any later version. |
10
|
|
|
* |
11
|
|
|
* This program is distributed in the hope that it will be useful, |
12
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14
|
|
|
* GNU General Public License for more details. |
15
|
|
|
*/ |
16
|
|
|
|
17
|
|
|
namespace WbmQueryManager\Subscriber\Backend; |
18
|
|
|
|
19
|
|
|
use Enlight\Event\SubscriberInterface; |
20
|
|
|
use Shopware\Components\DependencyInjection\Container; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Class QueryManagerController |
24
|
|
|
* @package WbmQueryManager\Subscriber\Backend |
25
|
|
|
*/ |
26
|
|
|
class QueryManagerController implements SubscriberInterface |
27
|
|
|
{ |
28
|
|
|
/** |
29
|
|
|
* @var Container |
30
|
|
|
*/ |
31
|
|
|
private $container; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @return array |
35
|
|
|
*/ |
36
|
|
|
public static function getSubscribedEvents() |
37
|
|
|
{ |
38
|
|
|
return [ |
39
|
|
|
'Enlight_Controller_Dispatcher_ControllerPath_Backend_WbmQueryManager' => 'onWbmQueryManagerController' |
40
|
|
|
]; |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @param Container $container |
45
|
|
|
*/ |
46
|
|
|
public function __construct(Container $container) |
47
|
|
|
{ |
48
|
|
|
$this->container = $container; |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @return string |
53
|
|
|
*/ |
54
|
|
|
public function onWbmQueryManagerController() |
55
|
|
|
{ |
56
|
|
|
$this->container->get('template')->addTemplateDir( |
57
|
|
|
$this->container->getParameter('wbm_query_manager.plugin_dir') . '/Resources/views/' |
58
|
|
|
); |
59
|
|
|
|
60
|
|
|
$this->container->get('snippets')->addConfigDir( |
61
|
|
|
$this->container->getParameter('wbm_query_manager.plugin_dir') . '/Resources/snippets/' |
62
|
|
|
); |
63
|
|
|
|
64
|
|
|
return $this->container->getParameter('wbm_query_manager.plugin_dir') . '/Controllers/Backend/WbmQueryManager.php'; |
65
|
|
|
} |
66
|
|
|
} |