@@ -18,15 +18,15 @@ |
||
18 | 18 | */ |
19 | 19 | class CheckboxSystem extends AbstractComponentView |
20 | 20 | { |
21 | - /** |
|
22 | - * Returns a checkbox for the grids. |
|
23 | - * |
|
24 | - * @param Content $object |
|
25 | - * @param int $offset |
|
26 | - * @return string |
|
27 | - */ |
|
28 | - public function render(Content $object = null, $offset = 0) |
|
29 | - { |
|
30 | - return ''; |
|
31 | - } |
|
21 | + /** |
|
22 | + * Returns a checkbox for the grids. |
|
23 | + * |
|
24 | + * @param Content $object |
|
25 | + * @param int $offset |
|
26 | + * @return string |
|
27 | + */ |
|
28 | + public function render(Content $object = null, $offset = 0) |
|
29 | + { |
|
30 | + return ''; |
|
31 | + } |
|
32 | 32 | } |
@@ -18,14 +18,14 @@ |
||
18 | 18 | */ |
19 | 19 | class ButtonsSystem extends AbstractComponentView |
20 | 20 | { |
21 | - /** |
|
22 | - * Rendering buttons in the grids given a Content object. |
|
23 | - * |
|
24 | - * @param Content $object |
|
25 | - * @return string |
|
26 | - */ |
|
27 | - public function render(Content $object = null) |
|
28 | - { |
|
29 | - return ''; |
|
30 | - } |
|
21 | + /** |
|
22 | + * Rendering buttons in the grids given a Content object. |
|
23 | + * |
|
24 | + * @param Content $object |
|
25 | + * @return string |
|
26 | + */ |
|
27 | + public function render(Content $object = null) |
|
28 | + { |
|
29 | + return ''; |
|
30 | + } |
|
31 | 31 | } |
@@ -17,36 +17,36 @@ discard block |
||
17 | 17 | */ |
18 | 18 | class RelationsCheck extends AbstractComponentView |
19 | 19 | { |
20 | - /** |
|
21 | - * @var array |
|
22 | - */ |
|
23 | - protected $invalidFields = []; |
|
24 | - |
|
25 | - /** |
|
26 | - * Renders a button for uploading assets. |
|
27 | - * |
|
28 | - * @return string |
|
29 | - */ |
|
30 | - public function render() |
|
31 | - { |
|
32 | - $result = ''; |
|
33 | - |
|
34 | - // Check whether storage is configured or not. |
|
35 | - if (!$this->isTcaValid()) { |
|
36 | - $result .= $this->formatMessageTcaIsNotValid(); |
|
37 | - } |
|
38 | - |
|
39 | - return $result; |
|
40 | - } |
|
41 | - |
|
42 | - /** |
|
43 | - * Format a message whenever the storage is offline. |
|
44 | - * |
|
45 | - * @return string |
|
46 | - */ |
|
47 | - protected function formatMessageTcaIsNotValid() |
|
48 | - { |
|
49 | - $result = <<< EOF |
|
20 | + /** |
|
21 | + * @var array |
|
22 | + */ |
|
23 | + protected $invalidFields = []; |
|
24 | + |
|
25 | + /** |
|
26 | + * Renders a button for uploading assets. |
|
27 | + * |
|
28 | + * @return string |
|
29 | + */ |
|
30 | + public function render() |
|
31 | + { |
|
32 | + $result = ''; |
|
33 | + |
|
34 | + // Check whether storage is configured or not. |
|
35 | + if (!$this->isTcaValid()) { |
|
36 | + $result .= $this->formatMessageTcaIsNotValid(); |
|
37 | + } |
|
38 | + |
|
39 | + return $result; |
|
40 | + } |
|
41 | + |
|
42 | + /** |
|
43 | + * Format a message whenever the storage is offline. |
|
44 | + * |
|
45 | + * @return string |
|
46 | + */ |
|
47 | + protected function formatMessageTcaIsNotValid() |
|
48 | + { |
|
49 | + $result = <<< EOF |
|
50 | 50 | <div class="-warning alert alert-warning"> |
51 | 51 | <div class="alert-title"> |
52 | 52 | Grid may have trouble to render because of wrong / missing TCA. |
@@ -61,19 +61,19 @@ discard block |
||
61 | 61 | </div> |
62 | 62 | </div> |
63 | 63 | EOF; |
64 | - return $result; |
|
65 | - } |
|
66 | - |
|
67 | - /** |
|
68 | - * Check relations of current data type in the Grid. |
|
69 | - * |
|
70 | - * @return string |
|
71 | - */ |
|
72 | - protected function formatMessageHelperText() |
|
73 | - { |
|
74 | - $helperText = ''; |
|
75 | - foreach ($this->invalidFields as $invalidField) { |
|
76 | - $helperText .= <<<EOF |
|
64 | + return $result; |
|
65 | + } |
|
66 | + |
|
67 | + /** |
|
68 | + * Check relations of current data type in the Grid. |
|
69 | + * |
|
70 | + * @return string |
|
71 | + */ |
|
72 | + protected function formatMessageHelperText() |
|
73 | + { |
|
74 | + $helperText = ''; |
|
75 | + foreach ($this->invalidFields as $invalidField) { |
|
76 | + $helperText .= <<<EOF |
|
77 | 77 | <br /> |
78 | 78 | In file EXT:my_ext/Configuration/TCA/{$this->getModuleLoader()->getDataType()}.php |
79 | 79 | <pre> |
@@ -107,38 +107,38 @@ discard block |
||
107 | 107 | |
108 | 108 | </pre> |
109 | 109 | EOF; |
110 | - } |
|
111 | - return $helperText; |
|
112 | - } |
|
113 | - |
|
114 | - /** |
|
115 | - * Check relations of current data type in the Grid. |
|
116 | - * |
|
117 | - * @return boolean |
|
118 | - */ |
|
119 | - protected function isTcaValid() |
|
120 | - { |
|
121 | - $dataType = $this->getModuleLoader()->getDataType(); |
|
122 | - $table = Tca::table($dataType); |
|
123 | - |
|
124 | - foreach (Tca::grid($dataType)->getFields() as $fieldName => $configuration) { |
|
125 | - if ($table->hasField($fieldName) && $table->field($fieldName)->hasMany()) { |
|
126 | - if ($table->field($fieldName)->hasRelationManyToMany()) { |
|
127 | - $foreignTable = $table->field($fieldName)->getForeignTable(); |
|
128 | - $manyToManyTable = $table->field($fieldName)->getManyToManyTable(); |
|
129 | - $foreignField = $table->field($fieldName)->getForeignField(); |
|
130 | - |
|
131 | - if (!$foreignField) { |
|
132 | - $this->invalidFields[] = $fieldName; |
|
133 | - } elseif (!$foreignTable) { |
|
134 | - $this->invalidFields[] = $fieldName; |
|
135 | - } elseif (!$manyToManyTable) { |
|
136 | - $this->invalidFields[] = $fieldName; |
|
137 | - } |
|
138 | - } |
|
139 | - } |
|
140 | - } |
|
141 | - |
|
142 | - return empty($this->invalidFields); |
|
143 | - } |
|
110 | + } |
|
111 | + return $helperText; |
|
112 | + } |
|
113 | + |
|
114 | + /** |
|
115 | + * Check relations of current data type in the Grid. |
|
116 | + * |
|
117 | + * @return boolean |
|
118 | + */ |
|
119 | + protected function isTcaValid() |
|
120 | + { |
|
121 | + $dataType = $this->getModuleLoader()->getDataType(); |
|
122 | + $table = Tca::table($dataType); |
|
123 | + |
|
124 | + foreach (Tca::grid($dataType)->getFields() as $fieldName => $configuration) { |
|
125 | + if ($table->hasField($fieldName) && $table->field($fieldName)->hasMany()) { |
|
126 | + if ($table->field($fieldName)->hasRelationManyToMany()) { |
|
127 | + $foreignTable = $table->field($fieldName)->getForeignTable(); |
|
128 | + $manyToManyTable = $table->field($fieldName)->getManyToManyTable(); |
|
129 | + $foreignField = $table->field($fieldName)->getForeignField(); |
|
130 | + |
|
131 | + if (!$foreignField) { |
|
132 | + $this->invalidFields[] = $fieldName; |
|
133 | + } elseif (!$foreignTable) { |
|
134 | + $this->invalidFields[] = $fieldName; |
|
135 | + } elseif (!$manyToManyTable) { |
|
136 | + $this->invalidFields[] = $fieldName; |
|
137 | + } |
|
138 | + } |
|
139 | + } |
|
140 | + } |
|
141 | + |
|
142 | + return empty($this->invalidFields); |
|
143 | + } |
|
144 | 144 | } |
@@ -18,34 +18,34 @@ |
||
18 | 18 | */ |
19 | 19 | class EditUri extends AbstractComponentView |
20 | 20 | { |
21 | - /** |
|
22 | - * Renders a "edit" button to be placed in the grid. |
|
23 | - * |
|
24 | - * @param Content $object |
|
25 | - * @return string |
|
26 | - */ |
|
27 | - public function render(Content $object = null) |
|
28 | - { |
|
29 | - $uri = BackendUtility::getModuleUrl( |
|
30 | - 'record_edit', |
|
31 | - array( |
|
32 | - $this->getEditParameterName($object) => 'edit', |
|
33 | - 'returnUrl' => $this->getModuleLoader()->getModuleUrl() |
|
34 | - ) |
|
35 | - ); |
|
36 | - return $uri; |
|
37 | - } |
|
21 | + /** |
|
22 | + * Renders a "edit" button to be placed in the grid. |
|
23 | + * |
|
24 | + * @param Content $object |
|
25 | + * @return string |
|
26 | + */ |
|
27 | + public function render(Content $object = null) |
|
28 | + { |
|
29 | + $uri = BackendUtility::getModuleUrl( |
|
30 | + 'record_edit', |
|
31 | + array( |
|
32 | + $this->getEditParameterName($object) => 'edit', |
|
33 | + 'returnUrl' => $this->getModuleLoader()->getModuleUrl() |
|
34 | + ) |
|
35 | + ); |
|
36 | + return $uri; |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * @param Content $object |
|
41 | - * @return string |
|
42 | - */ |
|
43 | - protected function getEditParameterName(Content $object) |
|
44 | - { |
|
45 | - return sprintf( |
|
46 | - 'edit[%s][%s]', |
|
47 | - $object->getDataType(), |
|
48 | - $object->getUid() |
|
49 | - ); |
|
50 | - } |
|
39 | + /** |
|
40 | + * @param Content $object |
|
41 | + * @return string |
|
42 | + */ |
|
43 | + protected function getEditParameterName(Content $object) |
|
44 | + { |
|
45 | + return sprintf( |
|
46 | + 'edit[%s][%s]', |
|
47 | + $object->getDataType(), |
|
48 | + $object->getUid() |
|
49 | + ); |
|
50 | + } |
|
51 | 51 | } |
@@ -19,46 +19,46 @@ |
||
19 | 19 | */ |
20 | 20 | class DeleteButton extends AbstractComponentView |
21 | 21 | { |
22 | - /** |
|
23 | - * Renders a "delete" button to be placed in the grid. |
|
24 | - * |
|
25 | - * @param Content $object |
|
26 | - * @return string |
|
27 | - */ |
|
28 | - public function render(Content $object = null) |
|
29 | - { |
|
30 | - $labelField = Tca::table($object->getDataType())->getLabelField(); |
|
31 | - $label = $object[$labelField] ? $object[$labelField] : $object->getUid(); |
|
22 | + /** |
|
23 | + * Renders a "delete" button to be placed in the grid. |
|
24 | + * |
|
25 | + * @param Content $object |
|
26 | + * @return string |
|
27 | + */ |
|
28 | + public function render(Content $object = null) |
|
29 | + { |
|
30 | + $labelField = Tca::table($object->getDataType())->getLabelField(); |
|
31 | + $label = $object[$labelField] ? $object[$labelField] : $object->getUid(); |
|
32 | 32 | |
33 | - return $this->makeLinkButton() |
|
34 | - ->setHref($this->getDeleteUri($object)) |
|
35 | - ->setDataAttributes([ |
|
36 | - 'uid' => $object->getUid(), |
|
37 | - 'toggle' => 'tooltip', |
|
38 | - 'label' => $label, |
|
39 | - ]) |
|
40 | - ->setClasses('btn-delete') |
|
41 | - ->setTitle($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:delete')) |
|
42 | - ->setIcon($this->getIconFactory()->getIcon('actions-edit-delete', Icon::SIZE_SMALL)) |
|
43 | - ->render(); |
|
44 | - } |
|
33 | + return $this->makeLinkButton() |
|
34 | + ->setHref($this->getDeleteUri($object)) |
|
35 | + ->setDataAttributes([ |
|
36 | + 'uid' => $object->getUid(), |
|
37 | + 'toggle' => 'tooltip', |
|
38 | + 'label' => $label, |
|
39 | + ]) |
|
40 | + ->setClasses('btn-delete') |
|
41 | + ->setTitle($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:delete')) |
|
42 | + ->setIcon($this->getIconFactory()->getIcon('actions-edit-delete', Icon::SIZE_SMALL)) |
|
43 | + ->render(); |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * @param Content $object |
|
48 | - * @return string |
|
49 | - */ |
|
50 | - protected function getDeleteUri(Content $object) |
|
51 | - { |
|
52 | - $additionalParameters = array( |
|
53 | - $this->getModuleLoader()->getParameterPrefix() => array( |
|
54 | - 'controller' => 'Content', |
|
55 | - 'action' => 'delete', |
|
56 | - 'format' => 'json', |
|
57 | - 'matches' => array( |
|
58 | - 'uid' => $object->getUid(), |
|
59 | - ), |
|
60 | - ), |
|
61 | - ); |
|
62 | - return $this->getModuleLoader()->getModuleUrl($additionalParameters); |
|
63 | - } |
|
46 | + /** |
|
47 | + * @param Content $object |
|
48 | + * @return string |
|
49 | + */ |
|
50 | + protected function getDeleteUri(Content $object) |
|
51 | + { |
|
52 | + $additionalParameters = array( |
|
53 | + $this->getModuleLoader()->getParameterPrefix() => array( |
|
54 | + 'controller' => 'Content', |
|
55 | + 'action' => 'delete', |
|
56 | + 'format' => 'json', |
|
57 | + 'matches' => array( |
|
58 | + 'uid' => $object->getUid(), |
|
59 | + ), |
|
60 | + ), |
|
61 | + ); |
|
62 | + return $this->getModuleLoader()->getModuleUrl($additionalParameters); |
|
63 | + } |
|
64 | 64 | } |
@@ -22,108 +22,108 @@ |
||
22 | 22 | */ |
23 | 23 | class NewButton extends AbstractComponentView |
24 | 24 | { |
25 | - /** |
|
26 | - * Renders a "new" button to be placed in the doc header. |
|
27 | - * |
|
28 | - * @return string |
|
29 | - */ |
|
30 | - public function render(): string |
|
31 | - { |
|
32 | - $output = ''; |
|
25 | + /** |
|
26 | + * Renders a "new" button to be placed in the doc header. |
|
27 | + * |
|
28 | + * @return string |
|
29 | + */ |
|
30 | + public function render(): string |
|
31 | + { |
|
32 | + $output = ''; |
|
33 | 33 | |
34 | - // New button only for the current data type. |
|
35 | - if ($this->getModulePidService()->isConfiguredPidValid()) { |
|
36 | - $output = $this->makeLinkButton()->setHref($this->getNewUri()) |
|
37 | - ->setTitle($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:newRecordGeneral')) |
|
38 | - ->setIcon($this->getIconFactory()->getIcon('actions-document-new', Icon::SIZE_SMALL)) |
|
39 | - ->render(); |
|
40 | - } |
|
41 | - return $output; |
|
42 | - } |
|
34 | + // New button only for the current data type. |
|
35 | + if ($this->getModulePidService()->isConfiguredPidValid()) { |
|
36 | + $output = $this->makeLinkButton()->setHref($this->getNewUri()) |
|
37 | + ->setTitle($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:newRecordGeneral')) |
|
38 | + ->setIcon($this->getIconFactory()->getIcon('actions-document-new', Icon::SIZE_SMALL)) |
|
39 | + ->render(); |
|
40 | + } |
|
41 | + return $output; |
|
42 | + } |
|
43 | 43 | |
44 | - /** |
|
45 | - * Render a create URI given a data type. |
|
46 | - * |
|
47 | - * @return string |
|
48 | - */ |
|
49 | - protected function getUriWizardNew(): string |
|
50 | - { |
|
51 | - // Return URL in any case. |
|
52 | - $arguments['returnUrl'] = $this->getModuleLoader()->getModuleUrl(); |
|
44 | + /** |
|
45 | + * Render a create URI given a data type. |
|
46 | + * |
|
47 | + * @return string |
|
48 | + */ |
|
49 | + protected function getUriWizardNew(): string |
|
50 | + { |
|
51 | + // Return URL in any case. |
|
52 | + $arguments['returnUrl'] = $this->getModuleLoader()->getModuleUrl(); |
|
53 | 53 | |
54 | - // Add possible id parameter |
|
55 | - if (GeneralUtility::_GP(Parameter::PID)) { |
|
56 | - $arguments['id'] = GeneralUtility::_GP(Parameter::PID); |
|
57 | - } |
|
54 | + // Add possible id parameter |
|
55 | + if (GeneralUtility::_GP(Parameter::PID)) { |
|
56 | + $arguments['id'] = GeneralUtility::_GP(Parameter::PID); |
|
57 | + } |
|
58 | 58 | |
59 | - $uri = BackendUtility::getModuleUrl( |
|
60 | - 'db_new', |
|
61 | - $arguments |
|
62 | - ); |
|
59 | + $uri = BackendUtility::getModuleUrl( |
|
60 | + 'db_new', |
|
61 | + $arguments |
|
62 | + ); |
|
63 | 63 | |
64 | - return $uri; |
|
65 | - } |
|
64 | + return $uri; |
|
65 | + } |
|
66 | 66 | |
67 | - /** |
|
68 | - * Render a create URI given a data type. |
|
69 | - * |
|
70 | - * @return string |
|
71 | - */ |
|
72 | - protected function getNewUri(): string |
|
73 | - { |
|
74 | - $uri = BackendUtility::getModuleUrl( |
|
75 | - 'record_edit', |
|
76 | - array( |
|
77 | - $this->getNewParameterName() => 'new', |
|
78 | - 'returnUrl' => $this->getModuleLoader()->getModuleUrl() |
|
79 | - ) |
|
80 | - ); |
|
81 | - return $uri; |
|
82 | - } |
|
67 | + /** |
|
68 | + * Render a create URI given a data type. |
|
69 | + * |
|
70 | + * @return string |
|
71 | + */ |
|
72 | + protected function getNewUri(): string |
|
73 | + { |
|
74 | + $uri = BackendUtility::getModuleUrl( |
|
75 | + 'record_edit', |
|
76 | + array( |
|
77 | + $this->getNewParameterName() => 'new', |
|
78 | + 'returnUrl' => $this->getModuleLoader()->getModuleUrl() |
|
79 | + ) |
|
80 | + ); |
|
81 | + return $uri; |
|
82 | + } |
|
83 | 83 | |
84 | - /** |
|
85 | - * @return string |
|
86 | - */ |
|
87 | - protected function getNewParameterName(): string |
|
88 | - { |
|
89 | - return sprintf( |
|
90 | - 'edit[%s][%s]', |
|
91 | - $this->getModuleLoader()->getDataType(), |
|
92 | - $this->getStoragePid() |
|
93 | - ); |
|
94 | - } |
|
84 | + /** |
|
85 | + * @return string |
|
86 | + */ |
|
87 | + protected function getNewParameterName(): string |
|
88 | + { |
|
89 | + return sprintf( |
|
90 | + 'edit[%s][%s]', |
|
91 | + $this->getModuleLoader()->getDataType(), |
|
92 | + $this->getStoragePid() |
|
93 | + ); |
|
94 | + } |
|
95 | 95 | |
96 | - /** |
|
97 | - * Return the default configured pid. |
|
98 | - * |
|
99 | - * @return int |
|
100 | - */ |
|
101 | - protected function getStoragePid(): int |
|
102 | - { |
|
103 | - if (GeneralUtility::_GP(Parameter::PID)) { |
|
104 | - $pid = GeneralUtility::_GP(Parameter::PID); |
|
105 | - } elseif ((int)Tca::table()->get('rootLevel') === 1) { |
|
106 | - $pid = 0; |
|
107 | - } else { |
|
108 | - // Get configuration from User TSConfig if any |
|
109 | - $tsConfigPath = sprintf('tx_vidi.dataType.%s.storagePid', $this->getModuleLoader()->getDataType()); |
|
110 | - $tsConfig = $this->getBackendUser()->getTSConfig($tsConfigPath); |
|
111 | - $pid = $tsConfig['value']; |
|
96 | + /** |
|
97 | + * Return the default configured pid. |
|
98 | + * |
|
99 | + * @return int |
|
100 | + */ |
|
101 | + protected function getStoragePid(): int |
|
102 | + { |
|
103 | + if (GeneralUtility::_GP(Parameter::PID)) { |
|
104 | + $pid = GeneralUtility::_GP(Parameter::PID); |
|
105 | + } elseif ((int)Tca::table()->get('rootLevel') === 1) { |
|
106 | + $pid = 0; |
|
107 | + } else { |
|
108 | + // Get configuration from User TSConfig if any |
|
109 | + $tsConfigPath = sprintf('tx_vidi.dataType.%s.storagePid', $this->getModuleLoader()->getDataType()); |
|
110 | + $tsConfig = $this->getBackendUser()->getTSConfig($tsConfigPath); |
|
111 | + $pid = $tsConfig['value']; |
|
112 | 112 | |
113 | - // Get pid from Module Loader |
|
114 | - if (null === $pid) { |
|
115 | - $pid = $this->getModuleLoader()->getDefaultPid(); |
|
116 | - } |
|
117 | - } |
|
118 | - return (int)$pid; |
|
119 | - } |
|
113 | + // Get pid from Module Loader |
|
114 | + if (null === $pid) { |
|
115 | + $pid = $this->getModuleLoader()->getDefaultPid(); |
|
116 | + } |
|
117 | + } |
|
118 | + return (int)$pid; |
|
119 | + } |
|
120 | 120 | |
121 | - /** |
|
122 | - * @return ModulePidService|object |
|
123 | - */ |
|
124 | - public function getModulePidService() |
|
125 | - { |
|
126 | - /** @var ModulePidService $modulePidService */ |
|
127 | - return GeneralUtility::makeInstance(ModulePidService::class); |
|
128 | - } |
|
121 | + /** |
|
122 | + * @return ModulePidService|object |
|
123 | + */ |
|
124 | + public function getModulePidService() |
|
125 | + { |
|
126 | + /** @var ModulePidService $modulePidService */ |
|
127 | + return GeneralUtility::makeInstance(ModulePidService::class); |
|
128 | + } |
|
129 | 129 | } |
@@ -17,31 +17,31 @@ |
||
17 | 17 | */ |
18 | 18 | class ToolButton extends AbstractComponentView |
19 | 19 | { |
20 | - /** |
|
21 | - * Renders a dropdown menu for storage. |
|
22 | - * |
|
23 | - * @return string |
|
24 | - */ |
|
25 | - public function render() |
|
26 | - { |
|
27 | - $result = ''; |
|
20 | + /** |
|
21 | + * Renders a dropdown menu for storage. |
|
22 | + * |
|
23 | + * @return string |
|
24 | + */ |
|
25 | + public function render() |
|
26 | + { |
|
27 | + $result = ''; |
|
28 | 28 | |
29 | - // Compute the additional parameters. |
|
30 | - $additionalParameters = array( |
|
31 | - $this->getModuleLoader()->getParameterPrefix() => array('controller' => 'Tool', 'action' => 'welcome'), |
|
32 | - ); |
|
29 | + // Compute the additional parameters. |
|
30 | + $additionalParameters = array( |
|
31 | + $this->getModuleLoader()->getParameterPrefix() => array('controller' => 'Tool', 'action' => 'welcome'), |
|
32 | + ); |
|
33 | 33 | |
34 | - // Get current data type and tell whether there are registered tools. |
|
35 | - $dataType = $this->getModuleLoader()->getDataType(); |
|
34 | + // Get current data type and tell whether there are registered tools. |
|
35 | + $dataType = $this->getModuleLoader()->getDataType(); |
|
36 | 36 | |
37 | - if (ToolRegistry::getInstance()->hasAnyTools($dataType)) { |
|
38 | - $result = sprintf( |
|
39 | - '<a href="%s&returnUrl=%s" class="btn btn-default btn-sm btn-doc-header" title="%s"><span class="t3-icon fa fa-cog" aria-hidden="true"></span></a>', |
|
40 | - $this->getModuleLoader()->getModuleUrl($additionalParameters), |
|
41 | - urlencode($this->getModuleLoader()->getModuleUrl()), |
|
42 | - $this->getLanguageService()->sL('LLL:EXT:vidi/Resources/Private/Language/locallang.xlf:open_tools') |
|
43 | - ); |
|
44 | - } |
|
45 | - return $result; |
|
46 | - } |
|
37 | + if (ToolRegistry::getInstance()->hasAnyTools($dataType)) { |
|
38 | + $result = sprintf( |
|
39 | + '<a href="%s&returnUrl=%s" class="btn btn-default btn-sm btn-doc-header" title="%s"><span class="t3-icon fa fa-cog" aria-hidden="true"></span></a>', |
|
40 | + $this->getModuleLoader()->getModuleUrl($additionalParameters), |
|
41 | + urlencode($this->getModuleLoader()->getModuleUrl()), |
|
42 | + $this->getLanguageService()->sL('LLL:EXT:vidi/Resources/Private/Language/locallang.xlf:open_tools') |
|
43 | + ); |
|
44 | + } |
|
45 | + return $result; |
|
46 | + } |
|
47 | 47 | } |
@@ -20,34 +20,34 @@ |
||
20 | 20 | */ |
21 | 21 | class EditButton extends AbstractComponentView |
22 | 22 | { |
23 | - /** |
|
24 | - * Renders a "edit" button to be placed in the grid. |
|
25 | - * |
|
26 | - * @param Content $object |
|
27 | - * @return string |
|
28 | - */ |
|
29 | - public function render(Content $object = null) |
|
30 | - { |
|
31 | - $editUri = $this->getUriRenderer()->render($object); |
|
23 | + /** |
|
24 | + * Renders a "edit" button to be placed in the grid. |
|
25 | + * |
|
26 | + * @param Content $object |
|
27 | + * @return string |
|
28 | + */ |
|
29 | + public function render(Content $object = null) |
|
30 | + { |
|
31 | + $editUri = $this->getUriRenderer()->render($object); |
|
32 | 32 | |
33 | - return $this->makeLinkButton() |
|
34 | - ->setHref($editUri) |
|
35 | - ->setDataAttributes([ |
|
36 | - 'uid' => $object->getUid(), |
|
37 | - 'toggle' => 'tooltip', |
|
38 | - ]) |
|
39 | - ->setClasses('btn-edit') |
|
40 | - ->setTitle($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:edit')) |
|
41 | - ->setIcon($this->getIconFactory()->getIcon('actions-document-open', Icon::SIZE_SMALL)) |
|
42 | - ->render(); |
|
43 | - } |
|
33 | + return $this->makeLinkButton() |
|
34 | + ->setHref($editUri) |
|
35 | + ->setDataAttributes([ |
|
36 | + 'uid' => $object->getUid(), |
|
37 | + 'toggle' => 'tooltip', |
|
38 | + ]) |
|
39 | + ->setClasses('btn-edit') |
|
40 | + ->setTitle($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:edit')) |
|
41 | + ->setIcon($this->getIconFactory()->getIcon('actions-document-open', Icon::SIZE_SMALL)) |
|
42 | + ->render(); |
|
43 | + } |
|
44 | 44 | |
45 | - /** |
|
46 | - * @return EditUri |
|
47 | - * @throws \InvalidArgumentException |
|
48 | - */ |
|
49 | - protected function getUriRenderer() |
|
50 | - { |
|
51 | - return GeneralUtility::makeInstance(EditUri::class); |
|
52 | - } |
|
45 | + /** |
|
46 | + * @return EditUri |
|
47 | + * @throws \InvalidArgumentException |
|
48 | + */ |
|
49 | + protected function getUriRenderer() |
|
50 | + { |
|
51 | + return GeneralUtility::makeInstance(EditUri::class); |
|
52 | + } |
|
53 | 53 | } |
@@ -18,51 +18,51 @@ |
||
18 | 18 | */ |
19 | 19 | class ClipboardButton extends AbstractComponentView |
20 | 20 | { |
21 | - /** |
|
22 | - * Renders a "clipboard" button to be placed in the doc header. |
|
23 | - * |
|
24 | - * @return string |
|
25 | - */ |
|
26 | - public function render() |
|
27 | - { |
|
28 | - $button = $this->makeLinkButton() |
|
29 | - ->setHref($this->getShowClipboardUri()) |
|
30 | - ->setDataAttributes([ |
|
31 | - 'style' => $this->getClipboardService()->hasItems() ? '' : 'display: none;', |
|
32 | - ]) |
|
33 | - ->setClasses('btn-clipboard-copy-or-move') |
|
34 | - ->setTitle($this->getLanguageService()->sL('LLL:EXT:vidi/Resources/Private/Language/locallang.xlf:clipboard.copy_or_move')) |
|
35 | - ->setIcon($this->getIconFactory()->getIcon('actions-document-paste-after', Icon::SIZE_SMALL)) |
|
36 | - ->render(); |
|
21 | + /** |
|
22 | + * Renders a "clipboard" button to be placed in the doc header. |
|
23 | + * |
|
24 | + * @return string |
|
25 | + */ |
|
26 | + public function render() |
|
27 | + { |
|
28 | + $button = $this->makeLinkButton() |
|
29 | + ->setHref($this->getShowClipboardUri()) |
|
30 | + ->setDataAttributes([ |
|
31 | + 'style' => $this->getClipboardService()->hasItems() ? '' : 'display: none;', |
|
32 | + ]) |
|
33 | + ->setClasses('btn-clipboard-copy-or-move') |
|
34 | + ->setTitle($this->getLanguageService()->sL('LLL:EXT:vidi/Resources/Private/Language/locallang.xlf:clipboard.copy_or_move')) |
|
35 | + ->setIcon($this->getIconFactory()->getIcon('actions-document-paste-after', Icon::SIZE_SMALL)) |
|
36 | + ->render(); |
|
37 | 37 | |
38 | - // Hack! No API for adding a style upon a button |
|
39 | - $button = str_replace('data-style', 'style', $button); |
|
38 | + // Hack! No API for adding a style upon a button |
|
39 | + $button = str_replace('data-style', 'style', $button); |
|
40 | 40 | |
41 | - $output = sprintf('<div style="float: left; margin-right: 3px">%s</div>', $button); |
|
42 | - return $output; |
|
43 | - } |
|
41 | + $output = sprintf('<div style="float: left; margin-right: 3px">%s</div>', $button); |
|
42 | + return $output; |
|
43 | + } |
|
44 | 44 | |
45 | - /** |
|
46 | - * @return string |
|
47 | - */ |
|
48 | - protected function getShowClipboardUri() |
|
49 | - { |
|
50 | - $additionalParameters = array( |
|
51 | - $this->getModuleLoader()->getParameterPrefix() => array( |
|
52 | - 'controller' => 'Clipboard', |
|
53 | - 'action' => 'show', |
|
54 | - ), |
|
55 | - ); |
|
56 | - return $this->getModuleLoader()->getModuleUrl($additionalParameters); |
|
57 | - } |
|
45 | + /** |
|
46 | + * @return string |
|
47 | + */ |
|
48 | + protected function getShowClipboardUri() |
|
49 | + { |
|
50 | + $additionalParameters = array( |
|
51 | + $this->getModuleLoader()->getParameterPrefix() => array( |
|
52 | + 'controller' => 'Clipboard', |
|
53 | + 'action' => 'show', |
|
54 | + ), |
|
55 | + ); |
|
56 | + return $this->getModuleLoader()->getModuleUrl($additionalParameters); |
|
57 | + } |
|
58 | 58 | |
59 | - /** |
|
60 | - * Get the Vidi Module Loader. |
|
61 | - * |
|
62 | - * @return ClipboardService|object |
|
63 | - */ |
|
64 | - protected function getClipboardService() |
|
65 | - { |
|
66 | - return GeneralUtility::makeInstance(ClipboardService::class); |
|
67 | - } |
|
59 | + /** |
|
60 | + * Get the Vidi Module Loader. |
|
61 | + * |
|
62 | + * @return ClipboardService|object |
|
63 | + */ |
|
64 | + protected function getClipboardService() |
|
65 | + { |
|
66 | + return GeneralUtility::makeInstance(ClipboardService::class); |
|
67 | + } |
|
68 | 68 | } |