87 $this->depth = (int)GeneralUtility::_GP(
'depth') > 0
88 ? (int)GeneralUtility::_GP(
'depth')
90 if ($this->request->hasArgument(
'depth')) {
91 $this->depth = (int)$this->request->getArgument(
'depth');
96 $this->
id = (int)GeneralUtility::_GP(
'id');
97 if ($this->request->hasArgument(
'id')) {
98 $this->
id = (int)$this->request->getArgument(
'id');
105 $this->returnUrl = GeneralUtility::_GP(
'returnUrl');
106 if ($this->request->hasArgument(
'returnUrl')) {
107 $this->returnUrl = $this->request->getArgument(
'returnUrl');
120 parent::initializeView(
$view);
125 (
int)$this->pageInfo[
'uid'],
137 $this->view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation($this->pageInfo);
138 $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
150 $buttonBar = $this->view->getModuleTemplate()->getDocHeaderComponent()->getButtonBar();
152 $moduleName = $currentRequest->getPluginName();
157 if (empty($getVars)) {
158 $modulePrefix = strtolower(
'tx_' .
$extensionName .
'_' . $moduleName);
159 $getVars = [
'id',
'route', $modulePrefix];
162 if ($currentRequest->getControllerActionName() ===
'edit') {
164 if (!empty($this->returnUrl)) {
165 $closeButton = $buttonBar->makeLinkButton()
166 ->setHref($this->returnUrl)
167 ->setTitle($lang->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:rm.closeDoc'))
168 ->setIcon($this->view->getModuleTemplate()->getIconFactory()->getIcon(
172 $buttonBar->addButton($closeButton);
176 $saveButton = $buttonBar->makeInputButton()
177 ->setTitle($lang->sL(
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:rm.saveCloseDoc'))
178 ->setName(
'tx_beuser_system_beusertxpermission[submit]')
180 ->setForm(
'PermissionControllerEdit')
181 ->setIcon($this->view->getModuleTemplate()->getIconFactory()->getIcon(
182 'actions-document-save',
185 ->setShowLabelText(
true);
187 $buttonBar->addButton($saveButton);
191 $shortcutButton = $buttonBar->makeShortcutButton()
192 ->setModuleName($moduleName)
193 ->setGetVariables($getVars);
194 $buttonBar->addButton($shortcutButton);
203 $this->pageInfo = [
'title' =>
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'sitename'],
'uid' => 0,
'pid' => 0];
217 $url = $this->uriBuilder->reset()->setArguments([
219 'depth' =>
'__DEPTH__',
221 ])->buildBackendUri();
222 foreach ([1, 2, 3, 4, 10] as $depthLevel) {
223 $levelLabel = $depthLevel === 1 ?
'level' :
'levels';
224 $depthOptions[$depthLevel] = $depthLevel .
' ' .
LocalizationUtility::translate(
'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:' . $levelLabel,
'beuser');
226 $this->view->assign(
'currentId', $this->
id);
227 $this->view->assign(
'depthBaseUrl', $url);
228 $this->view->assign(
'depth', $this->depth);
229 $this->view->assign(
'depthOptions', $depthOptions);
232 $this->view->assign(
'beUsers', $beUserArray);
234 $this->view->assign(
'beGroups', $beGroupArray);
237 $tree = GeneralUtility::makeInstance(PageTreeView::class);
239 $tree->addField(
'perms_user',
true);
240 $tree->addField(
'perms_group',
true);
241 $tree->addField(
'perms_everybody',
true);
242 $tree->addField(
'perms_userid',
true);
243 $tree->addField(
'perms_groupid',
true);
244 $tree->addField(
'hidden');
245 $tree->addField(
'fe_group');
246 $tree->addField(
'starttime');
247 $tree->addField(
'endtime');
248 $tree->addField(
'editlock');
252 $tree->tree[] = [
'row' =>
$this->pageInfo,
'HTML' => $tree->getIcon($this->
id)];
254 $tree->tree[] = [
'row' =>
$this->pageInfo,
'HTML' => $tree->getRootIcon($this->pageInfo)];
256 $tree->getTree($this->
id, $this->depth);
257 $this->view->assign(
'viewTree', $tree->tree);
260 $this->view->assign(
'cshItem',
BackendUtility::cshItem(
'xMOD_csh_corebe',
'perm_module',
null,
'<span class="btn btn-default btn-sm">|</span>'));
268 $this->view->assign(
'id', $this->
id);
269 $this->view->assign(
'depth', $this->depth);
272 $this->pageInfo = [
'title' =>
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'sitename'],
'uid' => 0,
'pid' => 0];
287 $beUserDataArray = [0 =>
LocalizationUtility::translate(
'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:selectNone',
'beuser')];
288 foreach ($beUserArray as $uid => &$row) {
289 $beUserDataArray[$uid] = $row[
'username'];
291 $beUserDataArray[-1] =
LocalizationUtility::translate(
'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:selectUnchanged',
'beuser');
292 $this->view->assign(
'currentBeUser', $this->pageInfo[
'perms_userid']);
293 $this->view->assign(
'beUserData', $beUserDataArray);
296 $beGroupDataArray = [0 =>
LocalizationUtility::translate(
'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:selectNone',
'beuser')];
297 foreach ($beGroupArray as $uid => $row) {
298 $beGroupDataArray[$uid] = $row[
'title'];
300 $beGroupDataArray[-1] =
LocalizationUtility::translate(
'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:selectUnchanged',
'beuser');
301 $this->view->assign(
'currentBeGroup', $this->pageInfo[
'perms_groupid']);
302 $this->view->assign(
'beGroupData', $beGroupDataArray);
303 $this->view->assign(
'pageInfo', $this->pageInfo);
304 $this->view->assign(
'returnUrl', $this->returnUrl);
316 $dataHandlerInput = [];
318 if (!empty($data[
'pages'])) {
319 foreach ($data[
'pages'] as $pageUid => $properties) {
321 if ((
int)$properties[
'perms_userid'] === -1) {
322 unset($properties[
'perms_userid']);
324 if ((
int)$properties[
'perms_groupid'] === -1) {
325 unset($properties[
'perms_groupid']);
327 $dataHandlerInput[$pageUid] = $properties;
328 if (!empty($mirror[
'pages'][$pageUid])) {
329 $mirrorPages = GeneralUtility::intExplode(
',', $mirror[
'pages'][$pageUid]);
330 foreach ($mirrorPages as $mirrorPageUid) {
331 $dataHandlerInput[$mirrorPageUid] = $properties;
337 $dataHandler = GeneralUtility::makeInstance(DataHandler::class);
340 'pages' => $dataHandlerInput
344 $dataHandler->process_datamap();
365 $tree = GeneralUtility::makeInstance(PageTreeView::class);
367 $tree->addField(
'perms_userid',
true);
371 $tree->getTree($this->
id, $this->getLevels,
'');
375 if ($this->
getBackendUser()->user[
'uid'] && !empty($tree->orig_ids_hierarchy)) {
380 $labelPageAffected =
LocalizationUtility::translate(
'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:page_affected',
'beuser');
381 $labelPagesAffected =
LocalizationUtility::translate(
'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:pages_affected',
'beuser');
385 for ($a = $this->getLevels; $a > 0; $a--) {
386 if (is_array($tree->orig_ids_hierarchy[$a])) {
387 foreach ($tree->orig_ids_hierarchy[$a] as $theId) {
388 $theIdListArr[] = $theId;
390 $lKey = $this->getLevels - $a + 1;
391 $pagesCount = count($theIdListArr);
392 $options[implode(
',', $theIdListArr)] = $labelRecursive .
' ' . $lKey .
' ' . ($lKey === 1 ? $labelLevel : $labelLevels) .
393 ' (' . $pagesCount .
' ' . ($pagesCount === 1 ? $labelPageAffected : $labelPagesAffected) .
')';