@@ -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 | } |
@@ -17,23 +17,23 @@ |
||
17 | 17 | class IsExcludedViewHelper 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 excluded from the Grid. |
|
30 | - * |
|
31 | - * @return bool |
|
32 | - */ |
|
33 | - public function render() |
|
34 | - { |
|
35 | - $excludedFields = Tca::grid()->getExcludedFields(); |
|
36 | - return !in_array($this->arguments['name'], $excludedFields, true); |
|
37 | - } |
|
28 | + /** |
|
29 | + * Returns whether the column is excluded from the Grid. |
|
30 | + * |
|
31 | + * @return bool |
|
32 | + */ |
|
33 | + public function render() |
|
34 | + { |
|
35 | + $excludedFields = Tca::grid()->getExcludedFields(); |
|
36 | + return !in_array($this->arguments['name'], $excludedFields, true); |
|
37 | + } |
|
38 | 38 | |
39 | 39 | } |