1 | <?php |
||
44 | class AdministrationController extends ActionController |
||
45 | { |
||
46 | |||
47 | /** |
||
48 | * Persistent module data |
||
49 | * |
||
50 | * @var \ApacheSolrForTypo3\Solr\Domain\Model\ModuleData |
||
51 | */ |
||
52 | protected $moduleData = null; |
||
53 | |||
54 | /** |
||
55 | * @var \ApacheSolrForTypo3\Solr\Service\ModuleDataStorageService |
||
56 | * @inject |
||
57 | */ |
||
58 | protected $moduleDataStorageService; |
||
59 | |||
60 | /** |
||
61 | * Administration Module Manager |
||
62 | * |
||
63 | * @var \ApacheSolrForTypo3\Solr\Backend\SolrModule\AdministrationModuleManager |
||
64 | * @inject |
||
65 | */ |
||
66 | protected $moduleManager = null; |
||
67 | |||
68 | /** |
||
69 | * Modules |
||
70 | * |
||
71 | * @var array |
||
72 | */ |
||
73 | protected $modules = []; |
||
74 | |||
75 | /** |
||
76 | * Name of the currently active module |
||
77 | * |
||
78 | * @var string |
||
79 | */ |
||
80 | protected $activeModuleName = 'Overview'; |
||
81 | |||
82 | /** |
||
83 | * Currently active module |
||
84 | * |
||
85 | * @var null|\ApacheSolrForTypo3\Solr\Backend\SolrModule\AdministrationModuleInterface|ActionController |
||
86 | */ |
||
87 | protected $activeModule = null; |
||
88 | |||
89 | /** |
||
90 | * The site to work with |
||
91 | * |
||
92 | * @var Site |
||
93 | */ |
||
94 | protected $site; |
||
95 | |||
96 | /** |
||
97 | * Loads and persists module data |
||
98 | * |
||
99 | * @param RequestInterface $request |
||
100 | * @param ResponseInterface $response |
||
101 | * @throws \Exception|StopActionException |
||
102 | * @return void |
||
103 | */ |
||
104 | public function processRequest( |
||
118 | |||
119 | /** |
||
120 | * Initializes the controller before invoking an action method. |
||
121 | * |
||
122 | * @return void |
||
123 | */ |
||
124 | protected function initializeAction() |
||
150 | |||
151 | /** |
||
152 | * Index Action / Overview |
||
153 | * |
||
154 | * @return void |
||
155 | */ |
||
156 | public function indexAction() |
||
164 | |||
165 | /** |
||
166 | * No site available |
||
167 | * |
||
168 | * @return void |
||
169 | */ |
||
170 | public function noSiteAvailableAction() |
||
173 | |||
174 | /** |
||
175 | * Call a sub-module's controller |
||
176 | * |
||
177 | */ |
||
178 | protected function invokeModuleController() |
||
221 | |||
222 | /** |
||
223 | * Sets the site to work with |
||
224 | * |
||
225 | * @param int $site Site root page id |
||
226 | * @return void |
||
227 | */ |
||
228 | public function setSiteAction($site) |
||
237 | |||
238 | /** |
||
239 | * Sets the core to work with. |
||
240 | * |
||
241 | * @param string $core The core path to use |
||
242 | * @param string $module Module to forward to after setting the core |
||
243 | * @return void |
||
244 | */ |
||
245 | public function setCoreAction($core, $module = 'Overview') |
||
252 | |||
253 | /** |
||
254 | * Forwards to the index action after resetting module and moduleAction |
||
255 | * arguments to prevent execution of module actions. |
||
256 | * |
||
257 | * @return void |
||
258 | */ |
||
259 | protected function forwardHome() |
||
263 | |||
264 | /** |
||
265 | * Forwards to an action of the AdministrationController. |
||
266 | * |
||
267 | * @param string $actionName |
||
268 | */ |
||
269 | protected function forwardToNonModuleAction($actionName) |
||
277 | |||
278 | /** |
||
279 | * Forwards to a specific module and module action. |
||
280 | * |
||
281 | * @param string $module Module name |
||
282 | * @param string $moduleAction Module action |
||
283 | * @return void |
||
284 | */ |
||
285 | protected function forwardToModule($module, $moduleAction = '') |
||
300 | |||
301 | /** |
||
302 | * @param Site $site |
||
303 | */ |
||
304 | protected function setSiteAndResetCore($site) |
||
311 | |||
312 | /** |
||
313 | * Resets the stored site to the first available site. |
||
314 | * |
||
315 | * @return void‚ |
||
316 | */ |
||
317 | protected function initializeSiteFromFirstAvailableAndStoreInModuleData() |
||
327 | |||
328 | /** |
||
329 | * @return void |
||
330 | */ |
||
331 | protected function resolveSite() |
||
343 | |||
344 | /** |
||
345 | * Get an instance of the SiteRepository |
||
346 | * |
||
347 | * @return SiteRepository |
||
348 | */ |
||
349 | protected function getSiteRepository() |
||
353 | } |
||
354 |