@@ -40,7 +40,7 @@ |
||
40 | 40 | public function render() |
41 | 41 | { |
42 | 42 | $this->initializeCache(); |
43 | - $key = $this->getModuleLoader()->getDataType() . '_' . $this->getBackendUserIdentifier() . '_' . $this->arguments['key']; |
|
43 | + $key = $this->getModuleLoader()->getDataType().'_'.$this->getBackendUserIdentifier().'_'.$this->arguments['key']; |
|
44 | 44 | |
45 | 45 | $value = $this->cacheInstance->get($key); |
46 | 46 | if ($value) { |
@@ -20,84 +20,84 @@ |
||
20 | 20 | class UserPreferencesViewHelper extends AbstractViewHelper |
21 | 21 | { |
22 | 22 | |
23 | - /** |
|
24 | - * @var AbstractFrontend |
|
25 | - */ |
|
26 | - protected $cacheInstance; |
|
23 | + /** |
|
24 | + * @var AbstractFrontend |
|
25 | + */ |
|
26 | + protected $cacheInstance; |
|
27 | 27 | |
28 | - /** |
|
29 | - * @return void |
|
30 | - */ |
|
31 | - public function initializeArguments() |
|
32 | - { |
|
33 | - $this->registerArgument('key', 'string', '', true); |
|
34 | - } |
|
28 | + /** |
|
29 | + * @return void |
|
30 | + */ |
|
31 | + public function initializeArguments() |
|
32 | + { |
|
33 | + $this->registerArgument('key', 'string', '', true); |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * Interface with the BE user data. |
|
38 | - * |
|
39 | - * @return string |
|
40 | - */ |
|
41 | - public function render() |
|
42 | - { |
|
43 | - $this->initializeCache(); |
|
44 | - $key = $this->getModuleLoader()->getDataType() . '_' . $this->getBackendUserIdentifier() . '_' . $this->arguments['key']; |
|
36 | + /** |
|
37 | + * Interface with the BE user data. |
|
38 | + * |
|
39 | + * @return string |
|
40 | + */ |
|
41 | + public function render() |
|
42 | + { |
|
43 | + $this->initializeCache(); |
|
44 | + $key = $this->getModuleLoader()->getDataType() . '_' . $this->getBackendUserIdentifier() . '_' . $this->arguments['key']; |
|
45 | 45 | |
46 | - $value = $this->cacheInstance->get($key); |
|
47 | - if ($value) { |
|
48 | - $value = addslashes($value); |
|
49 | - } else { |
|
50 | - $value = ''; |
|
51 | - } |
|
52 | - return $value; |
|
53 | - } |
|
46 | + $value = $this->cacheInstance->get($key); |
|
47 | + if ($value) { |
|
48 | + $value = addslashes($value); |
|
49 | + } else { |
|
50 | + $value = ''; |
|
51 | + } |
|
52 | + return $value; |
|
53 | + } |
|
54 | 54 | |
55 | - /** |
|
56 | - * @return int |
|
57 | - */ |
|
58 | - protected function getBackendUserIdentifier() |
|
59 | - { |
|
60 | - return $this->getBackendUser()->user['uid']; |
|
61 | - } |
|
55 | + /** |
|
56 | + * @return int |
|
57 | + */ |
|
58 | + protected function getBackendUserIdentifier() |
|
59 | + { |
|
60 | + return $this->getBackendUser()->user['uid']; |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * Returns an instance of the current Backend User. |
|
65 | - * |
|
66 | - * @return BackendUserAuthentication |
|
67 | - */ |
|
68 | - protected function getBackendUser() |
|
69 | - { |
|
70 | - return $GLOBALS['BE_USER']; |
|
71 | - } |
|
63 | + /** |
|
64 | + * Returns an instance of the current Backend User. |
|
65 | + * |
|
66 | + * @return BackendUserAuthentication |
|
67 | + */ |
|
68 | + protected function getBackendUser() |
|
69 | + { |
|
70 | + return $GLOBALS['BE_USER']; |
|
71 | + } |
|
72 | 72 | |
73 | - /** |
|
74 | - * Get the Vidi Module Loader. |
|
75 | - * |
|
76 | - * @return ModuleLoader|object |
|
77 | - */ |
|
78 | - protected function getModuleLoader() |
|
79 | - { |
|
80 | - return GeneralUtility::makeInstance(ModuleLoader::class); |
|
81 | - } |
|
73 | + /** |
|
74 | + * Get the Vidi Module Loader. |
|
75 | + * |
|
76 | + * @return ModuleLoader|object |
|
77 | + */ |
|
78 | + protected function getModuleLoader() |
|
79 | + { |
|
80 | + return GeneralUtility::makeInstance(ModuleLoader::class); |
|
81 | + } |
|
82 | 82 | |
83 | - /** |
|
84 | - * Initialize cache instance to be ready to use |
|
85 | - * |
|
86 | - * @return void |
|
87 | - */ |
|
88 | - protected function initializeCache() |
|
89 | - { |
|
90 | - $this->cacheInstance = $this->getCacheManager()->getCache('vidi'); |
|
91 | - } |
|
83 | + /** |
|
84 | + * Initialize cache instance to be ready to use |
|
85 | + * |
|
86 | + * @return void |
|
87 | + */ |
|
88 | + protected function initializeCache() |
|
89 | + { |
|
90 | + $this->cacheInstance = $this->getCacheManager()->getCache('vidi'); |
|
91 | + } |
|
92 | 92 | |
93 | - /** |
|
94 | - * Return the Cache Manager |
|
95 | - * |
|
96 | - * @return CacheManager|object |
|
97 | - */ |
|
98 | - protected function getCacheManager() |
|
99 | - { |
|
100 | - return GeneralUtility::makeInstance(CacheManager::class); |
|
101 | - } |
|
93 | + /** |
|
94 | + * Return the Cache Manager |
|
95 | + * |
|
96 | + * @return CacheManager|object |
|
97 | + */ |
|
98 | + protected function getCacheManager() |
|
99 | + { |
|
100 | + return GeneralUtility::makeInstance(CacheManager::class); |
|
101 | + } |
|
102 | 102 | |
103 | 103 | } |
@@ -18,26 +18,26 @@ |
||
18 | 18 | class ModulePreferencesViewHelper extends AbstractViewHelper |
19 | 19 | { |
20 | 20 | |
21 | - /** |
|
22 | - * @return void |
|
23 | - */ |
|
24 | - public function initializeArguments() |
|
25 | - { |
|
26 | - $this->registerArgument('key', 'string', 'The module key', true); |
|
27 | - } |
|
21 | + /** |
|
22 | + * @return void |
|
23 | + */ |
|
24 | + public function initializeArguments() |
|
25 | + { |
|
26 | + $this->registerArgument('key', 'string', 'The module key', true); |
|
27 | + } |
|
28 | 28 | |
29 | - /** |
|
30 | - * Interface with the Module Loader |
|
31 | - * |
|
32 | - * @return string |
|
33 | - */ |
|
34 | - public function render() |
|
35 | - { |
|
36 | - $getter = 'get' . ucfirst($this->arguments['key']); |
|
29 | + /** |
|
30 | + * Interface with the Module Loader |
|
31 | + * |
|
32 | + * @return string |
|
33 | + */ |
|
34 | + public function render() |
|
35 | + { |
|
36 | + $getter = 'get' . ucfirst($this->arguments['key']); |
|
37 | 37 | |
38 | - /** @var ModulePreferences $modulePreferences */ |
|
39 | - $modulePreferences = GeneralUtility::makeInstance(ModulePreferences::class); |
|
40 | - return $modulePreferences->$getter(); |
|
41 | - } |
|
38 | + /** @var ModulePreferences $modulePreferences */ |
|
39 | + $modulePreferences = GeneralUtility::makeInstance(ModulePreferences::class); |
|
40 | + return $modulePreferences->$getter(); |
|
41 | + } |
|
42 | 42 | |
43 | 43 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | */ |
34 | 34 | public function render() |
35 | 35 | { |
36 | - $getter = 'get' . ucfirst($this->arguments['key']); |
|
36 | + $getter = 'get'.ucfirst($this->arguments['key']); |
|
37 | 37 | |
38 | 38 | /** @var ModulePreferences $modulePreferences */ |
39 | 39 | $modulePreferences = GeneralUtility::makeInstance(ModulePreferences::class); |
@@ -18,42 +18,42 @@ |
||
18 | 18 | class GpViewHelper extends AbstractViewHelper |
19 | 19 | { |
20 | 20 | |
21 | - /** |
|
22 | - * @return void |
|
23 | - */ |
|
24 | - public function initializeArguments() |
|
25 | - { |
|
26 | - $this->registerArgument('argument', 'string', 'The argument name', true); |
|
27 | - $this->registerArgument('encode', 'bool', 'Whether to encode the URL.', false, true); |
|
28 | - } |
|
29 | - |
|
30 | - /** |
|
31 | - * Tells whether the argument exists or not. |
|
32 | - * |
|
33 | - * @return boolean |
|
34 | - */ |
|
35 | - public function render() |
|
36 | - { |
|
37 | - $value = ''; // default value |
|
38 | - |
|
39 | - // Merge parameters |
|
40 | - $parameters = GeneralUtility::_GET(); |
|
41 | - $post = GeneralUtility::_POST(); |
|
42 | - ArrayUtility::mergeRecursiveWithOverrule($parameters, $post); |
|
43 | - |
|
44 | - // Traverse argument parts and retrieve value. |
|
45 | - $argumentParts = GeneralUtility::trimExplode('|', $this->arguments['argument']); |
|
46 | - foreach ($argumentParts as $argumentPart) { |
|
47 | - if (isset($parameters[$argumentPart])) { |
|
48 | - $value = $parameters[$argumentPart]; |
|
49 | - $parameters = $value; |
|
50 | - } |
|
51 | - } |
|
52 | - |
|
53 | - // Possible url encode. |
|
54 | - if ($this->arguments['encode']) { |
|
55 | - $value = urlencode($value); |
|
56 | - } |
|
57 | - return $value; |
|
58 | - } |
|
21 | + /** |
|
22 | + * @return void |
|
23 | + */ |
|
24 | + public function initializeArguments() |
|
25 | + { |
|
26 | + $this->registerArgument('argument', 'string', 'The argument name', true); |
|
27 | + $this->registerArgument('encode', 'bool', 'Whether to encode the URL.', false, true); |
|
28 | + } |
|
29 | + |
|
30 | + /** |
|
31 | + * Tells whether the argument exists or not. |
|
32 | + * |
|
33 | + * @return boolean |
|
34 | + */ |
|
35 | + public function render() |
|
36 | + { |
|
37 | + $value = ''; // default value |
|
38 | + |
|
39 | + // Merge parameters |
|
40 | + $parameters = GeneralUtility::_GET(); |
|
41 | + $post = GeneralUtility::_POST(); |
|
42 | + ArrayUtility::mergeRecursiveWithOverrule($parameters, $post); |
|
43 | + |
|
44 | + // Traverse argument parts and retrieve value. |
|
45 | + $argumentParts = GeneralUtility::trimExplode('|', $this->arguments['argument']); |
|
46 | + foreach ($argumentParts as $argumentPart) { |
|
47 | + if (isset($parameters[$argumentPart])) { |
|
48 | + $value = $parameters[$argumentPart]; |
|
49 | + $parameters = $value; |
|
50 | + } |
|
51 | + } |
|
52 | + |
|
53 | + // Possible url encode. |
|
54 | + if ($this->arguments['encode']) { |
|
55 | + $value = urlencode($value); |
|
56 | + } |
|
57 | + return $value; |
|
58 | + } |
|
59 | 59 | } |
@@ -19,30 +19,30 @@ |
||
19 | 19 | class SpriteViewHelper extends AbstractViewHelper |
20 | 20 | { |
21 | 21 | |
22 | - /** |
|
23 | - * @return void |
|
24 | - */ |
|
25 | - public function initializeArguments() |
|
26 | - { |
|
27 | - $this->registerArgument('name', 'string', 'the file to include', true); |
|
28 | - } |
|
22 | + /** |
|
23 | + * @return void |
|
24 | + */ |
|
25 | + public function initializeArguments() |
|
26 | + { |
|
27 | + $this->registerArgument('name', 'string', 'the file to include', true); |
|
28 | + } |
|
29 | 29 | |
30 | - /** |
|
31 | - * Returns an icon using sprites |
|
32 | - * |
|
33 | - * @return string |
|
34 | - */ |
|
35 | - public function render() |
|
36 | - { |
|
37 | - return $this->getIconFactory()->getIcon($this->arguments['name'], Icon::SIZE_SMALL); |
|
38 | - } |
|
30 | + /** |
|
31 | + * Returns an icon using sprites |
|
32 | + * |
|
33 | + * @return string |
|
34 | + */ |
|
35 | + public function render() |
|
36 | + { |
|
37 | + return $this->getIconFactory()->getIcon($this->arguments['name'], Icon::SIZE_SMALL); |
|
38 | + } |
|
39 | 39 | |
40 | - /** |
|
41 | - * @return IconFactory|object |
|
42 | - */ |
|
43 | - protected function getIconFactory() |
|
44 | - { |
|
45 | - return GeneralUtility::makeInstance(IconFactory::class); |
|
46 | - } |
|
40 | + /** |
|
41 | + * @return IconFactory|object |
|
42 | + */ |
|
43 | + protected function getIconFactory() |
|
44 | + { |
|
45 | + return GeneralUtility::makeInstance(IconFactory::class); |
|
46 | + } |
|
47 | 47 | |
48 | 48 | } |
@@ -18,47 +18,47 @@ |
||
18 | 18 | class IsRelatedToViewHelper extends AbstractViewHelper |
19 | 19 | { |
20 | 20 | |
21 | - /** |
|
22 | - * @return void |
|
23 | - */ |
|
24 | - public function initializeArguments() |
|
25 | - { |
|
26 | - $this->registerArgument('relatedContent', Content::class, 'The related content', true); |
|
27 | - } |
|
21 | + /** |
|
22 | + * @return void |
|
23 | + */ |
|
24 | + public function initializeArguments() |
|
25 | + { |
|
26 | + $this->registerArgument('relatedContent', Content::class, 'The related content', true); |
|
27 | + } |
|
28 | 28 | |
29 | - /** |
|
30 | - * Tells whether a Content is related to another content. |
|
31 | - * The $fieldName corresponds to the relational field name |
|
32 | - * between the first content object and the second. |
|
33 | - * |
|
34 | - * @return boolean |
|
35 | - */ |
|
36 | - public function render() |
|
37 | - { |
|
38 | - /** @var Content $relatedContent */ |
|
39 | - $relatedContent = $this->arguments['relatedContent']; |
|
29 | + /** |
|
30 | + * Tells whether a Content is related to another content. |
|
31 | + * The $fieldName corresponds to the relational field name |
|
32 | + * between the first content object and the second. |
|
33 | + * |
|
34 | + * @return boolean |
|
35 | + */ |
|
36 | + public function render() |
|
37 | + { |
|
38 | + /** @var Content $relatedContent */ |
|
39 | + $relatedContent = $this->arguments['relatedContent']; |
|
40 | 40 | |
41 | - $isChecked = false; |
|
41 | + $isChecked = false; |
|
42 | 42 | |
43 | - // Only computes whether the object is checked if one row is beeing edited. |
|
44 | - $numberOfObjects = $this->templateVariableContainer->get('numberOfObjects'); |
|
45 | - if ($numberOfObjects === 1) { |
|
43 | + // Only computes whether the object is checked if one row is beeing edited. |
|
44 | + $numberOfObjects = $this->templateVariableContainer->get('numberOfObjects'); |
|
45 | + if ($numberOfObjects === 1) { |
|
46 | 46 | |
47 | - /** @var Content $content */ |
|
48 | - $content = $this->templateVariableContainer->get('content'); |
|
49 | - $fieldName = $this->templateVariableContainer->get('fieldName'); |
|
47 | + /** @var Content $content */ |
|
48 | + $content = $this->templateVariableContainer->get('content'); |
|
49 | + $fieldName = $this->templateVariableContainer->get('fieldName'); |
|
50 | 50 | |
51 | - // Build an array of user group uids |
|
52 | - $relatedContentsIdentifiers = []; |
|
51 | + // Build an array of user group uids |
|
52 | + $relatedContentsIdentifiers = []; |
|
53 | 53 | |
54 | - /** @var Content $contentObject */ |
|
55 | - foreach ($content[$fieldName] as $contentObject) { |
|
56 | - $relatedContentsIdentifiers[] = $contentObject->getUid(); |
|
57 | - } |
|
54 | + /** @var Content $contentObject */ |
|
55 | + foreach ($content[$fieldName] as $contentObject) { |
|
56 | + $relatedContentsIdentifiers[] = $contentObject->getUid(); |
|
57 | + } |
|
58 | 58 | |
59 | - $isChecked = in_array($relatedContent->getUid(), $relatedContentsIdentifiers, true); |
|
60 | - } |
|
59 | + $isChecked = in_array($relatedContent->getUid(), $relatedContentsIdentifiers, true); |
|
60 | + } |
|
61 | 61 | |
62 | - return $isChecked; |
|
63 | - } |
|
62 | + return $isChecked; |
|
63 | + } |
|
64 | 64 | } |
@@ -16,22 +16,22 @@ |
||
16 | 16 | */ |
17 | 17 | class CanBeHiddenViewHelper extends AbstractViewHelper |
18 | 18 | { |
19 | - /** |
|
20 | - * @return void |
|
21 | - */ |
|
22 | - public function initializeArguments() |
|
23 | - { |
|
24 | - $this->registerArgument('name', 'string', 'The column name', true); |
|
25 | - } |
|
19 | + /** |
|
20 | + * @return void |
|
21 | + */ |
|
22 | + public function initializeArguments() |
|
23 | + { |
|
24 | + $this->registerArgument('name', 'string', 'The column name', true); |
|
25 | + } |
|
26 | 26 | |
27 | - /** |
|
28 | - * Returns whether the column can be hidden or not. |
|
29 | - * |
|
30 | - * @return boolean |
|
31 | - */ |
|
32 | - public function render() |
|
33 | - { |
|
34 | - return Tca::grid()->canBeHidden($this->arguments['name']); |
|
35 | - } |
|
27 | + /** |
|
28 | + * Returns whether the column can be hidden or not. |
|
29 | + * |
|
30 | + * @return boolean |
|
31 | + */ |
|
32 | + public function render() |
|
33 | + { |
|
34 | + return Tca::grid()->canBeHidden($this->arguments['name']); |
|
35 | + } |
|
36 | 36 | |
37 | 37 | } |
@@ -17,22 +17,22 @@ |
||
17 | 17 | class HeaderViewHelper extends AbstractViewHelper |
18 | 18 | { |
19 | 19 | |
20 | - /** |
|
21 | - * @return void |
|
22 | - */ |
|
23 | - public function initializeArguments() |
|
24 | - { |
|
25 | - $this->registerArgument('name', 'string', 'The column name', true); |
|
26 | - } |
|
20 | + /** |
|
21 | + * @return void |
|
22 | + */ |
|
23 | + public function initializeArguments() |
|
24 | + { |
|
25 | + $this->registerArgument('name', 'string', 'The column name', true); |
|
26 | + } |
|
27 | 27 | |
28 | - /** |
|
29 | - * Returns a possible column header. |
|
30 | - * |
|
31 | - * @return boolean |
|
32 | - */ |
|
33 | - public function render() |
|
34 | - { |
|
35 | - return Tca::grid()->getHeader($this->arguments['name']); |
|
36 | - } |
|
28 | + /** |
|
29 | + * Returns a possible column header. |
|
30 | + * |
|
31 | + * @return boolean |
|
32 | + */ |
|
33 | + public function render() |
|
34 | + { |
|
35 | + return Tca::grid()->getHeader($this->arguments['name']); |
|
36 | + } |
|
37 | 37 | |
38 | 38 | } |
@@ -17,22 +17,22 @@ |
||
17 | 17 | class IsVisibleViewHelper extends AbstractViewHelper |
18 | 18 | { |
19 | 19 | |
20 | - /** |
|
21 | - * @return void |
|
22 | - */ |
|
23 | - public function initializeArguments() |
|
24 | - { |
|
25 | - $this->registerArgument('name', 'string', 'The column name', true); |
|
26 | - } |
|
20 | + /** |
|
21 | + * @return void |
|
22 | + */ |
|
23 | + public function initializeArguments() |
|
24 | + { |
|
25 | + $this->registerArgument('name', 'string', 'The column name', true); |
|
26 | + } |
|
27 | 27 | |
28 | - /** |
|
29 | - * Returns whether the column is visible. |
|
30 | - * |
|
31 | - * @return bool |
|
32 | - */ |
|
33 | - public function render() |
|
34 | - { |
|
35 | - return Tca::grid()->isVisible($this->arguments['name']); |
|
36 | - } |
|
28 | + /** |
|
29 | + * Returns whether the column is visible. |
|
30 | + * |
|
31 | + * @return bool |
|
32 | + */ |
|
33 | + public function render() |
|
34 | + { |
|
35 | + return Tca::grid()->isVisible($this->arguments['name']); |
|
36 | + } |
|
37 | 37 | |
38 | 38 | } |
@@ -17,22 +17,22 @@ |
||
17 | 17 | class IsEditableViewHelper extends AbstractViewHelper |
18 | 18 | { |
19 | 19 | |
20 | - /** |
|
21 | - * @return void |
|
22 | - */ |
|
23 | - public function initializeArguments() |
|
24 | - { |
|
25 | - $this->registerArgument('name', 'string', 'The column name', true); |
|
26 | - } |
|
20 | + /** |
|
21 | + * @return void |
|
22 | + */ |
|
23 | + public function initializeArguments() |
|
24 | + { |
|
25 | + $this->registerArgument('name', 'string', 'The column name', true); |
|
26 | + } |
|
27 | 27 | |
28 | - /** |
|
29 | - * Return whether field name is editable in the Grid. |
|
30 | - * |
|
31 | - * @return boolean |
|
32 | - */ |
|
33 | - public function render() |
|
34 | - { |
|
35 | - return Tca::grid()->isEditable($this->arguments['name']); |
|
36 | - } |
|
28 | + /** |
|
29 | + * Return whether field name is editable in the Grid. |
|
30 | + * |
|
31 | + * @return boolean |
|
32 | + */ |
|
33 | + public function render() |
|
34 | + { |
|
35 | + return Tca::grid()->isEditable($this->arguments['name']); |
|
36 | + } |
|
37 | 37 | |
38 | 38 | } |