ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilObjFooterAdministrationGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
24 
33 {
34  public const CMD_DEFAULT = 'view';
35  public const TAB_INDEX = 'index';
36  public const TAB_PERMISSIONS = 'permissions';
37  private readonly Container $container;
38  private readonly GroupsRepositoryDB $repository;
40  private readonly Translator $translator;
42 
43  public function __construct()
44  {
45  parent::__construct(...func_get_args());
46  global $DIC;
47  $this->container = $DIC;
48  $this->main_tpl = $this->container->ui()->mainTemplate();
49 
50  $this->translator = new Translator($DIC);
51 
52  $this->ui_handling = new ilObjFooterUIHandling(
53  $this->container->ui(),
54  $this->container->http(),
60  $this->object->getRefId()
61  );
62 
63  $this->repository = new GroupsRepositoryDB(
64  $this->container->database(),
66  );
67  }
68 
69  // HELPERS AND NEEDED IMPLEMENATIONS
70 
71  public function view(): void
72  {
73  $this->ctrl->redirectByClass(ilFooterGroupsGUI::class);
74  }
75 
76  public function getType(): string
77  {
78  return 'gsfo';
79  }
80 
81  public function executeCommand(): void
82  {
83  $this->ui_handling->requireReadable();
84  $this->prepareOutput();
85 
86  $this->container->language()->loadLanguageModule('gsfo');
87 
88  $this->main_tpl->setTitle($this->translator->translate('obj_gsfo'));
89  $this->main_tpl->setDescription($this->translator->translate('obj_gsfo_desc'));
90 
91  $next_class = $this->ctrl->getNextClass($this) ?? '';
92  $cmd = $this->ctrl->getCmd(self::CMD_DEFAULT);
93 
94  switch (strtolower($next_class)) {
95  case strtolower(ilPermissionGUI::class):
96  $this->tabs_gui->activateTab(self::TAB_PERMISSIONS);
97  $this->ctrl->forwardCommand(new ilPermissionGUI($this));
98  return;
99  case strtolower(ilFooterGroupsGUI::class):
100  $this->tabs_gui->activateTab(self::TAB_INDEX);
101  $this->ctrl->forwardCommand(
102  new ilFooterGroupsGUI(
103  $this->container,
104  $this->translator,
105  $this->ui_handling
106  )
107  );
108  return;
109  default:
110  $this->{$cmd}();
111  return;
112  }
113  }
114 
115  public function getAdminTabs(): void
116  {
117  $this->ui_handling->buildMainTabs();
118  }
119 
120 }
ilErrorHandling $error
New implementation of ilObjectGUI.
repository()
description: > Example for rendering a repository card
Definition: repository.php:17
prepareOutput(bool $show_sub_objects=true)
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
readonly ilObjFooterUIHandling $ui_handling
global $DIC
Definition: shib_login.php:25
readonly ilGlobalTemplateInterface $main_tpl
__construct(Container $dic, ilPlugin $plugin)
ilRbacSystem $rbac_system