41 $main_tpl = $DIC->ui()->mainTemplate();
42 $ilCtrl = $DIC[
'ilCtrl'];
45 $ilTabs = $DIC[
'ilTabs'];
46 $ilToolbar = $DIC[
'ilToolbar'];
48 $this->parent_obj = $a_parent_obj;
50 if ($a_parent_obj->
getRefId() >= 0) {
54 $this->
ctrl = $ilCtrl;
57 $this->
tabs = $ilTabs;
59 $this->
http = $DIC->http();
63 $main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
64 $this->ctrl->redirectByClass(
'ildclrecordlistgui',
'listRecords');
70 return $this->parent_obj->getObjectId();
75 return $this->parent_obj->getRefId();
84 $cmd = $this->
ctrl->getCmd(
'listTables');
86 $next_class = $this->
ctrl->getNextClass($this);
91 $ref_id = $this->
http->wrapper()->query()->retrieve(
'ref_id', $this->
refinery->kindlyTo()->int());
96 $DIC->rbac()->review(),
103 if (count($role_titles) > 0) {
104 $this->tpl->setOnScreenMessage(
106 $DIC->language()->txt(
'dcl_rbac_roles_without_read_access_on_any_standard_view') .
" " . implode(
113 switch ($next_class) {
114 case 'ildcltableeditgui':
115 $this->
tabs->clearTargets();
116 if ($cmd !=
'create') {
119 $this->
tabs->setBackTarget(
120 $this->
lng->txt(
'back'),
121 $this->
ctrl->getLinkTarget($this,
'listTables')
125 $this->
ctrl->forwardCommand($ilDclTableEditGUI);
128 case 'ildclfieldlistgui':
129 $this->
tabs->clearTargets();
132 $this->
ctrl->forwardCommand($ilDclFieldListGUI);
135 case "ildclfieldeditgui":
136 $this->
tabs->clearTargets();
139 $this->
ctrl->forwardCommand($ilDclFieldEditGUI);
142 case 'ildcltableviewgui':
143 $this->
tabs->clearTargets();
146 $this->
ctrl->forwardCommand($ilDclTableViewGUI);
157 $add_new->setPrimary(
true);
158 $add_new->setCaption(
"dcl_add_new_table");
159 $add_new->setUrl($this->
ctrl->getLinkTargetByClass(
'ilDclTableEditGUI',
'create'));
160 $this->
toolbar->addStickyItem($add_new);
163 $this->tpl->setContent($table_gui->getHTML());
166 protected function setTabs(
string $active): void
168 $this->
tabs->setBackTarget($this->
lng->txt(
'dcl_tables'), $this->
ctrl->getLinkTarget($this,
'listTables'));
171 $this->
lng->txt(
'settings'),
172 $this->
ctrl->getLinkTargetByClass(
'ilDclTableEditGUI',
'edit')
176 $this->
lng->txt(
'dcl_list_fields'),
177 $this->
ctrl->getLinkTargetByClass(
'ilDclFieldListGUI',
'listFields')
181 $this->
lng->txt(
'dcl_tableviews'),
182 $this->
ctrl->getLinkTargetByClass(
'ilDclTableViewGUI')
184 $this->
tabs->activateTab($active);
187 protected function save(): void
189 if ($this->
http->wrapper()->post()->has(
"comments")) {
195 if ($this->
http->wrapper()->post()->has(
"visible")) {
196 $visible = $this->
http->wrapper()->post()->retrieve(
201 $orders = $this->
http->wrapper()->post()->retrieve(
207 foreach (array_keys($orders) as $table_id) {
209 $table->setOrder($order);
210 $table->setPublicCommentsEnabled(isset(
$comments[$table_id]));
211 $table->setIsVisible(isset($visible[$table_id]));
215 $this->
ctrl->redirect($this);
222 $has_dcl_table_ids = $this->
http->wrapper()->post()->has(
'dcl_table_ids');
223 if (!$has_dcl_table_ids) {
224 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'dcl_delete_tables_no_selection'),
true);
225 $this->
ctrl->redirect($this,
'listTables');
228 $tables = $this->
http->wrapper()->post()->retrieve(
234 $this->
tabs->clearSubTabs();
236 $conf->setFormAction($this->
ctrl->getFormAction($this));
237 $conf->setHeaderText($this->
lng->txt(
'dcl_tables_confirm_delete'));
239 foreach ($tables as $table_id) {
242 $conf->setConfirm($this->
lng->txt(
'delete'),
'deleteTables');
243 $conf->setCancel($this->
lng->txt(
'cancel'),
'listTables');
244 $this->tpl->setContent($conf->getHTML());
249 $has_dcl_table_ids = $this->
http->wrapper()->post()->has(
'dcl_table_ids');
250 if ($has_dcl_table_ids) {
251 $tables = $this->
http->wrapper()->post()->retrieve(
255 foreach ($tables as $table_id) {
259 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'dcl_msg_tables_deleted'),
true);
260 $this->
ctrl->clearParameterByClass(
"ilobjdatacollectiongui",
"table_id");
261 $this->
ctrl->redirect($this,
'listTables');
271 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'dcl_msg_tables_delete_all'),
true);
272 $this->
ctrl->redirect($this,
'listTables');
278 $ref_id = $this->parent_obj->getRefId();
285 return $this->parent_obj->getDataCollectionObject();
ilObjDataCollectionGUI $parent_obj
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkTablesLeft(int $delete_count)
redirects if there are no tableviews left after deletion of {$delete_count} tableviews ...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getDataCollectionObject()
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...
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...
__construct(ilObjDataCollectionGUI $a_parent_obj)
ilDclTableListGUI constructor.
static http()
Fetches the global http state from ILIAS.
executeCommand()
execute command
static getTableCache(int $table_id=null)
getRoleTitlesWithoutReadRightOnAnyStandardView()
static _lookupObjectId(int $ref_id)
static hasWriteAccess(int $ref, ?int $user_id=0)
ILIAS Refinery Factory $refinery
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS HTTP Services $http
ilGlobalPageTemplate $tpl
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...