19 declare(strict_types=1);
38 bool $read_only =
false 40 $this->
ctrl = $this->gui->ctrl();
41 $this->
lng = $this->domain->lng();
43 $this->gui->http()->wrapper(),
44 $this->domain->refinery()
47 $this->
lng->loadLanguageModule(
'obj');
49 $this->user_id = $domain->user()->getId();
50 if (!is_null($user_id)) {
54 $this->own_id = $this->retriever->getMaybeInt(self::P_OWNID, 0);
59 $this->
ctrl->getNextClass($this);
60 $cmd = $this->
ctrl->getCmd();
71 $mt = $this->gui->mainTemplate();
72 $toolbar = $this->gui->toolbar();
73 $f = $this->gui->ui()->factory();
75 if ($objects === []) {
76 $table_builder = $this->gui->ownership()->ownershipManagementTableBuilder(
78 $this->
lng->txt(
'user_owns_no_objects'),
84 $mt->setContent($table_builder->getTable()->render());
88 $object_types = array_keys($objects);
91 foreach ($object_types as $type) {
92 $this->
ctrl->setParameterByClass(self::class,
'type', $type);
93 $target = $this->
ctrl->getLinkTargetByClass(self::class,
'listObjects');
95 $options[$type] =
$f->button()->shy($label, $target);
99 $selected_type = $this->retriever->getMaybeString(
'type') ?? array_keys($options)[0];
100 unset($options[$selected_type]);
102 $dropdown =
$f->dropdown()->standard($options)->withLabel(
103 $this->
lng->txt(
'select_object_type')
106 $toolbar->addStickyItem($dropdown);
108 if (is_array($objects[$selected_type])
109 && $objects[$selected_type] !== []) {
113 $table_builder = $this->gui->ownership()->ownershipManagementTableBuilder(
122 $this->
ctrl->setParameterByClass(self::class,
'type', $selected_type);
124 if ($table_builder->getTable()->handleCommand()) {
128 $mt->setContent($table_builder->getTable()->render());
133 $obj_definition = $this->domain->objectDefinition();
134 if ($obj_definition->isPlugin($type)) {
136 ->txt(
'obj_' . $type);
139 return $this->
lng->txt(
'objs_' . $type);
144 $tree = $this->domain->repositoryTree();
145 $parent = $tree->getParentId($ref_id);
146 $this->
ctrl->setParameterByClass(ilRepositoryGUI::class,
'ref_id', $parent);
147 $this->
ctrl->setParameterByClass(ilRepositoryGUI::class,
'item_ref_id', $ref_id);
148 $this->
ctrl->setParameterByClass(ilRepositoryGUI::class,
'cmd', $cmd);
149 $this->
ctrl->redirectByClass(ilRepositoryGUI::class);
154 $tree = $this->domain->repositoryTree();
155 $obj_definition = $this->domain->objectDefinition();
157 $node = $tree->getNodeData($ref_id);
158 $gui_class =
'ilObj' . $obj_definition->getClassName($node[
'type']) .
'GUI';
159 $path = [
'ilRepositoryGUI', $gui_class, $class];
161 if ($class ==
'ilExportGUI') {
163 $this->
ctrl->getLinkTargetByClass(
$path);
165 switch ($node[
'type']) {
167 $export_cmd =
'exportList';
168 $path = [
'ilRepositoryGUI',
'ilGlossaryEditorGUI', $gui_class];
172 $export_cmd =
'export';
173 $path = [
'ilRepositoryGUI', $gui_class];
176 $this->
ctrl->setParameterByClass($gui_class,
'ref_id', $ref_id);
177 $this->
ctrl->setParameterByClass($gui_class,
'cmd', $export_cmd);
182 $this->
ctrl->setParameterByClass($class,
'ref_id', $ref_id);
183 $this->
ctrl->setParameterByClass($class,
'cmd', $cmd);
187 public function delete(
int $id):
void 199 $link = \ilLink::_getLink($id);
200 $this->
ctrl->redirectToURL($link);
229 ilPermissionGUI::class,
241 if ($this->read_only) {
243 'Cannot perform actions when in read only mode'
__construct(protected InternalDomainService $domain, protected InternalGUIService $gui, ?int $user_id=null, bool $read_only=false)
Base exception class for object service.
redirectParentCmd(int $ref_id, string $cmd)
getLabelForObjectType(string $type)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Base class for all sub item list gui's.
static getAllOwnedRepositoryObjects(int $user_id)
static getPluginObjectByType(string $type)
Return either a repoObject plugin or a orgunit extension plugin or null if the type is not a plugin...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static fixMissingTitles($type, array &$obj_title_map)
Try to fix missing object titles.
ilObjectRequestRetriever $retriever
redirectCmd(int $ref_id, string $class, ?string $cmd=null)