19 declare(strict_types=1);
46 public function __construct(
int $user_id = null,
bool $read_only =
false)
50 $this->
user = $DIC[
'ilUser'];
51 $this->
ctrl = $DIC[
'ilCtrl'];
52 $this->tpl = $DIC[
'tpl'];
53 $this->ui_factory = $DIC[
'ui.factory'];
54 $this->
toolbar = $DIC[
'ilToolbar'];
55 $this->
lng = $DIC[
'lng'];
56 $this->obj_definition = $DIC[
'objDefinition'];
57 $this->tree = $DIC[
'tree'];
60 $this->
lng->loadLanguageModule(
'obj');
62 $this->user_id = $this->
user->getId();
63 if (!is_null($user_id)) {
67 $this->own_id = $this->retriever->getMaybeInt(self::P_OWNID, 0);
72 $this->
ctrl->getNextClass($this);
73 $cmd = $this->
ctrl->getCmd();
87 if ($objects === []) {
88 $tbl->setTitle($this->
lng->txt(
'user_owns_no_objects'));
89 $this->tpl->setContent($tbl->getHTML());
93 $object_types = array_keys($objects);
96 foreach ($object_types as $type) {
97 $this->
ctrl->setParameterByClass(self::class,
'type', $type);
98 $target = $this->
ctrl->getLinkTargetByClass(self::class,
'listObjects');
100 $options[$type] = $this->ui_factory->button()->shy($label, $target);
104 $selected_type = $this->retriever->getMaybeString(
'type') ?? array_keys($options)[0];
105 unset($options[$selected_type]);
107 $dropdown = $this->ui_factory->dropdown()->standard($options)->withLabel(
108 $this->
lng->txt(
'select_object_type')
111 $this->
toolbar->addStickyItem($dropdown);
113 if (is_array($objects[$selected_type])
114 && $objects[$selected_type] !== []) {
119 $tbl->initItems($objects[$selected_type]);
120 $this->
ctrl->setParameterByClass(self::class,
'type', $selected_type);
121 $this->tpl->setContent($tbl->getHTML());
126 if ($this->obj_definition->isPlugin($type)) {
127 return $this->
lng->txt($type,
'obj_' . $type);
130 return $this->
lng->txt(
'objs_' . $type);
137 $tbl->writeFilterToSession();
151 $parent = $this->tree->getParentId($ref_id);
152 $this->
ctrl->setParameterByClass(
'ilRepositoryGUI',
'ref_id', $parent);
153 $this->
ctrl->setParameterByClass(
'ilRepositoryGUI',
'item_ref_id', $ref_id);
154 $this->
ctrl->setParameterByClass(
'ilRepositoryGUI',
'cmd', $cmd);
155 $this->
ctrl->redirectByClass(
'ilRepositoryGUI');
160 $node = $this->tree->getNodeData($ref_id);
161 $gui_class =
'ilObj' . $this->obj_definition->getClassName($node[
'type']) .
'GUI';
162 $path = [
'ilRepositoryGUI', $gui_class, $class];
164 if ($class ==
'ilExportGUI') {
166 $this->
ctrl->getLinkTargetByClass(
$path);
168 switch ($node[
'type']) {
170 $export_cmd =
'exportList';
171 $path = [
'ilRepositoryGUI',
'ilGlossaryEditorGUI', $gui_class];
175 $export_cmd =
'export';
176 $path = [
'ilRepositoryGUI', $gui_class];
179 $this->
ctrl->setParameterByClass($gui_class,
'ref_id', $ref_id);
180 $this->
ctrl->setParameterByClass($gui_class,
'cmd', $export_cmd);
185 $this->
ctrl->setParameterByClass($class,
'ref_id', $ref_id);
186 $this->
ctrl->setParameterByClass($class,
'cmd', $cmd);
190 public function delete():
void 226 ilPermissionGUI::class,
238 if ($this->read_only) {
240 'Cannot perform actions when in read only mode'
ilGlobalTemplateInterface $tpl
__construct(int $user_id=null, bool $read_only=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
redirectCmd(int $ref_id, string $class, string $cmd=null)
redirectParentCmd(int $ref_id, string $cmd)
getLabelForObjectType(string $type)
Class ilObjectOwnershipManagementGUI.
parses the objects.xml it handles the xml-description of all ilias objects
ilObjectDefinition $obj_definition
Base class for all sub item list gui's.
static getAllOwnedRepositoryObjects(int $user_id)
static fixMissingTitles($type, array &$obj_title_map)
Try to fix missing object titles.
ilObjectRequestRetriever $retriever