@@ -17,20 +17,20 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class ExportCsvMenuItem extends AbstractComponentView |
| 19 | 19 | { |
| 20 | - /** |
|
| 21 | - * Renders a "csv export" item to be placed in the menu. |
|
| 22 | - * Only the admin is allowed to export for now as security is not handled. |
|
| 23 | - * |
|
| 24 | - * @return string |
|
| 25 | - * @throws \InvalidArgumentException |
|
| 26 | - */ |
|
| 27 | - public function render() |
|
| 28 | - { |
|
| 29 | - $result = sprintf( |
|
| 30 | - '<li><a href="#" class="dropdown-item export-csv" data-format="csv">%s %s</a></li>', |
|
| 31 | - $this->getIconFactory()->getIcon('mimetypes-text-csv', Icon::SIZE_SMALL), |
|
| 32 | - $this->getLanguageService()->sL('LLL:EXT:vidi/Resources/Private/Language/locallang.xlf:export-csv') |
|
| 33 | - ); |
|
| 34 | - return $result; |
|
| 35 | - } |
|
| 20 | + /** |
|
| 21 | + * Renders a "csv export" item to be placed in the menu. |
|
| 22 | + * Only the admin is allowed to export for now as security is not handled. |
|
| 23 | + * |
|
| 24 | + * @return string |
|
| 25 | + * @throws \InvalidArgumentException |
|
| 26 | + */ |
|
| 27 | + public function render() |
|
| 28 | + { |
|
| 29 | + $result = sprintf( |
|
| 30 | + '<li><a href="#" class="dropdown-item export-csv" data-format="csv">%s %s</a></li>', |
|
| 31 | + $this->getIconFactory()->getIcon('mimetypes-text-csv', Icon::SIZE_SMALL), |
|
| 32 | + $this->getLanguageService()->sL('LLL:EXT:vidi/Resources/Private/Language/locallang.xlf:export-csv') |
|
| 33 | + ); |
|
| 34 | + return $result; |
|
| 35 | + } |
|
| 36 | 36 | } |
@@ -19,45 +19,45 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | class ClipboardMenuItem extends AbstractComponentView |
| 21 | 21 | { |
| 22 | - /** |
|
| 23 | - * Renders a "mass delete" menu item to be placed in the grid menu. |
|
| 24 | - * |
|
| 25 | - * @return string |
|
| 26 | - */ |
|
| 27 | - public function render() |
|
| 28 | - { |
|
| 29 | - $output = ''; |
|
| 30 | - if ($this->getMediaModule()->hasFolderTree()) { |
|
| 31 | - $output = sprintf( |
|
| 32 | - '<li><a href="%s" class="clipboard-save" >%s %s</a>', |
|
| 33 | - $this->getSaveInClipboardUri(), |
|
| 34 | - $this->getIconFactory()->getIcon('actions-document-paste-after', Icon::SIZE_SMALL), |
|
| 35 | - $this->getLanguageService()->sL('LLL:EXT:vidi/Resources/Private/Language/locallang.xlf:save') |
|
| 36 | - ); |
|
| 37 | - } |
|
| 38 | - return $output; |
|
| 39 | - } |
|
| 22 | + /** |
|
| 23 | + * Renders a "mass delete" menu item to be placed in the grid menu. |
|
| 24 | + * |
|
| 25 | + * @return string |
|
| 26 | + */ |
|
| 27 | + public function render() |
|
| 28 | + { |
|
| 29 | + $output = ''; |
|
| 30 | + if ($this->getMediaModule()->hasFolderTree()) { |
|
| 31 | + $output = sprintf( |
|
| 32 | + '<li><a href="%s" class="clipboard-save" >%s %s</a>', |
|
| 33 | + $this->getSaveInClipboardUri(), |
|
| 34 | + $this->getIconFactory()->getIcon('actions-document-paste-after', Icon::SIZE_SMALL), |
|
| 35 | + $this->getLanguageService()->sL('LLL:EXT:vidi/Resources/Private/Language/locallang.xlf:save') |
|
| 36 | + ); |
|
| 37 | + } |
|
| 38 | + return $output; |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * @return string |
|
| 43 | - */ |
|
| 44 | - protected function getSaveInClipboardUri() |
|
| 45 | - { |
|
| 46 | - $additionalParameters = array( |
|
| 47 | - $this->getModuleLoader()->getParameterPrefix() => array( |
|
| 48 | - 'controller' => 'Clipboard', |
|
| 49 | - 'action' => 'save', |
|
| 50 | - 'format' => 'json', |
|
| 51 | - ), |
|
| 52 | - ); |
|
| 53 | - return $this->getModuleLoader()->getModuleUrl($additionalParameters); |
|
| 54 | - } |
|
| 41 | + /** |
|
| 42 | + * @return string |
|
| 43 | + */ |
|
| 44 | + protected function getSaveInClipboardUri() |
|
| 45 | + { |
|
| 46 | + $additionalParameters = array( |
|
| 47 | + $this->getModuleLoader()->getParameterPrefix() => array( |
|
| 48 | + 'controller' => 'Clipboard', |
|
| 49 | + 'action' => 'save', |
|
| 50 | + 'format' => 'json', |
|
| 51 | + ), |
|
| 52 | + ); |
|
| 53 | + return $this->getModuleLoader()->getModuleUrl($additionalParameters); |
|
| 54 | + } |
|
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * @return MediaModule|object |
|
| 58 | - */ |
|
| 59 | - protected function getMediaModule() |
|
| 60 | - { |
|
| 61 | - return GeneralUtility::makeInstance(MediaModule::class); |
|
| 62 | - } |
|
| 56 | + /** |
|
| 57 | + * @return MediaModule|object |
|
| 58 | + */ |
|
| 59 | + protected function getMediaModule() |
|
| 60 | + { |
|
| 61 | + return GeneralUtility::makeInstance(MediaModule::class); |
|
| 62 | + } |
|
| 63 | 63 | } |
@@ -17,187 +17,187 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class AfterFindContentObjectsSignalArguments |
| 19 | 19 | { |
| 20 | - /** |
|
| 21 | - * @var string |
|
| 22 | - */ |
|
| 23 | - protected $dataType; |
|
| 24 | - |
|
| 25 | - /** |
|
| 26 | - * @var array |
|
| 27 | - */ |
|
| 28 | - protected $contentObjects; |
|
| 29 | - |
|
| 30 | - /** |
|
| 31 | - * @var Matcher |
|
| 32 | - */ |
|
| 33 | - protected $matcher; |
|
| 34 | - |
|
| 35 | - /** |
|
| 36 | - * @var Order |
|
| 37 | - */ |
|
| 38 | - protected $order; |
|
| 39 | - |
|
| 40 | - /** |
|
| 41 | - * @var int |
|
| 42 | - */ |
|
| 43 | - protected $limit; |
|
| 44 | - |
|
| 45 | - /** |
|
| 46 | - * @var int |
|
| 47 | - */ |
|
| 48 | - protected $offset; |
|
| 49 | - |
|
| 50 | - /** |
|
| 51 | - * @var bool |
|
| 52 | - */ |
|
| 53 | - protected $hasBeenProcessed; |
|
| 54 | - |
|
| 55 | - /** |
|
| 56 | - * @var int |
|
| 57 | - */ |
|
| 58 | - protected $numberOfObjects = 0; |
|
| 59 | - |
|
| 60 | - /** |
|
| 61 | - * @param array $contentObjects |
|
| 62 | - * @return $this |
|
| 63 | - */ |
|
| 64 | - public function setContentObjects($contentObjects) |
|
| 65 | - { |
|
| 66 | - $this->contentObjects = $contentObjects; |
|
| 67 | - return $this; |
|
| 68 | - } |
|
| 69 | - |
|
| 70 | - /** |
|
| 71 | - * @return array |
|
| 72 | - */ |
|
| 73 | - public function getContentObjects() |
|
| 74 | - { |
|
| 75 | - return $this->contentObjects; |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - /** |
|
| 79 | - * @param string $dataType |
|
| 80 | - * @return $this |
|
| 81 | - */ |
|
| 82 | - public function setDataType($dataType) |
|
| 83 | - { |
|
| 84 | - $this->dataType = $dataType; |
|
| 85 | - return $this; |
|
| 86 | - } |
|
| 87 | - |
|
| 88 | - /** |
|
| 89 | - * @return string |
|
| 90 | - */ |
|
| 91 | - public function getDataType() |
|
| 92 | - { |
|
| 93 | - return $this->dataType; |
|
| 94 | - } |
|
| 95 | - |
|
| 96 | - /** |
|
| 97 | - * @param boolean $hasBeenProcessed |
|
| 98 | - * @return $this |
|
| 99 | - */ |
|
| 100 | - public function setHasBeenProcessed($hasBeenProcessed) |
|
| 101 | - { |
|
| 102 | - $this->hasBeenProcessed = $hasBeenProcessed; |
|
| 103 | - return $this; |
|
| 104 | - } |
|
| 105 | - |
|
| 106 | - /** |
|
| 107 | - * @return boolean |
|
| 108 | - */ |
|
| 109 | - public function getHasBeenProcessed() |
|
| 110 | - { |
|
| 111 | - return $this->hasBeenProcessed; |
|
| 112 | - } |
|
| 113 | - |
|
| 114 | - /** |
|
| 115 | - * @param int $limit |
|
| 116 | - * @return $this |
|
| 117 | - */ |
|
| 118 | - public function setLimit($limit) |
|
| 119 | - { |
|
| 120 | - $this->limit = $limit; |
|
| 121 | - return $this; |
|
| 122 | - } |
|
| 123 | - |
|
| 124 | - /** |
|
| 125 | - * @return int |
|
| 126 | - */ |
|
| 127 | - public function getLimit() |
|
| 128 | - { |
|
| 129 | - return $this->limit; |
|
| 130 | - } |
|
| 131 | - |
|
| 132 | - /** |
|
| 133 | - * @param Matcher $matcher |
|
| 134 | - * @return $this |
|
| 135 | - */ |
|
| 136 | - public function setMatcher($matcher) |
|
| 137 | - { |
|
| 138 | - $this->matcher = $matcher; |
|
| 139 | - return $this; |
|
| 140 | - } |
|
| 141 | - |
|
| 142 | - /** |
|
| 143 | - * @return Matcher |
|
| 144 | - */ |
|
| 145 | - public function getMatcher() |
|
| 146 | - { |
|
| 147 | - return $this->matcher; |
|
| 148 | - } |
|
| 149 | - |
|
| 150 | - /** |
|
| 151 | - * @return Order |
|
| 152 | - */ |
|
| 153 | - public function getOrder() |
|
| 154 | - { |
|
| 155 | - return $this->order; |
|
| 156 | - } |
|
| 157 | - |
|
| 158 | - /** |
|
| 159 | - * @param Order $order |
|
| 160 | - * @return $this |
|
| 161 | - */ |
|
| 162 | - public function setOrder($order) |
|
| 163 | - { |
|
| 164 | - $this->order = $order; |
|
| 165 | - return $this; |
|
| 166 | - } |
|
| 167 | - |
|
| 168 | - /** |
|
| 169 | - * @param int $numberOfObjects |
|
| 170 | - * @return $this |
|
| 171 | - */ |
|
| 172 | - public function setNumberOfObjects($numberOfObjects) |
|
| 173 | - { |
|
| 174 | - $this->numberOfObjects = $numberOfObjects; |
|
| 175 | - return $this; |
|
| 176 | - } |
|
| 177 | - |
|
| 178 | - /** |
|
| 179 | - * @return int |
|
| 180 | - */ |
|
| 181 | - public function getNumberOfObjects() |
|
| 182 | - { |
|
| 183 | - return $this->numberOfObjects; |
|
| 184 | - } |
|
| 185 | - |
|
| 186 | - /** |
|
| 187 | - * @param int $offset |
|
| 188 | - * @return $this |
|
| 189 | - */ |
|
| 190 | - public function setOffset($offset) |
|
| 191 | - { |
|
| 192 | - $this->offset = $offset; |
|
| 193 | - return $this; |
|
| 194 | - } |
|
| 195 | - |
|
| 196 | - /** |
|
| 197 | - * @return int |
|
| 198 | - */ |
|
| 199 | - public function getOffset() |
|
| 200 | - { |
|
| 201 | - return $this->offset; |
|
| 202 | - } |
|
| 20 | + /** |
|
| 21 | + * @var string |
|
| 22 | + */ |
|
| 23 | + protected $dataType; |
|
| 24 | + |
|
| 25 | + /** |
|
| 26 | + * @var array |
|
| 27 | + */ |
|
| 28 | + protected $contentObjects; |
|
| 29 | + |
|
| 30 | + /** |
|
| 31 | + * @var Matcher |
|
| 32 | + */ |
|
| 33 | + protected $matcher; |
|
| 34 | + |
|
| 35 | + /** |
|
| 36 | + * @var Order |
|
| 37 | + */ |
|
| 38 | + protected $order; |
|
| 39 | + |
|
| 40 | + /** |
|
| 41 | + * @var int |
|
| 42 | + */ |
|
| 43 | + protected $limit; |
|
| 44 | + |
|
| 45 | + /** |
|
| 46 | + * @var int |
|
| 47 | + */ |
|
| 48 | + protected $offset; |
|
| 49 | + |
|
| 50 | + /** |
|
| 51 | + * @var bool |
|
| 52 | + */ |
|
| 53 | + protected $hasBeenProcessed; |
|
| 54 | + |
|
| 55 | + /** |
|
| 56 | + * @var int |
|
| 57 | + */ |
|
| 58 | + protected $numberOfObjects = 0; |
|
| 59 | + |
|
| 60 | + /** |
|
| 61 | + * @param array $contentObjects |
|
| 62 | + * @return $this |
|
| 63 | + */ |
|
| 64 | + public function setContentObjects($contentObjects) |
|
| 65 | + { |
|
| 66 | + $this->contentObjects = $contentObjects; |
|
| 67 | + return $this; |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + /** |
|
| 71 | + * @return array |
|
| 72 | + */ |
|
| 73 | + public function getContentObjects() |
|
| 74 | + { |
|
| 75 | + return $this->contentObjects; |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + /** |
|
| 79 | + * @param string $dataType |
|
| 80 | + * @return $this |
|
| 81 | + */ |
|
| 82 | + public function setDataType($dataType) |
|
| 83 | + { |
|
| 84 | + $this->dataType = $dataType; |
|
| 85 | + return $this; |
|
| 86 | + } |
|
| 87 | + |
|
| 88 | + /** |
|
| 89 | + * @return string |
|
| 90 | + */ |
|
| 91 | + public function getDataType() |
|
| 92 | + { |
|
| 93 | + return $this->dataType; |
|
| 94 | + } |
|
| 95 | + |
|
| 96 | + /** |
|
| 97 | + * @param boolean $hasBeenProcessed |
|
| 98 | + * @return $this |
|
| 99 | + */ |
|
| 100 | + public function setHasBeenProcessed($hasBeenProcessed) |
|
| 101 | + { |
|
| 102 | + $this->hasBeenProcessed = $hasBeenProcessed; |
|
| 103 | + return $this; |
|
| 104 | + } |
|
| 105 | + |
|
| 106 | + /** |
|
| 107 | + * @return boolean |
|
| 108 | + */ |
|
| 109 | + public function getHasBeenProcessed() |
|
| 110 | + { |
|
| 111 | + return $this->hasBeenProcessed; |
|
| 112 | + } |
|
| 113 | + |
|
| 114 | + /** |
|
| 115 | + * @param int $limit |
|
| 116 | + * @return $this |
|
| 117 | + */ |
|
| 118 | + public function setLimit($limit) |
|
| 119 | + { |
|
| 120 | + $this->limit = $limit; |
|
| 121 | + return $this; |
|
| 122 | + } |
|
| 123 | + |
|
| 124 | + /** |
|
| 125 | + * @return int |
|
| 126 | + */ |
|
| 127 | + public function getLimit() |
|
| 128 | + { |
|
| 129 | + return $this->limit; |
|
| 130 | + } |
|
| 131 | + |
|
| 132 | + /** |
|
| 133 | + * @param Matcher $matcher |
|
| 134 | + * @return $this |
|
| 135 | + */ |
|
| 136 | + public function setMatcher($matcher) |
|
| 137 | + { |
|
| 138 | + $this->matcher = $matcher; |
|
| 139 | + return $this; |
|
| 140 | + } |
|
| 141 | + |
|
| 142 | + /** |
|
| 143 | + * @return Matcher |
|
| 144 | + */ |
|
| 145 | + public function getMatcher() |
|
| 146 | + { |
|
| 147 | + return $this->matcher; |
|
| 148 | + } |
|
| 149 | + |
|
| 150 | + /** |
|
| 151 | + * @return Order |
|
| 152 | + */ |
|
| 153 | + public function getOrder() |
|
| 154 | + { |
|
| 155 | + return $this->order; |
|
| 156 | + } |
|
| 157 | + |
|
| 158 | + /** |
|
| 159 | + * @param Order $order |
|
| 160 | + * @return $this |
|
| 161 | + */ |
|
| 162 | + public function setOrder($order) |
|
| 163 | + { |
|
| 164 | + $this->order = $order; |
|
| 165 | + return $this; |
|
| 166 | + } |
|
| 167 | + |
|
| 168 | + /** |
|
| 169 | + * @param int $numberOfObjects |
|
| 170 | + * @return $this |
|
| 171 | + */ |
|
| 172 | + public function setNumberOfObjects($numberOfObjects) |
|
| 173 | + { |
|
| 174 | + $this->numberOfObjects = $numberOfObjects; |
|
| 175 | + return $this; |
|
| 176 | + } |
|
| 177 | + |
|
| 178 | + /** |
|
| 179 | + * @return int |
|
| 180 | + */ |
|
| 181 | + public function getNumberOfObjects() |
|
| 182 | + { |
|
| 183 | + return $this->numberOfObjects; |
|
| 184 | + } |
|
| 185 | + |
|
| 186 | + /** |
|
| 187 | + * @param int $offset |
|
| 188 | + * @return $this |
|
| 189 | + */ |
|
| 190 | + public function setOffset($offset) |
|
| 191 | + { |
|
| 192 | + $this->offset = $offset; |
|
| 193 | + return $this; |
|
| 194 | + } |
|
| 195 | + |
|
| 196 | + /** |
|
| 197 | + * @return int |
|
| 198 | + */ |
|
| 199 | + public function getOffset() |
|
| 200 | + { |
|
| 201 | + return $this->offset; |
|
| 202 | + } |
|
| 203 | 203 | } |
@@ -16,141 +16,141 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | class ProcessContentDataSignalArguments |
| 18 | 18 | { |
| 19 | - /** |
|
| 20 | - * @var Content |
|
| 21 | - */ |
|
| 22 | - protected $contentObject; |
|
| 23 | - |
|
| 24 | - /** |
|
| 25 | - * @var array |
|
| 26 | - */ |
|
| 27 | - protected $contentData; |
|
| 28 | - |
|
| 29 | - /** |
|
| 30 | - * @var string |
|
| 31 | - */ |
|
| 32 | - protected $fieldNameAndPath; |
|
| 33 | - |
|
| 34 | - /** |
|
| 35 | - * @var int |
|
| 36 | - */ |
|
| 37 | - protected $counter; |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * @var int |
|
| 41 | - */ |
|
| 42 | - protected $savingBehavior; |
|
| 43 | - |
|
| 44 | - /** |
|
| 45 | - * @var int |
|
| 46 | - */ |
|
| 47 | - protected $language; |
|
| 48 | - |
|
| 49 | - /** |
|
| 50 | - * @param array $contentData |
|
| 51 | - * @return $this |
|
| 52 | - */ |
|
| 53 | - public function setContentData($contentData) |
|
| 54 | - { |
|
| 55 | - $this->contentData = $contentData; |
|
| 56 | - return $this; |
|
| 57 | - } |
|
| 58 | - |
|
| 59 | - /** |
|
| 60 | - * @return array |
|
| 61 | - */ |
|
| 62 | - public function getContentData() |
|
| 63 | - { |
|
| 64 | - return $this->contentData; |
|
| 65 | - } |
|
| 66 | - |
|
| 67 | - /** |
|
| 68 | - * @param Content $contentObject |
|
| 69 | - * @return $this |
|
| 70 | - */ |
|
| 71 | - public function setContentObject($contentObject) |
|
| 72 | - { |
|
| 73 | - $this->contentObject = $contentObject; |
|
| 74 | - return $this; |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - /** |
|
| 78 | - * @return Content |
|
| 79 | - */ |
|
| 80 | - public function getContentObject() |
|
| 81 | - { |
|
| 82 | - return $this->contentObject; |
|
| 83 | - } |
|
| 84 | - |
|
| 85 | - /** |
|
| 86 | - * @param string $fieldNameAndPath |
|
| 87 | - * @return $this |
|
| 88 | - */ |
|
| 89 | - public function setFieldNameAndPath($fieldNameAndPath) |
|
| 90 | - { |
|
| 91 | - $this->fieldNameAndPath = $fieldNameAndPath; |
|
| 92 | - return $this; |
|
| 93 | - } |
|
| 94 | - |
|
| 95 | - /** |
|
| 96 | - * @return string |
|
| 97 | - */ |
|
| 98 | - public function getFieldNameAndPath() |
|
| 99 | - { |
|
| 100 | - return $this->fieldNameAndPath; |
|
| 101 | - } |
|
| 102 | - |
|
| 103 | - /** |
|
| 104 | - * @param int $counter |
|
| 105 | - * @return $this |
|
| 106 | - */ |
|
| 107 | - public function setCounter($counter) |
|
| 108 | - { |
|
| 109 | - $this->counter = $counter; |
|
| 110 | - return $this; |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - /** |
|
| 114 | - * @return int |
|
| 115 | - */ |
|
| 116 | - public function getCounter() |
|
| 117 | - { |
|
| 118 | - return $this->counter; |
|
| 119 | - } |
|
| 120 | - |
|
| 121 | - /** |
|
| 122 | - * @param int $savingBehavior |
|
| 123 | - * @return $this |
|
| 124 | - */ |
|
| 125 | - public function setSavingBehavior($savingBehavior) |
|
| 126 | - { |
|
| 127 | - $this->savingBehavior = $savingBehavior; |
|
| 128 | - return $this; |
|
| 129 | - } |
|
| 130 | - |
|
| 131 | - /** |
|
| 132 | - * @return int |
|
| 133 | - */ |
|
| 134 | - public function getSavingBehavior() |
|
| 135 | - { |
|
| 136 | - return $this->savingBehavior; |
|
| 137 | - } |
|
| 138 | - |
|
| 139 | - /** |
|
| 140 | - * @return int |
|
| 141 | - */ |
|
| 142 | - public function getLanguage() |
|
| 143 | - { |
|
| 144 | - return $this->language; |
|
| 145 | - } |
|
| 146 | - |
|
| 147 | - /** |
|
| 148 | - * @param int $language |
|
| 149 | - * @return $this |
|
| 150 | - */ |
|
| 151 | - public function setLanguage($language) |
|
| 152 | - { |
|
| 153 | - $this->language = $language; |
|
| 154 | - return $this; |
|
| 155 | - } |
|
| 19 | + /** |
|
| 20 | + * @var Content |
|
| 21 | + */ |
|
| 22 | + protected $contentObject; |
|
| 23 | + |
|
| 24 | + /** |
|
| 25 | + * @var array |
|
| 26 | + */ |
|
| 27 | + protected $contentData; |
|
| 28 | + |
|
| 29 | + /** |
|
| 30 | + * @var string |
|
| 31 | + */ |
|
| 32 | + protected $fieldNameAndPath; |
|
| 33 | + |
|
| 34 | + /** |
|
| 35 | + * @var int |
|
| 36 | + */ |
|
| 37 | + protected $counter; |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * @var int |
|
| 41 | + */ |
|
| 42 | + protected $savingBehavior; |
|
| 43 | + |
|
| 44 | + /** |
|
| 45 | + * @var int |
|
| 46 | + */ |
|
| 47 | + protected $language; |
|
| 48 | + |
|
| 49 | + /** |
|
| 50 | + * @param array $contentData |
|
| 51 | + * @return $this |
|
| 52 | + */ |
|
| 53 | + public function setContentData($contentData) |
|
| 54 | + { |
|
| 55 | + $this->contentData = $contentData; |
|
| 56 | + return $this; |
|
| 57 | + } |
|
| 58 | + |
|
| 59 | + /** |
|
| 60 | + * @return array |
|
| 61 | + */ |
|
| 62 | + public function getContentData() |
|
| 63 | + { |
|
| 64 | + return $this->contentData; |
|
| 65 | + } |
|
| 66 | + |
|
| 67 | + /** |
|
| 68 | + * @param Content $contentObject |
|
| 69 | + * @return $this |
|
| 70 | + */ |
|
| 71 | + public function setContentObject($contentObject) |
|
| 72 | + { |
|
| 73 | + $this->contentObject = $contentObject; |
|
| 74 | + return $this; |
|
| 75 | + } |
|
| 76 | + |
|
| 77 | + /** |
|
| 78 | + * @return Content |
|
| 79 | + */ |
|
| 80 | + public function getContentObject() |
|
| 81 | + { |
|
| 82 | + return $this->contentObject; |
|
| 83 | + } |
|
| 84 | + |
|
| 85 | + /** |
|
| 86 | + * @param string $fieldNameAndPath |
|
| 87 | + * @return $this |
|
| 88 | + */ |
|
| 89 | + public function setFieldNameAndPath($fieldNameAndPath) |
|
| 90 | + { |
|
| 91 | + $this->fieldNameAndPath = $fieldNameAndPath; |
|
| 92 | + return $this; |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + /** |
|
| 96 | + * @return string |
|
| 97 | + */ |
|
| 98 | + public function getFieldNameAndPath() |
|
| 99 | + { |
|
| 100 | + return $this->fieldNameAndPath; |
|
| 101 | + } |
|
| 102 | + |
|
| 103 | + /** |
|
| 104 | + * @param int $counter |
|
| 105 | + * @return $this |
|
| 106 | + */ |
|
| 107 | + public function setCounter($counter) |
|
| 108 | + { |
|
| 109 | + $this->counter = $counter; |
|
| 110 | + return $this; |
|
| 111 | + } |
|
| 112 | + |
|
| 113 | + /** |
|
| 114 | + * @return int |
|
| 115 | + */ |
|
| 116 | + public function getCounter() |
|
| 117 | + { |
|
| 118 | + return $this->counter; |
|
| 119 | + } |
|
| 120 | + |
|
| 121 | + /** |
|
| 122 | + * @param int $savingBehavior |
|
| 123 | + * @return $this |
|
| 124 | + */ |
|
| 125 | + public function setSavingBehavior($savingBehavior) |
|
| 126 | + { |
|
| 127 | + $this->savingBehavior = $savingBehavior; |
|
| 128 | + return $this; |
|
| 129 | + } |
|
| 130 | + |
|
| 131 | + /** |
|
| 132 | + * @return int |
|
| 133 | + */ |
|
| 134 | + public function getSavingBehavior() |
|
| 135 | + { |
|
| 136 | + return $this->savingBehavior; |
|
| 137 | + } |
|
| 138 | + |
|
| 139 | + /** |
|
| 140 | + * @return int |
|
| 141 | + */ |
|
| 142 | + public function getLanguage() |
|
| 143 | + { |
|
| 144 | + return $this->language; |
|
| 145 | + } |
|
| 146 | + |
|
| 147 | + /** |
|
| 148 | + * @param int $language |
|
| 149 | + * @return $this |
|
| 150 | + */ |
|
| 151 | + public function setLanguage($language) |
|
| 152 | + { |
|
| 153 | + $this->language = $language; |
|
| 154 | + return $this; |
|
| 155 | + } |
|
| 156 | 156 | } |
@@ -19,114 +19,114 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | class BackendUtility |
| 21 | 21 | { |
| 22 | - /******************************************* |
|
| 22 | + /******************************************* |
|
| 23 | 23 | * |
| 24 | 24 | * SQL-related, selecting records, searching |
| 25 | 25 | * |
| 26 | 26 | *******************************************/ |
| 27 | - /** |
|
| 28 | - * Returns the WHERE clause " AND NOT [tablename].[deleted-field]" if a deleted-field |
|
| 29 | - * is configured in $GLOBALS['TCA'] for the tablename, $table |
|
| 30 | - * This function should ALWAYS be called in the backend for selection on tables which |
|
| 31 | - * are configured in $GLOBALS['TCA'] since it will ensure consistent selection of records, |
|
| 32 | - * even if they are marked deleted (in which case the system must always treat them as non-existent!) |
|
| 33 | - * In the frontend a function, ->enableFields(), is known to filter hidden-field, start- and endtime |
|
| 34 | - * and fe_groups as well. But that is a job of the frontend, not the backend. If you need filtering |
|
| 35 | - * on those fields as well in the backend you can use ->BEenableFields() though. |
|
| 36 | - * |
|
| 37 | - * @param string $table Table name present in $GLOBALS['TCA'] |
|
| 38 | - * @param string $withLogicalSeparator Table alias if any |
|
| 39 | - * @return string WHERE clause for filtering out deleted records, eg " AND tablename.deleted=0 |
|
| 40 | - */ |
|
| 41 | - public static function deleteClause($table, $withLogicalSeparator = ' AND') |
|
| 42 | - { |
|
| 43 | - if (empty($GLOBALS['TCA'][$table]['ctrl']['delete'])) { |
|
| 44 | - return ''; |
|
| 45 | - } |
|
| 46 | - $expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
|
| 47 | - ->getQueryBuilderForTable($table) |
|
| 48 | - ->expr(); |
|
| 49 | - return $withLogicalSeparator . ' ' . $expressionBuilder->eq( |
|
| 50 | - $table . '.' . $GLOBALS['TCA'][$table]['ctrl']['delete'], |
|
| 51 | - 0 |
|
| 52 | - ); |
|
| 53 | - } |
|
| 54 | - /** |
|
| 55 | - * Backend implementation of enableFields() |
|
| 56 | - * Notice that "fe_groups" is not selected for - only disabled, starttime and endtime. |
|
| 57 | - * Notice that deleted-fields are NOT filtered - you must ALSO call deleteClause in addition. |
|
| 58 | - * $GLOBALS["SIM_ACCESS_TIME"] is used for date. |
|
| 59 | - * |
|
| 60 | - * @param string $table The table from which to return enableFields WHERE clause. Table name must have a 'ctrl' section in $GLOBALS['TCA']. |
|
| 61 | - * @param bool $inv Means that the query will select all records NOT VISIBLE records (inverted selection) |
|
| 62 | - * @return string WHERE clause part |
|
| 63 | - */ |
|
| 64 | - public static function BEenableFields($table, $inv = false) |
|
| 65 | - { |
|
| 66 | - $ctrl = $GLOBALS['TCA'][$table]['ctrl']; |
|
| 67 | - $expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
|
| 68 | - ->getConnectionForTable($table) |
|
| 69 | - ->getExpressionBuilder(); |
|
| 70 | - $query = $expressionBuilder->andX(); |
|
| 71 | - $invQuery = $expressionBuilder->orX(); |
|
| 27 | + /** |
|
| 28 | + * Returns the WHERE clause " AND NOT [tablename].[deleted-field]" if a deleted-field |
|
| 29 | + * is configured in $GLOBALS['TCA'] for the tablename, $table |
|
| 30 | + * This function should ALWAYS be called in the backend for selection on tables which |
|
| 31 | + * are configured in $GLOBALS['TCA'] since it will ensure consistent selection of records, |
|
| 32 | + * even if they are marked deleted (in which case the system must always treat them as non-existent!) |
|
| 33 | + * In the frontend a function, ->enableFields(), is known to filter hidden-field, start- and endtime |
|
| 34 | + * and fe_groups as well. But that is a job of the frontend, not the backend. If you need filtering |
|
| 35 | + * on those fields as well in the backend you can use ->BEenableFields() though. |
|
| 36 | + * |
|
| 37 | + * @param string $table Table name present in $GLOBALS['TCA'] |
|
| 38 | + * @param string $withLogicalSeparator Table alias if any |
|
| 39 | + * @return string WHERE clause for filtering out deleted records, eg " AND tablename.deleted=0 |
|
| 40 | + */ |
|
| 41 | + public static function deleteClause($table, $withLogicalSeparator = ' AND') |
|
| 42 | + { |
|
| 43 | + if (empty($GLOBALS['TCA'][$table]['ctrl']['delete'])) { |
|
| 44 | + return ''; |
|
| 45 | + } |
|
| 46 | + $expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
|
| 47 | + ->getQueryBuilderForTable($table) |
|
| 48 | + ->expr(); |
|
| 49 | + return $withLogicalSeparator . ' ' . $expressionBuilder->eq( |
|
| 50 | + $table . '.' . $GLOBALS['TCA'][$table]['ctrl']['delete'], |
|
| 51 | + 0 |
|
| 52 | + ); |
|
| 53 | + } |
|
| 54 | + /** |
|
| 55 | + * Backend implementation of enableFields() |
|
| 56 | + * Notice that "fe_groups" is not selected for - only disabled, starttime and endtime. |
|
| 57 | + * Notice that deleted-fields are NOT filtered - you must ALSO call deleteClause in addition. |
|
| 58 | + * $GLOBALS["SIM_ACCESS_TIME"] is used for date. |
|
| 59 | + * |
|
| 60 | + * @param string $table The table from which to return enableFields WHERE clause. Table name must have a 'ctrl' section in $GLOBALS['TCA']. |
|
| 61 | + * @param bool $inv Means that the query will select all records NOT VISIBLE records (inverted selection) |
|
| 62 | + * @return string WHERE clause part |
|
| 63 | + */ |
|
| 64 | + public static function BEenableFields($table, $inv = false) |
|
| 65 | + { |
|
| 66 | + $ctrl = $GLOBALS['TCA'][$table]['ctrl']; |
|
| 67 | + $expressionBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
|
| 68 | + ->getConnectionForTable($table) |
|
| 69 | + ->getExpressionBuilder(); |
|
| 70 | + $query = $expressionBuilder->andX(); |
|
| 71 | + $invQuery = $expressionBuilder->orX(); |
|
| 72 | 72 | |
| 73 | - if (is_array($ctrl)) { |
|
| 74 | - if (is_array($ctrl['enablecolumns'])) { |
|
| 75 | - if ($ctrl['enablecolumns']['disabled'] ?? false) { |
|
| 76 | - $field = $table . '.' . $ctrl['enablecolumns']['disabled']; |
|
| 77 | - $query->add($expressionBuilder->eq($field, 0)); |
|
| 78 | - $invQuery->add($expressionBuilder->neq($field, 0)); |
|
| 79 | - } |
|
| 80 | - if ($ctrl['enablecolumns']['starttime'] ?? false) { |
|
| 81 | - $field = $table . '.' . $ctrl['enablecolumns']['starttime']; |
|
| 82 | - $query->add($expressionBuilder->lte($field, (int)GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('date', 'timestamp'))); |
|
| 83 | - $invQuery->add( |
|
| 84 | - $expressionBuilder->andX( |
|
| 85 | - $expressionBuilder->neq($field, 0), |
|
| 86 | - $expressionBuilder->gt($field, (int)GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('date', 'timestamp')) |
|
| 87 | - ) |
|
| 88 | - ); |
|
| 89 | - } |
|
| 90 | - if ($ctrl['enablecolumns']['endtime'] ?? false) { |
|
| 91 | - $field = $table . '.' . $ctrl['enablecolumns']['endtime']; |
|
| 92 | - $query->add( |
|
| 93 | - $expressionBuilder->orX( |
|
| 94 | - $expressionBuilder->eq($field, 0), |
|
| 95 | - $expressionBuilder->gt($field, (int)GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('date', 'timestamp')) |
|
| 96 | - ) |
|
| 97 | - ); |
|
| 98 | - $invQuery->add( |
|
| 99 | - $expressionBuilder->andX( |
|
| 100 | - $expressionBuilder->neq($field, 0), |
|
| 101 | - $expressionBuilder->lte($field, (int)GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('date', 'timestamp')) |
|
| 102 | - ) |
|
| 103 | - ); |
|
| 104 | - } |
|
| 105 | - } |
|
| 106 | - } |
|
| 73 | + if (is_array($ctrl)) { |
|
| 74 | + if (is_array($ctrl['enablecolumns'])) { |
|
| 75 | + if ($ctrl['enablecolumns']['disabled'] ?? false) { |
|
| 76 | + $field = $table . '.' . $ctrl['enablecolumns']['disabled']; |
|
| 77 | + $query->add($expressionBuilder->eq($field, 0)); |
|
| 78 | + $invQuery->add($expressionBuilder->neq($field, 0)); |
|
| 79 | + } |
|
| 80 | + if ($ctrl['enablecolumns']['starttime'] ?? false) { |
|
| 81 | + $field = $table . '.' . $ctrl['enablecolumns']['starttime']; |
|
| 82 | + $query->add($expressionBuilder->lte($field, (int)GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('date', 'timestamp'))); |
|
| 83 | + $invQuery->add( |
|
| 84 | + $expressionBuilder->andX( |
|
| 85 | + $expressionBuilder->neq($field, 0), |
|
| 86 | + $expressionBuilder->gt($field, (int)GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('date', 'timestamp')) |
|
| 87 | + ) |
|
| 88 | + ); |
|
| 89 | + } |
|
| 90 | + if ($ctrl['enablecolumns']['endtime'] ?? false) { |
|
| 91 | + $field = $table . '.' . $ctrl['enablecolumns']['endtime']; |
|
| 92 | + $query->add( |
|
| 93 | + $expressionBuilder->orX( |
|
| 94 | + $expressionBuilder->eq($field, 0), |
|
| 95 | + $expressionBuilder->gt($field, (int)GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('date', 'timestamp')) |
|
| 96 | + ) |
|
| 97 | + ); |
|
| 98 | + $invQuery->add( |
|
| 99 | + $expressionBuilder->andX( |
|
| 100 | + $expressionBuilder->neq($field, 0), |
|
| 101 | + $expressionBuilder->lte($field, (int)GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('date', 'timestamp')) |
|
| 102 | + ) |
|
| 103 | + ); |
|
| 104 | + } |
|
| 105 | + } |
|
| 106 | + } |
|
| 107 | 107 | |
| 108 | - if ($query->count() === 0) { |
|
| 109 | - return ''; |
|
| 110 | - } |
|
| 108 | + if ($query->count() === 0) { |
|
| 109 | + return ''; |
|
| 110 | + } |
|
| 111 | 111 | |
| 112 | - return ' AND ' . ($inv ? $invQuery : $query); |
|
| 113 | - } |
|
| 112 | + return ' AND ' . ($inv ? $invQuery : $query); |
|
| 113 | + } |
|
| 114 | 114 | |
| 115 | - /** |
|
| 116 | - * Returns the URL to a given module |
|
| 117 | - * |
|
| 118 | - * @param string $moduleName Name of the module |
|
| 119 | - * @param array $urlParameters URL parameters that should be added as key value pairs |
|
| 120 | - * @return string Calculated URL |
|
| 121 | - */ |
|
| 122 | - public static function getModuleUrl($moduleName, $urlParameters = []) |
|
| 123 | - { |
|
| 124 | - $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); |
|
| 125 | - try { |
|
| 126 | - $uri = $uriBuilder->buildUriFromRoute($moduleName, $urlParameters); |
|
| 127 | - } catch (RouteNotFoundException $e) { |
|
| 128 | - $uri = $uriBuilder->buildUriFromRoutePath($moduleName, $urlParameters); |
|
| 129 | - } |
|
| 130 | - return (string)$uri; |
|
| 131 | - } |
|
| 115 | + /** |
|
| 116 | + * Returns the URL to a given module |
|
| 117 | + * |
|
| 118 | + * @param string $moduleName Name of the module |
|
| 119 | + * @param array $urlParameters URL parameters that should be added as key value pairs |
|
| 120 | + * @return string Calculated URL |
|
| 121 | + */ |
|
| 122 | + public static function getModuleUrl($moduleName, $urlParameters = []) |
|
| 123 | + { |
|
| 124 | + $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); |
|
| 125 | + try { |
|
| 126 | + $uri = $uriBuilder->buildUriFromRoute($moduleName, $urlParameters); |
|
| 127 | + } catch (RouteNotFoundException $e) { |
|
| 128 | + $uri = $uriBuilder->buildUriFromRoutePath($moduleName, $urlParameters); |
|
| 129 | + } |
|
| 130 | + return (string)$uri; |
|
| 131 | + } |
|
| 132 | 132 | } |
@@ -8,32 +8,32 @@ |
||
| 8 | 8 | defined('TYPO3') or die(); |
| 9 | 9 | |
| 10 | 10 | call_user_func(function () { |
| 11 | - $configuration = GeneralUtility::makeInstance( |
|
| 12 | - ExtensionConfiguration::class |
|
| 13 | - )->get('vidi'); |
|
| 14 | - |
|
| 15 | - if (false === isset($configuration['autoload_typoscript']) || true === (bool)$configuration['autoload_typoscript']) { |
|
| 16 | - ExtensionManagementUtility::addTypoScript( |
|
| 17 | - 'vidi', |
|
| 18 | - 'constants', |
|
| 19 | - '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:vidi/Configuration/TypoScript/constants.txt">' |
|
| 20 | - ); |
|
| 21 | - |
|
| 22 | - ExtensionManagementUtility::addTypoScript( |
|
| 23 | - 'vidi', |
|
| 24 | - 'setup', |
|
| 25 | - '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:vidi/Configuration/TypoScript/setup.txt">' |
|
| 26 | - ); |
|
| 27 | - } |
|
| 28 | - |
|
| 29 | - // Initialize generic Vidi modules after the TCA is loaded. |
|
| 30 | - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['extTablesInclusion-PostProcessing'][] = 'Fab\Vidi\Configuration\VidiModulesAspect'; |
|
| 31 | - |
|
| 32 | - // Initialize generic grid TCA for all data types |
|
| 33 | - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['extTablesInclusion-PostProcessing'][] = 'Fab\Vidi\Configuration\TcaGridAspect'; |
|
| 34 | - |
|
| 35 | - // cache configuration, see https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/CachingFramework/Configuration/Index.html#cache-configurations |
|
| 36 | - $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['vidi']['frontend'] = VariableFrontend::class; |
|
| 37 | - $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['vidi']['groups'] = array('all', 'vidi'); |
|
| 38 | - $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['vidi']['options']['defaultLifetime'] = 2592000; |
|
| 11 | + $configuration = GeneralUtility::makeInstance( |
|
| 12 | + ExtensionConfiguration::class |
|
| 13 | + )->get('vidi'); |
|
| 14 | + |
|
| 15 | + if (false === isset($configuration['autoload_typoscript']) || true === (bool)$configuration['autoload_typoscript']) { |
|
| 16 | + ExtensionManagementUtility::addTypoScript( |
|
| 17 | + 'vidi', |
|
| 18 | + 'constants', |
|
| 19 | + '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:vidi/Configuration/TypoScript/constants.txt">' |
|
| 20 | + ); |
|
| 21 | + |
|
| 22 | + ExtensionManagementUtility::addTypoScript( |
|
| 23 | + 'vidi', |
|
| 24 | + 'setup', |
|
| 25 | + '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:vidi/Configuration/TypoScript/setup.txt">' |
|
| 26 | + ); |
|
| 27 | + } |
|
| 28 | + |
|
| 29 | + // Initialize generic Vidi modules after the TCA is loaded. |
|
| 30 | + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['extTablesInclusion-PostProcessing'][] = 'Fab\Vidi\Configuration\VidiModulesAspect'; |
|
| 31 | + |
|
| 32 | + // Initialize generic grid TCA for all data types |
|
| 33 | + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['extTablesInclusion-PostProcessing'][] = 'Fab\Vidi\Configuration\TcaGridAspect'; |
|
| 34 | + |
|
| 35 | + // cache configuration, see https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/CachingFramework/Configuration/Index.html#cache-configurations |
|
| 36 | + $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['vidi']['frontend'] = VariableFrontend::class; |
|
| 37 | + $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['vidi']['groups'] = array('all', 'vidi'); |
|
| 38 | + $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['vidi']['options']['defaultLifetime'] = 2592000; |
|
| 39 | 39 | }); |
@@ -24,118 +24,118 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | class ContentTest extends AbstractFunctionalTestCase |
| 26 | 26 | { |
| 27 | - /** |
|
| 28 | - * @var Content |
|
| 29 | - */ |
|
| 30 | - private $fixture; |
|
| 27 | + /** |
|
| 28 | + * @var Content |
|
| 29 | + */ |
|
| 30 | + private $fixture; |
|
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * @var string |
|
| 34 | - */ |
|
| 35 | - private $dataType = 'tx_foo_domain_model_bar'; |
|
| 32 | + /** |
|
| 33 | + * @var string |
|
| 34 | + */ |
|
| 35 | + private $dataType = 'tx_foo_domain_model_bar'; |
|
| 36 | 36 | |
| 37 | - public function setUp() |
|
| 38 | - { |
|
| 39 | - parent::setUp(); |
|
| 40 | - $GLOBALS['TCA'][$this->dataType]['columns'] = array( |
|
| 41 | - 'foo' => [], |
|
| 42 | - 'foo_bar' => [], |
|
| 43 | - ); |
|
| 44 | - $this->fixture = new Content($this->dataType); |
|
| 45 | - } |
|
| 37 | + public function setUp() |
|
| 38 | + { |
|
| 39 | + parent::setUp(); |
|
| 40 | + $GLOBALS['TCA'][$this->dataType]['columns'] = array( |
|
| 41 | + 'foo' => [], |
|
| 42 | + 'foo_bar' => [], |
|
| 43 | + ); |
|
| 44 | + $this->fixture = new Content($this->dataType); |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - public function tearDown() |
|
| 48 | - { |
|
| 49 | - unset($this->fixture, $GLOBALS['TCA'][$this->dataType]); |
|
| 50 | - } |
|
| 47 | + public function tearDown() |
|
| 48 | + { |
|
| 49 | + unset($this->fixture, $GLOBALS['TCA'][$this->dataType]); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * @test |
|
| 54 | - * @dataProvider fieldNameProvider |
|
| 55 | - */ |
|
| 56 | - public function fieldNameIsConvertedToPropertyName($fieldName, $propertyName) |
|
| 57 | - { |
|
| 58 | - $data = array( |
|
| 59 | - $fieldName => 'foo data', |
|
| 60 | - ); |
|
| 61 | - $object = new Content($this->dataType, $data); |
|
| 62 | - $this->assertObjectHasAttribute($propertyName, $object); |
|
| 63 | - } |
|
| 52 | + /** |
|
| 53 | + * @test |
|
| 54 | + * @dataProvider fieldNameProvider |
|
| 55 | + */ |
|
| 56 | + public function fieldNameIsConvertedToPropertyName($fieldName, $propertyName) |
|
| 57 | + { |
|
| 58 | + $data = array( |
|
| 59 | + $fieldName => 'foo data', |
|
| 60 | + ); |
|
| 61 | + $object = new Content($this->dataType, $data); |
|
| 62 | + $this->assertObjectHasAttribute($propertyName, $object); |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | - /** |
|
| 66 | - * @test |
|
| 67 | - * @dataProvider fieldNameProvider |
|
| 68 | - */ |
|
| 69 | - public function accessValueOfArrayObjectReturnsFooDataAsString($fieldName) |
|
| 70 | - { |
|
| 71 | - $data = array( |
|
| 72 | - $fieldName => 'foo data', |
|
| 73 | - ); |
|
| 74 | - $this->markTestIncomplete(); # TCA must be faked |
|
| 75 | - #$object = new \Fab\Vidi\Domain\Model\Content($this->dataType, $data); |
|
| 76 | - #$this->assertSame($data[$fieldName], $object[$fieldName]); |
|
| 77 | - } |
|
| 65 | + /** |
|
| 66 | + * @test |
|
| 67 | + * @dataProvider fieldNameProvider |
|
| 68 | + */ |
|
| 69 | + public function accessValueOfArrayObjectReturnsFooDataAsString($fieldName) |
|
| 70 | + { |
|
| 71 | + $data = array( |
|
| 72 | + $fieldName => 'foo data', |
|
| 73 | + ); |
|
| 74 | + $this->markTestIncomplete(); # TCA must be faked |
|
| 75 | + #$object = new \Fab\Vidi\Domain\Model\Content($this->dataType, $data); |
|
| 76 | + #$this->assertSame($data[$fieldName], $object[$fieldName]); |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - /** |
|
| 80 | - * @test |
|
| 81 | - * @dataProvider fieldNameProvider |
|
| 82 | - */ |
|
| 83 | - public function getValueThroughGetterReturnsFooDataAsString($fieldName, $propertyName) |
|
| 84 | - { |
|
| 85 | - $data = array( |
|
| 86 | - $fieldName => 'foo data', |
|
| 87 | - ); |
|
| 88 | - $this->markTestIncomplete(); # TCA must be faked |
|
| 89 | - #$object = new \Fab\Vidi\Domain\Model\Content($this->dataType, $data); |
|
| 90 | - #$getter = 'get' . ucfirst($propertyName); |
|
| 91 | - #$this->assertSame($data[$fieldName], $object->$getter()); |
|
| 92 | - } |
|
| 79 | + /** |
|
| 80 | + * @test |
|
| 81 | + * @dataProvider fieldNameProvider |
|
| 82 | + */ |
|
| 83 | + public function getValueThroughGetterReturnsFooDataAsString($fieldName, $propertyName) |
|
| 84 | + { |
|
| 85 | + $data = array( |
|
| 86 | + $fieldName => 'foo data', |
|
| 87 | + ); |
|
| 88 | + $this->markTestIncomplete(); # TCA must be faked |
|
| 89 | + #$object = new \Fab\Vidi\Domain\Model\Content($this->dataType, $data); |
|
| 90 | + #$getter = 'get' . ucfirst($propertyName); |
|
| 91 | + #$this->assertSame($data[$fieldName], $object->$getter()); |
|
| 92 | + } |
|
| 93 | 93 | |
| 94 | - /** |
|
| 95 | - * @test |
|
| 96 | - * @dataProvider fieldNameProvider |
|
| 97 | - */ |
|
| 98 | - public function toArrayMethodContainsGivenFieldName($fieldName) |
|
| 99 | - { |
|
| 100 | - $data = array( |
|
| 101 | - $fieldName => 'foo data', |
|
| 102 | - ); |
|
| 103 | - $object = new Content($this->dataType, $data); |
|
| 104 | - $array = $object->toArray(); |
|
| 105 | - $this->assertArrayHasKey($fieldName, $array); |
|
| 106 | - } |
|
| 94 | + /** |
|
| 95 | + * @test |
|
| 96 | + * @dataProvider fieldNameProvider |
|
| 97 | + */ |
|
| 98 | + public function toArrayMethodContainsGivenFieldName($fieldName) |
|
| 99 | + { |
|
| 100 | + $data = array( |
|
| 101 | + $fieldName => 'foo data', |
|
| 102 | + ); |
|
| 103 | + $object = new Content($this->dataType, $data); |
|
| 104 | + $array = $object->toArray(); |
|
| 105 | + $this->assertArrayHasKey($fieldName, $array); |
|
| 106 | + } |
|
| 107 | 107 | |
| 108 | - /** |
|
| 109 | - * Provider |
|
| 110 | - */ |
|
| 111 | - public function fieldNameProvider() |
|
| 112 | - { |
|
| 113 | - return array( |
|
| 114 | - array('foo', 'foo'), |
|
| 115 | - array('foo_bar', 'fooBar'), |
|
| 116 | - ); |
|
| 117 | - } |
|
| 108 | + /** |
|
| 109 | + * Provider |
|
| 110 | + */ |
|
| 111 | + public function fieldNameProvider() |
|
| 112 | + { |
|
| 113 | + return array( |
|
| 114 | + array('foo', 'foo'), |
|
| 115 | + array('foo_bar', 'fooBar'), |
|
| 116 | + ); |
|
| 117 | + } |
|
| 118 | 118 | |
| 119 | - /** |
|
| 120 | - * @test |
|
| 121 | - * @dataProvider propertyProvider |
|
| 122 | - */ |
|
| 123 | - public function testProperty($propertyName, $value) |
|
| 124 | - { |
|
| 125 | - $setter = 'set' . ucfirst($propertyName); |
|
| 126 | - $getter = 'get' . ucfirst($propertyName); |
|
| 127 | - $this->markTestIncomplete(); # TCA must be faked |
|
| 128 | - #call_user_func_array(array($this->fixture, $setter), array($value)); |
|
| 129 | - #$this->assertEquals($value, call_user_func(array($this->fixture, $getter))); |
|
| 130 | - } |
|
| 119 | + /** |
|
| 120 | + * @test |
|
| 121 | + * @dataProvider propertyProvider |
|
| 122 | + */ |
|
| 123 | + public function testProperty($propertyName, $value) |
|
| 124 | + { |
|
| 125 | + $setter = 'set' . ucfirst($propertyName); |
|
| 126 | + $getter = 'get' . ucfirst($propertyName); |
|
| 127 | + $this->markTestIncomplete(); # TCA must be faked |
|
| 128 | + #call_user_func_array(array($this->fixture, $setter), array($value)); |
|
| 129 | + #$this->assertEquals($value, call_user_func(array($this->fixture, $getter))); |
|
| 130 | + } |
|
| 131 | 131 | |
| 132 | - /** |
|
| 133 | - * Provider |
|
| 134 | - */ |
|
| 135 | - public function propertyProvider() |
|
| 136 | - { |
|
| 137 | - return array( |
|
| 138 | - array('username', 'foo'), |
|
| 139 | - ); |
|
| 140 | - } |
|
| 132 | + /** |
|
| 133 | + * Provider |
|
| 134 | + */ |
|
| 135 | + public function propertyProvider() |
|
| 136 | + { |
|
| 137 | + return array( |
|
| 138 | + array('username', 'foo'), |
|
| 139 | + ); |
|
| 140 | + } |
|
| 141 | 141 | } |
@@ -9,12 +9,12 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | abstract class AbstractFunctionalTestCase extends FunctionalTestCase |
| 11 | 11 | { |
| 12 | - protected $testExtensionsToLoad = array('typo3conf/ext/vidi'); |
|
| 12 | + protected $testExtensionsToLoad = array('typo3conf/ext/vidi'); |
|
| 13 | 13 | |
| 14 | - protected $coreExtensionsToLoad = array('extbase', 'fluid', 'scheduler'); |
|
| 14 | + protected $coreExtensionsToLoad = array('extbase', 'fluid', 'scheduler'); |
|
| 15 | 15 | |
| 16 | - public function setUp(): void |
|
| 17 | - { |
|
| 18 | - parent::setUp(); |
|
| 19 | - } |
|
| 16 | + public function setUp(): void |
|
| 17 | + { |
|
| 18 | + parent::setUp(); |
|
| 19 | + } |
|
| 20 | 20 | } |
@@ -24,101 +24,101 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | class ModuleLoaderTest extends AbstractFunctionalTestCase |
| 26 | 26 | { |
| 27 | - /** |
|
| 28 | - * @var ModuleLoader |
|
| 29 | - */ |
|
| 30 | - private $fixture; |
|
| 31 | - |
|
| 32 | - /** |
|
| 33 | - * @var string |
|
| 34 | - */ |
|
| 35 | - private $dataType = 'tx_foo'; |
|
| 36 | - |
|
| 37 | - /** |
|
| 38 | - * @var string |
|
| 39 | - */ |
|
| 40 | - private $moduleCode = 'user_VidiTxFooM1'; |
|
| 41 | - |
|
| 42 | - |
|
| 43 | - public function setUp() |
|
| 44 | - { |
|
| 45 | - parent::setUp(); |
|
| 46 | - $this->fixture = new ModuleLoader($this->dataType); |
|
| 47 | - $this->fixture->register(); |
|
| 48 | - } |
|
| 49 | - |
|
| 50 | - public function tearDown() |
|
| 51 | - { |
|
| 52 | - unset($this->fixture); |
|
| 53 | - } |
|
| 54 | - |
|
| 55 | - /** |
|
| 56 | - * @test |
|
| 57 | - * @dataProvider attributeValueProvider |
|
| 58 | - */ |
|
| 59 | - public function attributeCanBeSet($attribute, $value) |
|
| 60 | - { |
|
| 61 | - $setter = 'set' . ucfirst($attribute); |
|
| 62 | - $this->fixture->$setter($value); |
|
| 63 | - $this->assertAttributeEquals($value, $attribute, $this->fixture); |
|
| 64 | - } |
|
| 65 | - |
|
| 66 | - /** |
|
| 67 | - * Provider |
|
| 68 | - */ |
|
| 69 | - public function attributeValueProvider() |
|
| 70 | - { |
|
| 71 | - return array( |
|
| 72 | - array('icon', 'bar'), |
|
| 73 | - array('moduleLanguageFile', 'bar'), |
|
| 74 | - ); |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - /** |
|
| 78 | - * @test |
|
| 79 | - * @dataProvider attributeProvider |
|
| 80 | - */ |
|
| 81 | - public function testAttribute($attribute, $defaultValue) |
|
| 82 | - { |
|
| 83 | - $this->assertAttributeEquals($defaultValue, $attribute, $this->fixture); |
|
| 84 | - } |
|
| 85 | - |
|
| 86 | - /** |
|
| 87 | - * Provider |
|
| 88 | - */ |
|
| 89 | - public function attributeProvider() |
|
| 90 | - { |
|
| 91 | - return array( |
|
| 92 | - array('dataType', $this->dataType), |
|
| 93 | - array('moduleKey', 'm1'), |
|
| 94 | - array('icon', 'EXT:vidi/ext_icon.gif') |
|
| 95 | - ); |
|
| 96 | - } |
|
| 97 | - |
|
| 98 | - /** |
|
| 99 | - * @test |
|
| 100 | - */ |
|
| 101 | - public function getModuleConfigurationReturnsArrayWithSomeKeys() |
|
| 102 | - { |
|
| 103 | - $moduleLoader = new ModuleLoader($this->dataType); |
|
| 104 | - $moduleLoader->register(); |
|
| 105 | - $GLOBALS['_GET']['M'] = $this->moduleCode; |
|
| 106 | - |
|
| 107 | - $moduleConfiguration = $moduleLoader->getModuleConfiguration(); |
|
| 108 | - $keys = array('dataType', 'additionalJavaScriptFiles', 'additionalStyleSheetFiles'); |
|
| 109 | - foreach ($keys as $key) { |
|
| 110 | - $this->assertArrayHasKey($key, $moduleConfiguration); |
|
| 111 | - } |
|
| 112 | - } |
|
| 113 | - |
|
| 114 | - /** |
|
| 115 | - * @test |
|
| 116 | - */ |
|
| 117 | - public function getModuleConfigurationWithParameterDataTypeReturnsDataType() |
|
| 118 | - { |
|
| 119 | - $moduleLoader = new ModuleLoader($this->dataType); |
|
| 120 | - $moduleLoader->register(); |
|
| 121 | - $GLOBALS['_GET']['M'] = $this->moduleCode; |
|
| 122 | - $this->assertEquals($this->dataType, $moduleLoader->getModuleConfiguration('dataType')); |
|
| 123 | - } |
|
| 27 | + /** |
|
| 28 | + * @var ModuleLoader |
|
| 29 | + */ |
|
| 30 | + private $fixture; |
|
| 31 | + |
|
| 32 | + /** |
|
| 33 | + * @var string |
|
| 34 | + */ |
|
| 35 | + private $dataType = 'tx_foo'; |
|
| 36 | + |
|
| 37 | + /** |
|
| 38 | + * @var string |
|
| 39 | + */ |
|
| 40 | + private $moduleCode = 'user_VidiTxFooM1'; |
|
| 41 | + |
|
| 42 | + |
|
| 43 | + public function setUp() |
|
| 44 | + { |
|
| 45 | + parent::setUp(); |
|
| 46 | + $this->fixture = new ModuleLoader($this->dataType); |
|
| 47 | + $this->fixture->register(); |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + public function tearDown() |
|
| 51 | + { |
|
| 52 | + unset($this->fixture); |
|
| 53 | + } |
|
| 54 | + |
|
| 55 | + /** |
|
| 56 | + * @test |
|
| 57 | + * @dataProvider attributeValueProvider |
|
| 58 | + */ |
|
| 59 | + public function attributeCanBeSet($attribute, $value) |
|
| 60 | + { |
|
| 61 | + $setter = 'set' . ucfirst($attribute); |
|
| 62 | + $this->fixture->$setter($value); |
|
| 63 | + $this->assertAttributeEquals($value, $attribute, $this->fixture); |
|
| 64 | + } |
|
| 65 | + |
|
| 66 | + /** |
|
| 67 | + * Provider |
|
| 68 | + */ |
|
| 69 | + public function attributeValueProvider() |
|
| 70 | + { |
|
| 71 | + return array( |
|
| 72 | + array('icon', 'bar'), |
|
| 73 | + array('moduleLanguageFile', 'bar'), |
|
| 74 | + ); |
|
| 75 | + } |
|
| 76 | + |
|
| 77 | + /** |
|
| 78 | + * @test |
|
| 79 | + * @dataProvider attributeProvider |
|
| 80 | + */ |
|
| 81 | + public function testAttribute($attribute, $defaultValue) |
|
| 82 | + { |
|
| 83 | + $this->assertAttributeEquals($defaultValue, $attribute, $this->fixture); |
|
| 84 | + } |
|
| 85 | + |
|
| 86 | + /** |
|
| 87 | + * Provider |
|
| 88 | + */ |
|
| 89 | + public function attributeProvider() |
|
| 90 | + { |
|
| 91 | + return array( |
|
| 92 | + array('dataType', $this->dataType), |
|
| 93 | + array('moduleKey', 'm1'), |
|
| 94 | + array('icon', 'EXT:vidi/ext_icon.gif') |
|
| 95 | + ); |
|
| 96 | + } |
|
| 97 | + |
|
| 98 | + /** |
|
| 99 | + * @test |
|
| 100 | + */ |
|
| 101 | + public function getModuleConfigurationReturnsArrayWithSomeKeys() |
|
| 102 | + { |
|
| 103 | + $moduleLoader = new ModuleLoader($this->dataType); |
|
| 104 | + $moduleLoader->register(); |
|
| 105 | + $GLOBALS['_GET']['M'] = $this->moduleCode; |
|
| 106 | + |
|
| 107 | + $moduleConfiguration = $moduleLoader->getModuleConfiguration(); |
|
| 108 | + $keys = array('dataType', 'additionalJavaScriptFiles', 'additionalStyleSheetFiles'); |
|
| 109 | + foreach ($keys as $key) { |
|
| 110 | + $this->assertArrayHasKey($key, $moduleConfiguration); |
|
| 111 | + } |
|
| 112 | + } |
|
| 113 | + |
|
| 114 | + /** |
|
| 115 | + * @test |
|
| 116 | + */ |
|
| 117 | + public function getModuleConfigurationWithParameterDataTypeReturnsDataType() |
|
| 118 | + { |
|
| 119 | + $moduleLoader = new ModuleLoader($this->dataType); |
|
| 120 | + $moduleLoader->register(); |
|
| 121 | + $GLOBALS['_GET']['M'] = $this->moduleCode; |
|
| 122 | + $this->assertEquals($this->dataType, $moduleLoader->getModuleConfiguration('dataType')); |
|
| 123 | + } |
|
| 124 | 124 | } |