TYPO3 CMS  TYPO3_8-7
BackendUserGroupController.php
Go to the documentation of this file.
1 <?php
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 
42  public function initializeAction()
43  {
44  // @TODO: Extbase backend modules relies on frontend TypoScript for view, persistence
45  // and settings. Thus, we need a TypoScript root template, that then loads the
46  // ext_typoscript_setup.txt file of this module. This is nasty, but can not be
47  // circumvented until there is a better solution in extbase.
48  // For now we throw an exception if no settings are detected.
49  if (empty($this->settings)) {
50  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.', 1460976089);
51  }
52  }
53 
57  public function indexAction()
58  {
59  $this->view->assign('backendUserGroups', $this->backendUserGroupRepository->findAll());
60  $this->view->assign('returnUrl', rawurlencode(BackendUtility::getModuleUrl(
61  'system_BeuserTxBeuser',
62  [
63  'tx_beuser_system_beusertxbeuser' => [
64  'action' => 'index',
65  'controller' => 'BackendUserGroup'
66  ]
67  ]
68  )));
69  }
70 }
injectBackendUserGroupRepository(\TYPO3\CMS\Beuser\Domain\Repository\BackendUserGroupRepository $backendUserGroupRepository)