9587157e0709843c1f7c809376e2c3a96d29ea46
[Packages/TYPO3.CMS.git] / typo3 / sysext / beuser / Classes / Controller / BackendUserGroupController.php
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
17 use TYPO3\CMS\Backend\Utility\BackendUtility;
18 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
19
20 /**
21 * Backend module user group administration controller
22 *
23 * @author Ingo Pfennigstorf <i.pfennigstorf@gmail.com>
24 */
25 class BackendUserGroupController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
26
27 /**
28 * @var \TYPO3\CMS\Beuser\Domain\Repository\BackendUserGroupRepository
29 * @inject
30 */
31 protected $backendUserGroupRepository;
32
33 /**
34 * Initialize actions
35 *
36 * @return void
37 * @throws \RuntimeException
38 */
39 public function initializeAction() {
40 // @TODO: Extbase backend modules relies on frontend TypoScript for view, persistence
41 // and settings. Thus, we need a TypoScript root template, that then loads the
42 // ext_typoscript_setup.txt file of this module. This is nasty, but can not be
43 // circumvented until there is a better solution in extbase.
44 // For now we throw an exception if no settings are detected.
45 if (empty($this->settings)) {
46 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);
47 }
48 }
49
50 /**
51 * Displays all BackendUserGroups
52 *
53 * @return void
54 */
55 public function indexAction() {
56 $this->view->assign('backendUserGroups', $this->backendUserGroupRepository->findAll());
57 }
58 }