public function getCategories() { $extbaseObjectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager'); $repo = $extbaseObjectManager->get('TYPO3\\CMS\\Extbase\\Domain\\Repository\\CategoryRepository'); $uidsCat = $this->getCategoriesUids(); if (!empty($uidsCat)) { $categories = \Ameos\AmeosFilemanager\Tools\Tools::getByUids($repo, $uidsCat); return $categories; } else { return; } }
/** * Folder form * * @return void */ public function formFolderAction() { $args = GeneralUtility::_GET('tx_ameos_filemanager'); $editFolderUid = $args['newFolder']; // We are editing a folder if ($editFolderUid != '') { if ($newFolder = $this->folderRepository->findByUid($editFolderUid, $writeRight = true)) { $this->view->assign('folder', $newFolder); $this->view->assign('parentFolder', $newFolder->getParent()->getUid()); } else { return LocalizationUtility::translate('accessDenied', 'ameos_filemanager'); } } else { $folderUid = $args['folder'] ?: $this->settings['startFolder']; if ($folderParent = $this->folderRepository->findByUid($folderUid, $writeRight = true)) { $this->view->assign('parentFolder', $folderParent->getUid()); } else { return LocalizationUtility::translate('accessDenied', 'ameos_filemanager'); } } if ($this->authorizedCategories != '') { $categorieUids = explode(',', $this->authorizedCategories); $categories = Tools::getByUids($this->categoryRepository, $this->authorizedCategories); } else { $categories = $this->categoryRepository->findAll(); } if ($this->authorizedGroups != '') { $feGroup = Tools::getByUids($this->feGroupRepository, $this->authorizedGroups)->toArray(); if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->authorizedGroups, -2)) { $temp = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Domain\\Model\\FrontendUserGroup'); $temp->_setProperty('uid', -2); $temp->setTitle(LocalizationUtility::translate('LLL:EXT:lang/locallang_general.xlf:LGL.any_login', null)); $feGroup[] = $temp; } } else { $feGroup = $this->feGroupRepository->findAll()->toArray(); $temp = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Domain\\Model\\FrontendUserGroup'); $temp->_setProperty('uid', -2); $temp->setTitle(LocalizationUtility::translate('LLL:EXT:lang/locallang_general.xlf:LGL.any_login', null)); $feGroup[] = $temp; } if ($args['errors']) { $this->view->assign('errors', $args['errors']); $this->view->assign('folder', $args['currentState']); $this->view->assign('parentFolder', $args['currentState']['uidParent']); } $this->view->assign('categories', $categories); $this->view->assign('feGroup', $feGroup); $this->view->assign('returnFolder', $args['returnFolder']); }