Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace VKF\Admin\Controller;
- /* *
- * This script belongs to the TYPO3 Flow package "VKF.Admin". *
- * *
- * */
- use TYPO3\Flow\Annotations as Flow;
- use TYPO3\Flow\Mvc\Controller\ActionController;
- abstract class AbstractAdminController extends ActionController implements AdminControllerInterface {
- /**
- * @Flow\Inject
- * @var TYPO3\Flow\I18n\Translator
- */
- protected $translator;
- /**
- *
- * @param ViewInterface $view
- */
- protected function initializeView(\TYPO3\Flow\Mvc\View\ViewInterface $view) {
- parent::initializeView($view);
- /** @var \TYPO3\Fluid\View\TemplateView $view */
- $view->setLayoutRootPath('resource://VKF.Admin/Private/Layouts');
- $view->assign('modules', $this->getAllModules());
- }
- /**
- * @return array
- */
- protected function getAllModules() {
- $moduleClassNames =
- $this->reflectionService->getAllImplementationClassNamesForInterface("VKF\Admin\Controller\AdminControllerInterface");
- \TYPO3\Flow\var_dump($this->translator);
- $modules = array();
- foreach ($moduleClassNames as $moduleClassName) {
- $objectName = $this->objectManager->getObjectNameByClassName($moduleClassName);
- $packageKey = $this->objectManager->getPackageKeyByObjectName($objectName);
- $translationIdentifier = $packageKey . '.' . substr($moduleClassName, strpos($moduleClassName, '\\Controller\\') + 12, -10);
- //\TYPO3\Flow\var_dump($this->translator->translateById($translationIdentifier));
- $moduleCategory = call_user_func(array($moduleClassName, 'getModuleCategory'));
- if (!isset($modules[$moduleCategory]))
- $modules[$moduleCategory] = array();
- $modules[$moduleCategory][$moduleClassName] = array(
- 'label' => call_user_func(array($moduleClassName, 'getModuleLabel')),
- 'package' => $packageKey,
- 'controller' => substr($moduleClassName, strpos($moduleClassName, '\\Controller\\') + 12, -10),
- 'active' => (get_class($this) === $moduleClassName)
- );
- sort($modules[$moduleCategory]);
- }
- ksort($modules);
- return $modules;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment