19 declare(strict_types=1);
    85     public function __construct(
int $id = 0, 
int $id_type = self::REPOSITORY_NODE_ID, 
int $parent_node_id = 0)
    89         $this->obj_definition = $DIC[
"objDefinition"];
    90         $this->tpl = $DIC[
"tpl"];
    91         $this->
ctrl = $DIC[
"ilCtrl"];
    92         $this->
lng = $DIC[
"lng"];
    93         $this->tabs_gui = $DIC[
"ilTabs"];
    94         $this->object_service = $DIC->object();
    96         $this->error = $DIC[
'ilErr'];
    97         $this->
locator = $DIC[
"ilLocator"];
    98         $this->
user = $DIC->user();
    99         $this->
access = $DIC->access();
   100         $this->
toolbar = $DIC->toolbar();
   101         $this->request = $DIC->http()->request();
   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();
   109         $this->ui_factory = $DIC[
'ui.factory'];
   110         $this->ui_renderer = $DIC[
'ui.renderer'];
   111         $this->
settings = $DIC[
'ilSetting'];
   112         $this->temp_file_system = $DIC->filesystem()->temp();
   114         $tree = $DIC[
"tree"];
   116         $this->requested_ref_id = 0;
   117         if ($this->request_wrapper->has(
"ref_id")) {
   118             $this->requested_ref_id = $this->request_wrapper->retrieve(
"ref_id", $this->
refinery->kindlyTo()->int());
   121         $this->parent_id = $parent_node_id;
   122         $this->type = $this->
getType();
   124         $this->notes_service = $DIC->notes();
   126         $this->requested_new_type = 
'';
   127         if ($this->request_wrapper->has(
"new_type")) {
   128             $this->requested_new_type = $this->request_wrapper->retrieve(
   130                 $this->
refinery->kindlyTo()->string()
   132         } elseif ($this->post_wrapper->has(
"new_type")) {
   133             $this->requested_new_type = $this->post_wrapper->retrieve(
   135                 $this->
refinery->kindlyTo()->string()
   140         switch ($this->id_type) {
   141             case self::REPOSITORY_NODE_ID:
   142                 $this->node_id = 
$id;
   146                 $this->call_by_reference = 
true;  
   150             case self::REPOSITORY_OBJECT_ID:
   151                 $this->object_id = 
$id;
   157             case self::WORKSPACE_NODE_ID:
   158                 $ilUser = $DIC[
"ilUser"];
   159                 $this->node_id = 
$id;
   166             case self::WORKSPACE_OBJECT_ID:
   167                 $ilUser = $DIC[
"ilUser"];
   168                 $this->object_id = 
$id;
   174             case self::PORTFOLIO_OBJECT_ID:
   175                 $this->object_id = 
$id;
   180             case self::OBJECT_ID:
   181                 $this->object_id = 
$id;
   191         if (!$this->object_id) {
   192             $this->creation_mode = 
true;
   194         if ($this->node_id) {
   196             if (!$this->parent_id && $this->tree) {
   197                 $this->parent_id = $this->tree->getParentId($this->node_id);
   200         $this->ref_id = $this->node_id ?? 0;
   206         if (is_object($this->
object)) {
   207             $this->
ctrl->setContextObject($this->
object->getId(), $this->
object->getType());
   225         $next_class = $this->
ctrl->getNextClass($this);
   226         $cmd = $this->
ctrl->getCmd();
   230         switch ($next_class) {
   231             case "ilworkspaceaccessgui":
   232                 if ($this->node_id) {
   233                     $this->tabs_gui->activateTab(
"id_permissions");
   235                     $this->
ctrl->forwardCommand($wspacc);
   262         if ($this->object_id != 0) {
   263             switch ($this->id_type) {
   264                 case self::OBJECT_ID:
   265                 case self::REPOSITORY_OBJECT_ID:
   266                 case self::WORKSPACE_OBJECT_ID:
   267                 case self::PORTFOLIO_OBJECT_ID:
   271                 case self::REPOSITORY_NODE_ID:
   275                 case self::WORKSPACE_NODE_ID:
   296         if ($this->omit_locator) {
   300         switch ($this->id_type) {
   301             case self::REPOSITORY_NODE_ID:
   306                 if ($this->admin_mode == self::ADMIN_MODE_NONE &&
   307                     strtolower($this->
ctrl->getCmdClass()) == 
"ilobjrolegui") {
   308                     $this->
ctrl->setParameterByClass(
   311                         $this->request_wrapper->has(
"rolf_ref_id")
   312                             ? $this->request_wrapper->retrieve(
"rolf_ref_id", $this->
refinery->kindlyTo()->string())
   315                     $this->
ctrl->setParameterByClass(
   318                         $this->request_wrapper->retrieve(
"obj_id", $this->refinery->kindlyTo()->string())
   321                         $this->
lng->txt(
"role"),
   322                         $this->
ctrl->getLinkTargetByClass([
"ilpermissiongui",
   323                             "ilobjrolegui"], 
"perm")
   328                 if ($this->object_id) {
   331                 $this->tpl->setLocator();
   335             case self::WORKSPACE_NODE_ID:
   344     public function delete(): 
void   346         switch ($this->id_type) {
   347             case self::REPOSITORY_NODE_ID:
   348             case self::REPOSITORY_OBJECT_ID:
   349                 parent::deleteObject();
   352             case self::WORKSPACE_NODE_ID:
   353             case self::WORKSPACE_OBJECT_ID:
   354                 $this->deleteConfirmation();
   357             case self::OBJECT_ID:
   358             case self::PORTFOLIO_OBJECT_ID:
   369         switch ($this->id_type) {
   370             case self::REPOSITORY_NODE_ID:
   371             case self::REPOSITORY_OBJECT_ID:
   372                 parent::confirmedDeleteObject();
   375             case self::WORKSPACE_NODE_ID:
   376             case self::WORKSPACE_OBJECT_ID:
   380             case self::OBJECT_ID:
   381             case self::PORTFOLIO_OBJECT_ID:
   393         if (!$this->post_wrapper->has(
"id")) {
   394             $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"no_checkbox"), 
true);
   395             $this->
ctrl->redirect($this, 
"");
   399         $ids = $this->post_wrapper->retrieve(
   404         if (count($ids) == 0) {
   405             $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"no_checkbox"), 
true);
   406             $this->
ctrl->redirect($this, 
"");
   412         foreach ($ids as $node_id) {
   413             $del_nodes[
$node_id] = $this->tree->getNodeData($node_id);
   416         foreach ($del_nodes as $node_id => $node) {
   417             $this->tree->deleteReference($node_id);
   418             if ($this->tree->isInTree($node_id)) {
   419                 $this->tree->deleteTree($node);
   430         $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
"msg_removed"), 
true);
   431         $this->
ctrl->redirect($this, 
"");
   436         return parent::getHTML();
   444         return parent::withReferences();
   448         parent::setCreationMode($mode);
   452         return parent::getCreationMode();
   456         return parent::prepareOutput($show_sub_objects);
   460         parent::setTitleAndDescription();
   464         parent::omitLocator($omit);
   472         parent::setTargetFrame($cmd, $target_frame);
   480         return parent::getCenterColumnHTML();
   484         return parent::getRightColumnHTML();
   488         parent::setColumnSettings($column_gui);
   496         parent::checkPermission($perm, $cmd, $type, 
$ref_id);
   500         parent::showPossibleSubObjects();
   505         parent::redirectToRefId($ref_id, $cmd);
   512         parent::addAdminLocatorItems($do_not_add_object);
   520         switch ($this->id_type) {
   521             case self::REPOSITORY_NODE_ID:
   522             case self::REPOSITORY_OBJECT_ID:
   523                 parent::viewObject();
   526             case self::WORKSPACE_NODE_ID:
   527             case self::WORKSPACE_OBJECT_ID:
   531             case self::OBJECT_ID:
   532             case self::PORTFOLIO_OBJECT_ID:
   545         switch ($this->id_type) {
   546             case self::REPOSITORY_NODE_ID:
   547             case self::REPOSITORY_OBJECT_ID:
   549                     $this->tabs_gui->addTab(
   551                         $this->
lng->txt(
"perm_settings"),
   552                         $this->
ctrl->getLinkTargetByClass([get_class($this), 
"ilpermissiongui"], 
"perm")
   557             case self::WORKSPACE_NODE_ID:
   558             case self::WORKSPACE_OBJECT_ID:
   562                     in_array($this->type, [
"file", 
"blog"]) &&
   565                     $this->tabs_gui->addTab(
   567                         $this->
lng->txt(
"wsp_permissions"),
   568                         $this->
ctrl->getLinkTargetByClass([get_class($this), 
"ilworkspaceaccessgui"], 
"share")
   583         die(
"ilObject2GUI::getReturnLocation() is deprecated.");
   587         die(
"ilObject2GUI::setReturnLocation() is deprecated.");
   591         die(
"ilObject2GUI::showActions() is deprecated.");
   595         die(
"ilObject2GUI::getTabs() is deprecated.");
   608     abstract public function getType(): string;
   615         parent::createObject();
   619         parent::saveObject();
   623         parent::editObject();
   627         parent::updateObject();
   631         parent::cancelObject();
   639         $this->object_id = $obj->
getId();
   641         if (!$parent_node_id) {
   646         if ($this->retriever->has(
'crtptrefid')) {
   647             $parent_node_id = $this->retriever->getMaybeInt(
'crtptrefid') ?? 0;
   650         switch ($this->id_type) {
   651             case self::REPOSITORY_NODE_ID:
   652             case self::REPOSITORY_OBJECT_ID:
   653                 if (!$this->node_id) {
   661                 $rbac_log_roles = $this->rbac_review->getParentRoleIds($this->node_id, 
false);
   665                 $this->
ctrl->setParameter($this, 
"ref_id", $this->node_id);
   668             case self::WORKSPACE_NODE_ID:
   669             case self::WORKSPACE_OBJECT_ID:
   670                 if (!$this->node_id) {
   671                     $this->node_id = $this->tree->insertObject($parent_node_id, $this->object_id);
   675                 $this->
ctrl->setParameter($this, 
"wsp_id", $this->node_id);
   678             case self::OBJECT_ID:
   679             case self::PORTFOLIO_OBJECT_ID:
   689         self::handleAfterSaveCallback($obj, $this->retriever->getMaybeInt(
'crtcb'));
   698         $objDefinition = $DIC[
"objDefinition"];
   700         $callback_ref_id = (
int) $callback_ref_id;
   701         if ($callback_ref_id) {
   703             $class_name = 
"ilObj" . $objDefinition->getClassName($callback_type) . 
"GUI";
   704             if (strtolower($class_name) == 
"ilobjitemgroupgui") {
   705                 $callback_obj = 
new $class_name($callback_ref_id);
   707                 $callback_obj = 
new $class_name(null, $callback_ref_id, 
true, 
false);
   709             $callback_obj->afterSaveCallback($obj);
   719         if ($perm == 
"create") {
   724                 return $this->
getAccessHandler()->checkAccess($perm . 
"_" . $type, $cmd, $node_id);
   736         if ($this->obj_id && $this->
object->getOwner() == $this->
user->getId()) {
   747         if ($this->id_type == self::WORKSPACE_NODE_ID) {
   748             if (!$this->creation_mode && $this->object_id) {
   757                 $dispatcher->setSubObject($sub_type, $sub_id);
   760                     $this->
ctrl->getLinkTarget($this, 
"redrawHeaderAction", 
"", 
true),
   762                     $this->
ctrl->getLinkTargetByClass([
"ilcommonactiondispatchergui", 
"iltagginggui"], 
"")
   765                 $lg = $dispatcher->initHeaderAction();
   767                 if (is_object($lg)) {
   770                         $lg->setContainerObject($this);
   775                     $lg->enableNotes(
true);
   783         return parent::initHeaderAction($sub_type, $sub_id);
   791         parent::redrawHeaderActionObject();
 
getReturnLocation(string $cmd, string $location="")
Deprecated functions. 
 
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
 
delete()
delete object or referenced object (in the case of a referenced object, object data is only deleted i...
 
ilRbacReview $rbac_review
 
executeCommand()
execute command 
 
view()
view object content (repository/workspace switch) 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
New implementation of ilObjectGUI. 
 
$location
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
 
static prepareJsLinks(string $redraw_url, string $notes_url, string $tags_url, ilGlobalTemplateInterface $tpl=null)
Insert js/ajax links into template. 
 
confirmedDelete()
Delete objects (repository/workspace switch) 
 
ilObjectRequestRetriever $retriever
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
prepareOutput(bool $show_sub_objects=true)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
RequestWrapper $request_wrapper
 
putObjectInTree(ilObject $obj, int $parent_node_id=null)
Add object to tree at given position. 
 
setPermissions(int $parent_ref_id)
 
Manages favourites, currently the interface for other components, needs discussion. 
 
const REPOSITORY_OBJECT_ID
 
ilFavouritesManager $favourites
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
ilObjectDefinition $obj_definition
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
omitLocator(bool $omit=true)
 
createReference()
creates reference for object 
 
static gatherFaPa(int $ref_id, array $role_ids, bool $add_action=false)
 
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
 
getTargetFrame(string $cmd, string $target_frame="")
 
getType()
Functions that must be overwritten. 
 
Column user interface class. 
 
setCreationMode(bool $mode=true)
 
Class ilObjectGUI Basic methods of all Output classes. 
 
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id 
 
__construct(int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
 
const PORTFOLIO_OBJECT_ID
 
ilGlobalTemplateInterface $tpl
 
static _lookupObjectId(int $ref_id)
 
static _recordWriteEvent(int $obj_id, int $usr_id, string $action, ?int $parent_obj_id=null)
Records a write event. 
 
ArrayBasedRequestWrapper $post_wrapper
 
withReferences()
Final/Private declaration of unchanged parent methods. 
 
Base class for all sub item list gui's. 
 
const WORKSPACE_OBJECT_ID
 
redrawHeaderAction()
Updating icons after ajax call. 
 
setTabs()
create tabs (repository/workspace switch) 
 
setColumnSettings(ilColumnGUI $column_gui)
 
static add(int $action, int $ref_id, array $diff, bool $source_ref_id=false)
 
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id 
 
putInTree(int $parent_ref_id)
maybe this method should be in tree object!? 
 
lookupObjectId(int $a_node_id)
Get object id for node id. 
 
redirectToRefId(int $ref_id, string $cmd="")
 
static handleAfterSaveCallback(ilObject $obj, ?int $callback_ref_id)
After creation callback. 
 
Access handler for portfolio NOTE: This file needs to stay in the classes directory, WAC will be confused otherwise. 
 
deleteConfirmedObjects()
Delete objects (workspace specific) This should probably be moved elsewhere as done with RepUtil...
 
isVisible(int $ref_id, string $type)
 
afterConstructor()
Do anything that should be done after constructor in here. 
 
Class ilRbacAdmin Core functions for role based access control. 
 
assignObject()
create object instance as internal property (repository/workspace switch) 
 
setTargetFrame(string $cmd, string $target_frame)
 
static _lookupType(int $id, bool $reference=false)
 
addAdminLocatorItems(bool $do_not_add_object=false)
 
Class ilCommonActionDispatcherGUI. 
 
initHeaderAction(?string $sub_type=null, ?int $sub_id=null)
Add header action menu. 
 
ilRbacSystem $rbac_system
 
addLocatorItems()
Functions to be overwritten. 
 
setReturnLocation(string $cmd, string $location)
 
Class ArrayBasedRequestWrapper.