TYPO3  7.6
BackendUserGroupController.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Beuser\Controller;
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
18 
23 {
28 
32  public function injectBackendUserGroupRepository(\TYPO3\CMS\Beuser\Domain\Repository\BackendUserGroupRepository $backendUserGroupRepository)
33  {
34  $this->backendUserGroupRepository = $backendUserGroupRepository;
35  }
36 
43  public function initializeAction()
44  {
45  // @TODO: Extbase backend modules relies on frontend TypoScript for view, persistence
46  // and settings. Thus, we need a TypoScript root template, that then loads the
47  // ext_typoscript_setup.txt file of this module. This is nasty, but can not be
48  // circumvented until there is a better solution in extbase.
49  // For now we throw an exception if no settings are detected.
50  if (empty($this->settings)) {
51  throw new \RuntimeException('No settings detected. This module can not work then. This usually happens if there is no frontend TypoScript template with root flag set. ' . 'Please create a frontend page with a TypoScript root template.', 1344375003);
52  }
53  }
54 
60  public function indexAction()
61  {
62  $this->view->assign('backendUserGroups', $this->backendUserGroupRepository->findAll());
63  $this->view->assign('returnUrl', rawurlencode(BackendUtility::getModuleUrl(
64  'system_BeuserTxBeuser',
65  [
66  'tx_beuser_system_beusertxbeuser' => [
67  'action' => 'index',
68  'controller' => 'BackendUserGroup'
69  ]
70  ]
71  )));
72  }
73 }