3declare(strict_types=1);
90 $this->obj_definition =
$DIC[
"objDefinition"];
91 $this->tpl =
$DIC[
"tpl"];
92 $this->
ctrl = $DIC[
"ilCtrl"];
93 $this->
lng = $DIC[
"lng"];
94 $this->tabs_gui =
$DIC[
"ilTabs"];
95 $this->object_service =
$DIC->object();
97 $this->
error = $DIC[
'ilErr'];
98 $this->
locator = $DIC[
"ilLocator"];
99 $this->
user = $DIC->user();
100 $this->
access = $DIC->access();
101 $this->
toolbar = $DIC->toolbar();
102 $this->post_wrapper =
$DIC->http()->wrapper()->post();
103 $this->request_wrapper =
$DIC->http()->wrapper()->query();
106 $this->rbac_admin =
$DIC->rbac()->admin();
107 $this->rbac_system =
$DIC->rbac()->system();
108 $this->rbac_review =
$DIC->rbac()->review();
112 $this->requested_ref_id = 0;
113 if ($this->request_wrapper->has(
"ref_id")) {
114 $this->requested_ref_id = $this->request_wrapper->retrieve(
"ref_id", $this->
refinery->kindlyTo()->int());
117 $this->parent_id = $parent_node_id;
118 $this->type = $this->
getType();
120 $this->notes_service =
$DIC->notes();
122 $this->requested_new_type =
'';
123 if ($this->request_wrapper->has(
"new_type")) {
124 $this->requested_new_type = $this->request_wrapper->retrieve(
126 $this->
refinery->kindlyTo()->string()
128 } elseif ($this->post_wrapper->has(
"new_type")) {
129 $this->requested_new_type = $this->post_wrapper->retrieve(
131 $this->
refinery->kindlyTo()->string()
136 switch ($this->id_type) {
138 $this->node_id =
$id;
142 $this->call_by_reference =
true;
147 $this->object_id =
$id;
155 $this->node_id =
$id;
157 $this->object_id = $this->tree->lookupObjectId($this->node_id);
164 $this->object_id =
$id;
171 $this->object_id =
$id;
177 $this->object_id =
$id;
187 if (!$this->object_id) {
188 $this->creation_mode =
true;
190 if ($this->node_id) {
192 if (!$this->parent_id && $this->tree) {
193 $this->parent_id = $this->tree->getParentId($this->node_id);
196 $this->ref_id = $this->node_id ?? 0;
202 if (is_object($this->
object)) {
203 $this->
ctrl->setContextObject($this->
object->getId(), $this->object->getType());
221 $next_class = $this->
ctrl->getNextClass($this);
222 $cmd = $this->
ctrl->getCmd();
226 switch ($next_class) {
227 case "ilworkspaceaccessgui":
228 if ($this->node_id) {
229 $this->tabs_gui->activateTab(
"id_permissions");
231 $this->
ctrl->forwardCommand($wspacc);
258 if ($this->object_id != 0) {
259 switch ($this->id_type) {
292 if ($this->omit_locator) {
296 switch ($this->id_type) {
302 if ($this->admin_mode == self::ADMIN_MODE_NONE &&
303 strtolower($this->
ctrl->getCmdClass()) ==
"ilobjrolegui") {
304 $this->
ctrl->setParameterByClass(
307 $this->request_wrapper->has(
"rolf_ref_id")
308 ? $this->request_wrapper->retrieve(
"rolf_ref_id", $this->refinery->kindlyTo()->string())
311 $this->
ctrl->setParameterByClass(
314 $this->request_wrapper->retrieve(
"obj_id", $this->refinery->kindlyTo()->string())
317 $this->
lng->txt(
"role"),
318 $this->ctrl->getLinkTargetByClass(array(
"ilpermissiongui",
319 "ilobjrolegui"),
"perm")
324 if ($this->object_id) {
327 $this->tpl->setLocator();
340 public function delete():
void
342 switch ($this->id_type) {
345 parent::deleteObject();
350 $this->deleteConfirmation();
365 switch ($this->id_type) {
368 parent::confirmedDeleteObject();
389 if (!$this->post_wrapper->has(
"id")) {
390 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"no_checkbox"),
true);
391 $this->
ctrl->redirect($this,
"");
395 $ids = $this->post_wrapper->retrieve(
397 $this->
refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->int())
400 if (count($ids) == 0) {
401 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"no_checkbox"),
true);
402 $this->
ctrl->redirect($this,
"");
407 $del_nodes = array();
412 foreach ($del_nodes as
$node_id => $node) {
413 $this->tree->deleteReference(
$node_id);
414 if ($this->tree->isInTree(
$node_id)) {
415 $this->tree->deleteTree($node);
426 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
"msg_removed"),
true);
427 $this->
ctrl->redirect($this,
"");
432 return parent::getHTML();
440 return parent::withReferences();
444 parent::setCreationMode($mode);
448 return parent::getCreationMode();
452 return parent::prepareOutput($show_sub_objects);
456 parent::setTitleAndDescription();
460 parent::omitLocator($omit);
476 return parent::getCenterColumnHTML();
480 return parent::getRightColumnHTML();
484 parent::setColumnSettings($column_gui);
496 parent::showPossibleSubObjects();
500 parent::cancelDeleteObject();
504 parent::redirectToRefId(
$ref_id, $cmd);
508 return parent::fillCloneTemplate($tpl_varname,
$type);
515 parent::addAdminLocatorItems($do_not_add_object);
523 switch ($this->id_type) {
524 case self::REPOSITORY_NODE_ID:
525 case self::REPOSITORY_OBJECT_ID:
526 parent::viewObject();
529 case self::WORKSPACE_NODE_ID:
530 case self::WORKSPACE_OBJECT_ID:
534 case self::OBJECT_ID:
535 case self::PORTFOLIO_OBJECT_ID:
548 switch ($this->id_type) {
549 case self::REPOSITORY_NODE_ID:
550 case self::REPOSITORY_OBJECT_ID:
551 if ($this->checkPermissionBool(
"edit_permission")) {
552 $this->tabs_gui->addTab(
554 $this->
lng->txt(
"perm_settings"),
555 $this->ctrl->getLinkTargetByClass(array(get_class($this),
"ilpermissiongui"),
"perm")
560 case self::WORKSPACE_NODE_ID:
561 case self::WORKSPACE_OBJECT_ID:
564 $this->checkPermissionBool(
"edit_permission") &&
565 in_array($this->type, array(
"file",
"blog")) &&
568 $this->tabs_gui->addTab(
570 $this->
lng->txt(
"wsp_permissions"),
571 $this->ctrl->getLinkTargetByClass(array(get_class($this),
"ilworkspaceaccessgui"),
"share")
586 die(
"ilObject2GUI::getReturnLocation() is deprecated.");
590 die(
"ilObject2GUI::setReturnLocation() is deprecated.");
594 die(
"ilObject2GUI::showActions() is deprecated.");
598 die(
"ilObject2GUI::getTabs() is deprecated.");
618 parent::createObject();
622 parent::saveObject();
626 parent::editObject();
630 parent::updateObject();
634 parent::cancelObject();
644 $forms = parent::initCreationForms($new_type);
647 if ($this->id_type == self::WORKSPACE_NODE_ID) {
648 unset($forms[self::CFORM_CLONE]);
656 parent::importFileObject($this->parent_id);
664 $this->object_id = $obj->
getId();
666 if (!$parent_node_id) {
667 $parent_node_id = $this->parent_id;
671 if ($this->retriever->has(
'crtptrefid')) {
672 $parent_node_id = $this->retriever->getMaybeInt(
'crtptrefid') ?? 0;
675 switch ($this->id_type) {
676 case self::REPOSITORY_NODE_ID:
677 case self::REPOSITORY_OBJECT_ID:
678 if (!$this->node_id) {
686 $rbac_log_roles = $this->rbac_review->getParentRoleIds($this->node_id,
false);
690 $this->
ctrl->setParameter($this,
"ref_id", $this->node_id);
693 case self::WORKSPACE_NODE_ID:
694 case self::WORKSPACE_OBJECT_ID:
695 if (!$this->node_id) {
696 $this->node_id = $this->tree->insertObject($parent_node_id, $this->object_id);
698 $this->getAccessHandler()->setPermissions($parent_node_id, $this->node_id);
700 $this->
ctrl->setParameter($this,
"wsp_id", $this->node_id);
703 case self::OBJECT_ID:
704 case self::PORTFOLIO_OBJECT_ID:
714 self::handleAfterSaveCallback($obj, $this->retriever->getMaybeInt(
'crtcb'));
723 $objDefinition =
$DIC[
"objDefinition"];
725 $callback_ref_id = (
int) $callback_ref_id;
726 if ($callback_ref_id) {
728 $class_name =
"ilObj" . $objDefinition->getClassName($callback_type) .
"GUI";
729 if (strtolower($class_name) ==
"ilobjitemgroupgui") {
730 $callback_obj =
new $class_name($callback_ref_id);
732 $callback_obj =
new $class_name(
null, $callback_ref_id,
true,
false);
734 $callback_obj->afterSaveCallback($obj);
744 if ($perm ==
"create") {
746 $node_id = $this->parent_id;
749 return $this->getAccessHandler()->checkAccess($perm .
"_" .
$type, $cmd, $node_id);
753 $node_id = $this->node_id;
756 return $this->getAccessHandler()->checkAccess($perm, $cmd, $node_id);
761 if ($this->obj_id && $this->
object->getOwner() == $this->user->getId()) {
772 if ($this->id_type == self::WORKSPACE_NODE_ID) {
773 if (!$this->creation_mode && $this->object_id) {
776 $this->getAccessHandler(),
782 $dispatcher->setSubObject($sub_type, $sub_id);
785 $this->
ctrl->getLinkTarget($this,
"redrawHeaderAction",
"",
true),
787 $this->ctrl->getLinkTargetByClass([
"ilcommonactiondispatchergui",
"iltagginggui"],
"")
790 $lg = $dispatcher->initHeaderAction();
792 if (is_object($lg)) {
795 $lg->setContainerObject($this);
800 $lg->enableNotes(
true);
808 return parent::initHeaderAction($sub_type, $sub_id);
816 parent::redrawHeaderActionObject();
821 if ($this->id_type == self::WORKSPACE_NODE_ID) {
826 $plink->setIncludePermanentLinkText(
false);
827 return $plink->getHTML();
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Error Handling & global info handling uses PEAR error class.
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...
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
RequestWrapper $request_wrapper
putObjectInTree(ilObject $obj, int $parent_node_id=null)
Add object to tree at given position.
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] don't belong to the current class!...
initCreationForms(string $new_type)
Init creation forms.
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)
afterConstructor()
Do anything that should be done after constructor in here.
ilObjectService $object_service
getReturnLocation(string $cmd, string $location="")
Deprecated functions.
ilFavouritesManager $favourites
addLocatorItems()
Functions to be overwritten.
confirmedDelete()
Delete objects (repository/workspace switch)
getPermanentLinkWidget(string $append=null, bool $center=false)
withReferences()
Final/Private declaration of unchanged parent methods.
prepareOutput(bool $show_sub_objects=true)
isVisible(int $ref_id, string $type)
ArrayBasedRequestWrapper $post_wrapper
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
fillCloneTemplate(?string $tpl_varname, string $type)
Fill object clone template This method can be called from any object GUI class that wants to offer ob...
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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!?
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 $a_action, int $a_ref_id, array $a_diff, bool $a_source_ref_id=false)
static gatherFaPa(int $a_ref_id, array $a_role_ids, bool $a_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...
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface RequestWrapper.
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...
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params