19 declare(strict_types=1);
64 $this->
ctrl = $DIC->ctrl();
66 $this->request_wrapper = $DIC->http()->wrapper()->query();
83 return self::buildAjaxHash(
102 ?
string $sub_type =
null,
107 $node_type .
";" . $node_id .
";" . $obj_type .
";" . $obj_id .
";" .
108 $sub_type .
";" . $sub_id .
";" .
$news_id 114 $arr = explode(
";", $hash);
115 if (isset($arr[4]) && isset($arr[5])) {
119 return implode(
";", $arr);
129 $ilAccess = $DIC->access();
130 $ilUser = $DIC->user();
131 $request_wrapper = $DIC->http()->wrapper()->query();
132 $refinery = $DIC->refinery();
134 if ($request_wrapper->has(
"cadh")) {
135 $parts = explode(
";", $request_wrapper->retrieve(
"cadh", $refinery->kindlyTo()->string()));
139 $obj_type = (string)
$parts[2];
141 $sub_type = (string)
$parts[4];
145 switch ($node_type) {
146 case self::TYPE_REPOSITORY:
150 case self::TYPE_WORKSPACE:
161 if ($sub_type && $sub_id) {
162 $dispatcher->setSubObject($sub_type, $sub_id);
167 if ($node_type == self::TYPE_REPOSITORY && $obj_type !=
"poll") {
168 $dispatcher->enableCommentsSettings(
true);
181 !$this->access_handler->checkAccess(
"visible",
"", $this->node_id) &&
182 !$this->access_handler->checkAccess(
"read",
"", $this->node_id)
187 $next_class = $this->
ctrl->getNextClass($this);
189 $this->
ctrl->saveParameter($this,
"cadh");
191 switch ($next_class) {
195 if ($this->sub_type) {
199 $note_gui =
new ilNoteGUI($this->obj_id, (
int) $this->sub_id, $obj_type,
false, $this->news_id);
200 $note_gui->enablePrivateNotes();
202 $has_write = $this->access_handler->checkAccess(
"write",
"", $this->node_id);
203 if ($has_write && $this->
settings->get(
"comments_del_tutor",
"1")) {
204 $note_gui->enablePublicNotesDeletion();
208 if ($this->enable_comments_settings) {
212 $this->access_handler->checkAccess(
"edit_permissions",
"", $this->node_id)
214 $note_gui->enableCommentsSettings();
219 elseif ($this->sub_id) {
220 $note_gui->enablePublicNotes();
223 $this->
ctrl->forwardCommand($note_gui);
228 $tags_gui->setObject($this->obj_id, $this->obj_type);
229 $this->
ctrl->forwardCommand($tags_gui);
232 case "ilobjectactivationgui":
233 $parent_id = $this->retriever->getMaybeInt(
'parent_id') ?? 0;
234 $this->
ctrl->setParameter($this,
"parent_id", $parent_id);
236 $this->
ctrl->forwardCommand($act_gui);
242 $this->request_wrapper->has(
"rnsb")
244 $rating_gui->setObject($this->obj_id, $this->obj_type, $this->sub_id, $this->sub_type);
247 $rating_gui->setObject($this->obj_id, $this->obj_type);
249 $this->
ctrl->forwardCommand($rating_gui);
250 if ($this->rating_callback) {
253 $this->
ctrl->redirect($this->rating_callback[0], $this->rating_callback[1]);
267 public function setSubObject(?
string $sub_obj_type, ?
int $sub_obj_id): void
269 $this->sub_type = $sub_obj_type;
270 $this->sub_id = $sub_obj_id;
278 $this->enable_comments_settings = $value;
286 $this->rating_callback = [$gui, $cmd];
297 !$this->access_handler->checkAccess(
"visible",
"", $this->node_id) &&
298 !$this->access_handler->checkAccess(
"read",
"", $this->node_id)
305 ($this->node_type == self::TYPE_REPOSITORY) ?
310 $header_action->enableCopy(
false);
311 $header_action->enableCut(
false);
312 $header_action->enableDelete(
false);
313 $header_action->enableLink(
false);
314 $header_action->enableInfoScreen(
false);
315 $header_action->enableTimings(
false);
316 $header_action->enableSubscribe($this->node_type == self::TYPE_REPOSITORY);
318 $header_action->initItem($this->node_id, $this->obj_id, $this->obj_type);
319 $header_action->setHeaderSubObject($this->sub_type, $this->sub_id);
322 return $header_action;
static removeSubObjFromAjaxHash(string $hash)
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
setRatingCallback(object $gui, string $cmd)
Add callback for rating gui.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initHeaderAction()
Set header action menu.
ilObjectRequestRetriever $retriever
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjectActivationGUI.
static buildAjaxHash(int $node_type, ?int $node_id, string $obj_type, int $obj_id, ?string $sub_type=null, ?int $sub_id=null, int $news_id=0)
Build ajax hash.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
ILIAS HTTP Wrapper RequestWrapper $request_wrapper
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getListGUIByType(string $type, int $context=ilObjectListGUI::CONTEXT_REPOSITORY)
Base class for all sub item list gui's.
bool $enable_comments_settings
setSubObject(?string $sub_obj_type, ?int $sub_obj_id)
Set sub object attributes.
getAjaxHash()
Build ajax hash for current (object/node) properties.
enableCommentsSettings(bool $value)
Toggle comments settings.
__construct(int $node_type, $access_handler, string $obj_type, int $node_id, int $obj_id, int $news_id=0)
Class ilCommonActionDispatcherGUI.
ILIAS Refinery Factory $refinery
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call