1 | <?php |
||
26 | class FileCollectionService { |
||
27 | |||
28 | /** |
||
29 | * Collection Repository |
||
30 | * |
||
31 | * @var \TYPO3\CMS\Core\Resource\FileCollectionRepository |
||
32 | */ |
||
33 | protected $fileCollectionRepository; |
||
34 | |||
35 | /** |
||
36 | * The Frontend Configuration |
||
37 | * |
||
38 | * @var \TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager |
||
39 | */ |
||
40 | protected $frontendConfigurationManager; |
||
41 | |||
42 | /** |
||
43 | * Inject the fileCollection repository |
||
44 | * |
||
45 | * @param \TYPO3\CMS\Core\Resource\FileCollectionRepository $fileCollectionRepository |
||
46 | * |
||
47 | * @return void |
||
48 | */ |
||
49 | 9 | public function injectFileCollectionRepository(FileCollectionRepository $fileCollectionRepository) { |
|
52 | |||
53 | /** |
||
54 | * Inject the Frontend Configuration Manager. |
||
55 | * |
||
56 | * @param \TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager $frontendConfigurationManager |
||
57 | * |
||
58 | * @return void |
||
59 | */ |
||
60 | 9 | public function injectFrontendConfigurationManager(FrontendConfigurationManager $frontendConfigurationManager) { |
|
63 | |||
64 | /** |
||
65 | * Returns an array of file objects for the given UIDs of fileCollections |
||
66 | * |
||
67 | * @param array $collectionUids The uids |
||
68 | * |
||
69 | * @return array |
||
70 | */ |
||
71 | 9 | public function getFileObjectsFromCollection(array $collectionUids) { |
|
86 | |||
87 | /** |
||
88 | * Returns an array of gallery covers for the given UIDs of fileCollections |
||
89 | * |
||
90 | * @param $collectionUids |
||
91 | * @return array |
||
92 | */ |
||
93 | public function getGalleryCoversFromCollections($collectionUids) { |
||
117 | |||
118 | /** |
||
119 | * Returns the array including pagination settings |
||
120 | * |
||
121 | * @param array $settings The current settings |
||
122 | * @return array |
||
123 | */ |
||
124 | public function buildPaginationArray($settings) { |
||
136 | |||
137 | /** |
||
138 | * Returns the array for assign to view in controller |
||
139 | * |
||
140 | * @param array $imageItems The imageItems to show |
||
141 | * @param int $offset The offset in gallery |
||
142 | * @param array $paginationConfiguration The pagination config |
||
143 | * @param array $settings The settings array |
||
144 | * @param int $currentUid The current uid |
||
145 | * @param int $columnPosition The column position |
||
146 | * @param bool $showBackToGallerySelectionLink If back link should be shown |
||
147 | * |
||
148 | * @return array |
||
149 | */ |
||
150 | public function buildArrayForAssignToView($imageItems, $offset, $paginationConfiguration, $settings, |
||
163 | |||
164 | /** |
||
165 | * @param array $items The items to sort |
||
166 | * @param $direction the direction. SORT_DESC or SORT_ASC |
||
167 | * @return bool |
||
168 | */ |
||
169 | protected function sortFileObjectsByName(&$items, $direction) { |
||
176 | 9 | ||
177 | 3 | /** |
|
178 | 3 | * @param array $items The items to sort |
|
179 | 6 | * @param $direction the direction. SORT_DESC or SORT_ASC |
|
180 | * @return bool |
||
181 | 9 | */ |
|
182 | protected function sortFileObjectsByDate(&$items, $direction) { |
||
189 | |||
190 | /** |
||
191 | * Sorts the Result Array according to the Flexform Settings |
||
192 | * |
||
193 | * @param array $imageItems The image items |
||
194 | * |
||
195 | * @return array |
||
196 | */ |
||
197 | protected function sortFileObjects($imageItems) { |
||
218 | |||
219 | /** |
||
220 | * Returns an FileObject from a given FileReference |
||
221 | * |
||
222 | * @param \TYPO3\CMS\Core\Resource\FileReference $item The item |
||
223 | * |
||
224 | * @return \TYPO3\CMS\Core\Resource\File |
||
225 | */ |
||
226 | protected function getFileObjectFromFileReference(FileReference $item) { |
||
236 | } |
||
237 |