19declare(strict_types=1);
87 $this->obj_definition =
$DIC[
"objDefinition"];
88 $this->tpl =
$DIC[
"tpl"];
89 $this->
ctrl = $DIC[
"ilCtrl"];
90 $this->
lng = $DIC[
"lng"];
91 $this->tabs_gui =
$DIC[
"ilTabs"];
92 $this->object_service =
$DIC->object();
94 $this->
error = $DIC[
'ilErr'];
95 $this->
locator = $DIC[
"ilLocator"];
96 $this->
user = $DIC->user();
97 $this->
access = $DIC->access();
98 $this->
toolbar = $DIC->toolbar();
99 $this->
http = $DIC[
'http'];
100 $this->request = $this->
http->request();
101 $this->post_wrapper = $this->
http->wrapper()->post();
102 $this->request_wrapper = $this->
http->wrapper()->query();
105 $this->rbac_admin =
$DIC->rbac()->admin();
106 $this->rbac_system =
$DIC->rbac()->system();
107 $this->rbac_review =
$DIC->rbac()->review();
108 $this->ui_factory =
$DIC[
'ui.factory'];
109 $this->ui_renderer =
$DIC[
'ui.renderer'];
110 $this->
settings = $DIC[
'ilSetting'];
111 $this->temp_file_system =
$DIC->filesystem()->temp();
115 $this->requested_ref_id = 0;
116 if ($this->request_wrapper->has(
"ref_id")) {
117 $this->requested_ref_id = $this->request_wrapper->retrieve(
"ref_id", $this->
refinery->kindlyTo()->int());
120 $this->parent_id = $parent_node_id;
121 $this->type = $this->
getType();
123 $this->notes_service =
$DIC->notes();
125 $this->requested_new_type =
'';
126 if ($this->request_wrapper->has(
"new_type")) {
127 $this->requested_new_type = $this->request_wrapper->retrieve(
129 $this->
refinery->kindlyTo()->string()
131 } elseif ($this->post_wrapper->has(
"new_type")) {
132 $this->requested_new_type = $this->post_wrapper->retrieve(
134 $this->
refinery->kindlyTo()->string()
139 switch ($this->id_type) {
141 $this->node_id =
$id;
145 $this->call_by_reference =
true;
150 $this->object_id =
$id;
157 $ilUser =
$DIC[
"ilUser"];
158 $this->node_id =
$id;
160 $this->object_id = $this->tree->lookupObjectId($this->node_id);
166 $ilUser =
$DIC[
"ilUser"];
167 $this->object_id =
$id;
174 $this->object_id =
$id;
180 $this->object_id =
$id;
190 if (!$this->object_id) {
191 $this->creation_mode =
true;
193 if ($this->node_id) {
195 if (!$this->parent_id && $this->tree) {
196 $this->parent_id = $this->tree->getParentId($this->node_id);
199 $this->ref_id = $this->node_id ?? 0;
205 if (is_object($this->
object)) {
206 $this->
ctrl->setContextObject($this->
object->getId(), $this->object->getType());
224 $next_class = $this->
ctrl->getNextClass($this);
225 $cmd = $this->
ctrl->getCmd();
229 switch ($next_class) {
230 case "ilworkspaceaccessgui":
231 if ($this->node_id) {
232 $this->tabs_gui->activateTab(
"id_permissions");
234 $this->
ctrl->forwardCommand($wspacc);
261 if ($this->object_id != 0) {
262 switch ($this->id_type) {
295 if ($this->omit_locator) {
299 switch ($this->id_type) {
305 if ($this->admin_mode == self::ADMIN_MODE_NONE &&
306 strtolower($this->
ctrl->getCmdClass()) ==
"ilobjrolegui") {
307 $this->
ctrl->setParameterByClass(
310 $this->request_wrapper->has(
"rolf_ref_id")
311 ? $this->request_wrapper->retrieve(
"rolf_ref_id", $this->refinery->kindlyTo()->string())
314 $this->
ctrl->setParameterByClass(
317 $this->request_wrapper->retrieve(
"obj_id", $this->refinery->kindlyTo()->string())
320 $this->
lng->txt(
"role"),
321 $this->ctrl->getLinkTargetByClass([
"ilpermissiongui",
322 "ilobjrolegui"],
"perm")
327 if ($this->object_id) {
330 $this->tpl->setLocator();
343 public function delete():
void
345 switch ($this->id_type) {
348 parent::deleteObject();
353 $this->deleteConfirmation();
368 switch ($this->id_type) {
371 parent::confirmedDeleteObject();
392 if (!$this->post_wrapper->has(
"id")) {
393 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"no_checkbox"),
true);
394 $this->
ctrl->redirect($this,
"");
398 $ids = $this->post_wrapper->retrieve(
400 $this->
refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->int())
403 if (count($ids) == 0) {
404 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"no_checkbox"),
true);
405 $this->
ctrl->redirect($this,
"");
415 foreach ($del_nodes as
$node_id => $node) {
416 $this->tree->deleteReference(
$node_id);
417 if ($this->tree->isInTree(
$node_id)) {
418 $this->tree->deleteTree($node);
429 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
"msg_removed"),
true);
430 $this->
ctrl->redirect($this,
"");
435 return parent::getHTML();
443 return parent::withReferences();
447 parent::setCreationMode($mode);
451 return parent::getCreationMode();
455 return parent::prepareOutput($show_sub_objects);
459 parent::setTitleAndDescription();
463 parent::omitLocator($omit);
479 return parent::getCenterColumnHTML();
483 return parent::getRightColumnHTML();
487 parent::setColumnSettings($column_gui);
499 parent::showPossibleSubObjects();
504 parent::redirectToRefId(
$ref_id, $cmd);
511 parent::addAdminLocatorItems($do_not_add_object);
519 switch ($this->id_type) {
520 case self::REPOSITORY_NODE_ID:
521 case self::REPOSITORY_OBJECT_ID:
522 parent::viewObject();
525 case self::WORKSPACE_NODE_ID:
526 case self::WORKSPACE_OBJECT_ID:
530 case self::OBJECT_ID:
531 case self::PORTFOLIO_OBJECT_ID:
544 switch ($this->id_type) {
545 case self::REPOSITORY_NODE_ID:
546 case self::REPOSITORY_OBJECT_ID:
547 if ($this->checkPermissionBool(
"edit_permission")) {
548 $this->tabs_gui->addTab(
550 $this->
lng->txt(
"perm_settings"),
551 $this->ctrl->getLinkTargetByClass([get_class($this),
"ilpermissiongui"],
"perm")
556 case self::WORKSPACE_NODE_ID:
557 case self::WORKSPACE_OBJECT_ID:
560 $this->checkPermissionBool(
"edit_permission") &&
561 in_array($this->type, [
"file",
"blog"]) &&
564 $this->tabs_gui->addTab(
566 $this->
lng->txt(
"wsp_permissions"),
567 $this->ctrl->getLinkTargetByClass([get_class($this),
"ilworkspaceaccessgui"],
"share")
582 die(
"ilObject2GUI::getReturnLocation() is deprecated.");
586 die(
"ilObject2GUI::setReturnLocation() is deprecated.");
590 die(
"ilObject2GUI::showActions() is deprecated.");
594 die(
"ilObject2GUI::getTabs() is deprecated.");
614 parent::createObject();
618 parent::saveObject();
622 parent::editObject();
626 parent::updateObject();
630 parent::cancelObject();
638 $this->object_id = $obj->
getId();
640 if (!$parent_node_id) {
641 $parent_node_id = $this->parent_id;
645 if ($this->retriever->has(
'crtptrefid')) {
646 $parent_node_id = $this->retriever->getMaybeInt(
'crtptrefid') ?? 0;
649 switch ($this->id_type) {
650 case self::REPOSITORY_NODE_ID:
651 case self::REPOSITORY_OBJECT_ID:
652 if (!$this->node_id) {
660 $rbac_log_roles = $this->rbac_review->getParentRoleIds($this->node_id,
false);
664 $this->
ctrl->setParameter($this,
"ref_id", $this->node_id);
667 case self::WORKSPACE_NODE_ID:
668 case self::WORKSPACE_OBJECT_ID:
669 if (!$this->node_id) {
670 $this->node_id = $this->tree->insertObject($parent_node_id, $this->object_id);
672 $this->getAccessHandler()->setPermissions($parent_node_id, $this->node_id);
674 $this->
ctrl->setParameter($this,
"wsp_id", $this->node_id);
677 case self::OBJECT_ID:
678 case self::PORTFOLIO_OBJECT_ID:
688 self::handleAfterSaveCallback($obj, $this->retriever->getMaybeInt(
'crtcb'));
697 $objDefinition =
$DIC[
"objDefinition"];
699 $callback_ref_id = (
int) $callback_ref_id;
700 if ($callback_ref_id) {
702 $class_name =
"ilObj" . $objDefinition->getClassName($callback_type) .
"GUI";
703 if (strtolower($class_name) ==
"ilobjitemgroupgui") {
704 $callback_obj =
new $class_name($callback_ref_id);
706 $callback_obj =
new $class_name(
null, $callback_ref_id,
true,
false);
708 $callback_obj->afterSaveCallback($obj);
718 if ($perm ==
"create") {
720 $node_id = $this->parent_id;
723 return $this->getAccessHandler()->checkAccess($perm .
"_" . $type, $cmd, $node_id);
727 $node_id = $this->node_id;
730 return $this->getAccessHandler()->checkAccess($perm, $cmd, $node_id);
735 if ($this->obj_id && $this->
object->getOwner() == $this->user->getId()) {
746 if ($this->id_type == self::WORKSPACE_NODE_ID) {
747 if (!$this->creation_mode && $this->object_id) {
750 $this->getAccessHandler(),
756 $dispatcher->setSubObject($sub_type, $sub_id);
759 $this->
ctrl->getLinkTarget($this,
"redrawHeaderAction",
"",
true),
761 $this->ctrl->getLinkTargetByClass([
"ilcommonactiondispatchergui",
"iltagginggui"],
"")
764 $lg = $dispatcher->initHeaderAction();
766 if (is_object($lg)) {
769 $lg->setContainerObject($this);
774 $lg->enableNotes(
true);
782 return parent::initHeaderAction($sub_type, $sub_id);
790 parent::redrawHeaderActionObject();
Class ArrayBasedRequestWrapper.
static _recordWriteEvent(int $obj_id, int $usr_id, string $action, ?int $parent_obj_id=null)
Records a write event.
Column user interface class.
Class ilCommonActionDispatcherGUI.
Class ilCtrl provides processing control methods.
Error Handling & global info handling.
Manages favourites, currently the interface for other components, needs discussion.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
New implementation of ilObjectGUI.
getType()
Functions that must be overwritten.
setColumnSettings(ilColumnGUI $column_gui)
ilObjectDefinition $obj_definition
static handleAfterSaveCallback(ilObject $obj, ?int $callback_ref_id)
After creation callback.
executeCommand()
execute command
ilRbacReview $rbac_review
omitLocator(bool $omit=true)
redirectToRefId(int $ref_id, string $cmd="")
redirects to (repository) view per ref id usually to a container and usually used at the end of a sav...
const PORTFOLIO_OBJECT_ID
setTabs()
create tabs (repository/workspace switch)
const WORKSPACE_OBJECT_ID
redrawHeaderAction()
Updating icons after ajax call.
__construct(int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
setTargetFrame(string $cmd, string $target_frame)
Set specific target frame for command.
ilObjectRequestRetriever $retriever
initHeaderAction(?string $sub_type=null, ?int $sub_id=null)
Add header action menu.
ilGlobalTemplateInterface $tpl
getCenterColumnHTML()
Get center column.
showPossibleSubObjects()
show possible sub objects (pull down menu)
deleteConfirmedObjects()
Delete objects (workspace specific) This should probably be moved elsewhere as done with RepUtil.
getTabs()
@abstract overwrite in derived GUI class of your object type
setReturnLocation(string $cmd, string $location)
set specific return location for command
setCreationMode(bool $mode=true)
If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode...
getRightColumnHTML()
Display right column.
getTargetFrame(string $cmd, string $target_frame="")
get target frame for command (command is method name without "Object", e.g.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
addAdminLocatorItems(bool $do_not_add_object=false)
should be overwritten to add object specific items (repository items are preloaded)
assignObject()
create object instance as internal property (repository/workspace switch)
ilRbacSystem $rbac_system
view()
view object content (repository/workspace switch)
putObjectInTree(ilObject $obj, ?int $parent_node_id=null)
Add object to tree at given position.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
afterConstructor()
Do anything that should be done after constructor in here.
getReturnLocation(string $cmd, string $location="")
Deprecated functions.
ilFavouritesManager $favourites
addLocatorItems()
Functions to be overwritten.
confirmedDelete()
Delete objects (repository/workspace switch)
withReferences()
Final/Private declaration of unchanged parent methods.
prepareOutput(bool $show_sub_objects=true)
isVisible(int $ref_id, string $type)
const REPOSITORY_OBJECT_ID
parses the objects.xml it handles the xml-description of all ilias objects
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
Class ilObjectGUI Basic methods of all Output classes.
static prepareJsLinks(string $redraw_url, string $notes_url, string $tags_url, ?ilGlobalTemplateInterface $tpl=null)
Insert js/ajax links into template.
Base class for all sub item list gui's.
Class ilObject Basic functions for all objects.
static _lookupObjectId(int $ref_id)
static _lookupType(int $id, bool $reference=false)
setPermissions(int $parent_ref_id)
createReference()
creates reference for object
delete()
delete object or referenced object (in the case of a referenced object, object data is only deleted i...
putInTree(int $parent_ref_id)
maybe this method should be in tree object!?
Access handler for portfolio NOTE: This file needs to stay in the classes directory,...
Class ilRbacAdmin Core functions for role based access control.
static add(int $action, int $ref_id, array $diff, bool $source_ref_id=false)
static gatherFaPa(int $ref_id, array $role_ids, bool $add_action=false)
class ilRbacReview Contains Review functions of core Rbac.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface RequestWrapper.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
static http()
Fetches the global http state from ILIAS.
if(!file_exists('../ilias.ini.php'))