ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
class.ilObjStaticUrlServiceGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
21
28{
32 public const CMD_DEFAULT = 'main';
36 public const TAB_INDEX = 'index';
40 public const TAB_PERMISSIONS = 'permissions';
41 public const string TAB_INFO = 'info';
42
43 public function __construct()
44 {
45 global $DIC;
46
47 $this->ref_id = $DIC->http()->wrapper()->query()->has('ref_id')
48 ? $DIC->http()->wrapper()->query()->retrieve('ref_id', $DIC->refinery()->kindlyTo()->int())
49 : null;
50
51 parent::__construct($this->ref_id);
52 $this->ctrl = $DIC->ctrl();
53 $this->assignObject();
54 }
55
56 #[\Override]
57 public function executeCommand(): void
58 {
59 $this->prepareOutput();
60
61 $mediator = Pons::fromDIC(['stus', 'rbac', 'common', 'ui']);
62 $tabs = $mediator->tabs();
63 $tabs->add(
64 $view = $tabs
65 ->build(self::TAB_INDEX, 'index', [ShortlinkAdministrationGUI::class])
66 ->withPermission('read'),
67 /*$view = $tabs
68 ->build(self::TAB_INFO, 'info', [ShortlinkInfoGUI::class])
69 ->withPermission('read'),*/
70 $permissions = $tabs
71 ->build(self::TAB_PERMISSIONS, 'rbac_permissions', [[self::class, ilPermissionGUI::class], 'perm'])
72 ->withPermission('edit_permissions')
73 );
74
75 $next_class = $this->ctrl->getNextClass();
76 if ($next_class === '') {
77 $this->ctrl->redirectByClass(
78 ShortlinkAdministrationGUI::class,
79 'index'
80 );
81 }
82
83 $mediator->handle(self::TAB_INDEX, [ilPermissionGUI::class]);
84
85 // must handle PermissionsGUI separately as it is not handled by the mediator
86 switch (strtolower((string) $next_class)) {
87 case strtolower(ilPermissionGUI::class):
88 $tabs->activate(self::TAB_PERMISSIONS);
89 $this->ctrl->forwardCommand(new ilPermissionGUI($this));
90 return;
91 default:
92 return;
93 }
94 }
95
96 public function getType(): string
97 {
98 return 'stus';
99 }
100}
@ilCtrl_IsCalledBy ilObjStaticUrlServiceGUI: ilAdministrationGUI @ilCtrl_Calls ilObjStaticUrlServiceG...
getType()
Functions that must be overwritten.
New implementation of ilObjectGUI.
assignObject()
create object instance as internal property (repository/workspace switch)
prepareOutput(bool $show_sub_objects=true)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26