1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* 2016 Romain CANON <[email protected]> |
4
|
|
|
* |
5
|
|
|
* This file is part of the TYPO3 Formz project. |
6
|
|
|
* It is free software; you can redistribute it and/or modify it |
7
|
|
|
* under the terms of the GNU General Public License, either |
8
|
|
|
* version 3 of the License, or any later version. |
9
|
|
|
* |
10
|
|
|
* For the full copyright and license information, see: |
11
|
|
|
* http://www.gnu.org/licenses/gpl-3.0.html |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace Romm\Formz\AssetHandler; |
15
|
|
|
|
16
|
|
|
use Romm\Formz\Core\Core; |
17
|
|
|
use Romm\Formz\Form\FormObject; |
18
|
|
|
use TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext; |
19
|
|
|
use TYPO3\CMS\Extbase\Object\ObjectManagerInterface; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Abstract class which must be inherited by an asset handler. |
23
|
|
|
* |
24
|
|
|
* An asset handler is a helper for getting useful information for a given |
25
|
|
|
* language. |
26
|
|
|
*/ |
27
|
|
|
abstract class AbstractAssetHandler |
28
|
|
|
{ |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @var ObjectManagerInterface |
32
|
|
|
*/ |
33
|
|
|
protected $objectManager; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @var AssetHandlerFactory |
37
|
|
|
*/ |
38
|
|
|
protected $assetHandlerFactory; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Constructor, will set up variables. |
42
|
|
|
* |
43
|
|
|
* @param AssetHandlerFactory $assetHandlerFactory |
44
|
|
|
*/ |
45
|
|
|
public function __construct(AssetHandlerFactory $assetHandlerFactory) |
46
|
|
|
{ |
47
|
|
|
$this->assetHandlerFactory = $assetHandlerFactory; |
48
|
|
|
$this->objectManager = Core::get()->getObjectManager(); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* Just an alias to get the form object faster. |
53
|
|
|
* |
54
|
|
|
* @return FormObject |
55
|
|
|
*/ |
56
|
|
|
public function getFormObject() |
57
|
|
|
{ |
58
|
|
|
return $this->assetHandlerFactory->getFormObject(); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Just an alias to get the controller context faster. |
63
|
|
|
* |
64
|
|
|
* @return ControllerContext |
65
|
|
|
*/ |
66
|
|
|
public function getControllerContext() |
67
|
|
|
{ |
68
|
|
|
return $this->assetHandlerFactory->getControllerContext(); |
69
|
|
|
} |
70
|
|
|
} |
71
|
|
|
|