ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilMMAbstractItemGUI.php
Go to the documentation of this file.
1<?php
2
3use ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher;
4
11{
12 const IDENTIFIER = 'identifier';
13 use Hasher;
17 protected $ui;
21 protected $http;
25 protected $repository;
29 protected $toolbar;
33 protected $tab_handling;
37 protected $tabs;
41 public $lng;
45 protected $ctrl;
49 public $tpl;
53 public $tree;
57 protected $access;
58
59
68 {
69 global $DIC;
70
71 $this->repository = new ilMMItemRepository();
72 $this->tab_handling = $tab_handling;
73 $this->tabs = $DIC['ilTabs'];
74 $this->lng = $DIC->language();
75 $this->ctrl = $DIC['ilCtrl'];
76 $this->tpl = $DIC['tpl'];
77 $this->tree = $DIC['tree'];
78 $this->toolbar = $DIC['ilToolbar'];
79 $this->http = $DIC->http();
80 $this->ui = $DIC->ui();
81 $this->access = new ilObjMainMenuAccess();
82
83 $this->lng->loadLanguageModule('form');
84 }
85
86
94 protected function determineCommand(string $standard, string $delete) : string
95 {
96 $this->access->checkAccessAndThrowException('visible,read');
97 $cmd = $this->ctrl->getCmd();
98 if ($cmd !== '') {
99 return $cmd;
100 }
101
102 $r = $this->http->request();
103 $post = $r->getParsedBody();
104
105 if ($cmd == "" && isset($post['interruptive_items'])) {
106 $cmd = $delete;
107 } else {
108 $cmd = $standard;
109 }
110
111 return $cmd;
112 }
113
114
120 {
121 $r = $this->http->request();
122 $get = $r->getQueryParams();
123 $post = $r->getParsedBody();
124
125 if (isset($post['interruptive_items'])) {
126 $string = $post['interruptive_items'][0];
127 $identification = $this->unhash($string);
128 } else {
129 $identification = $this->unhash($get[self::IDENTIFIER]);
130 }
131
132 return $this->repository->getItemFacadeForIdentificationString($identification);
133 }
134}
An exception for terminatinating execution or to throw for unit testing.
Class ilMMAbstractItemGUI.
__construct(ilMMTabHandling $tab_handling)
ilMMAbstractItemGUI constructor.
determineCommand(string $standard, string $delete)
Class ilMMItemRepository.
Class ilMMTabHandling.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: goto.php:24
Interface ilMMItemFacadeInterface.
static http()
Fetches the global http state from ILIAS.
repository()
Definition: repository.php:5
ui()
Definition: ui.php:5