20 declare(strict_types=1);
    41         $this->
http = $DIC->http();
    43         $this->table_id = $this->
http->wrapper()->query()->retrieve(
'table_id', $this->
refinery->kindlyTo()->int());
    44         $locator = $DIC[
'ilLocator'];
    45         $this->parent_obj = $a_parent_obj;
    46         $this->obj_id = $a_parent_obj->
getObjId();
    47         $this->
ctrl = $DIC->ctrl();
    48         $this->
lng = $DIC->language();
    49         $this->tpl = $DIC->ui()->mainTemplate();
    50         $this->
tabs = $DIC->tabs();
    51         $this->
toolbar = $DIC->toolbar();
    52         $this->ui_factory = $DIC->ui()->factory();
    53         $this->renderer = $DIC->ui()->renderer();
    55         $DIC->help()->setScreenId(
'dcl_fields');
    57         $this->
ctrl->saveParameterByClass(ilDclTableEditGUI::class, 
'table_id');
    60             $this->
ctrl->getLinkTargetByClass(ilDclTableEditGUI::class, 
'edit')
    62         $this->tpl->setLocator();
    65             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'), 
true);
    66             $this->
ctrl->redirectByClass(ilDclRecordListGUI::class, 
'listRecords');
    80         $cmd = $this->
ctrl->getCmd(
'listFields');
    89         if ($this->
http->wrapper()->post()->has(
'dcl_field_ids')) {
    90             $field_ids = $this->
http->wrapper()->post()->retrieve(
    95             foreach ($field_ids as $field_id) {
    96                 $table->deleteField($field_id);
   100         $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'dcl_msg_fields_deleted'), 
true);
   101         $this->
ctrl->redirect($this, 
'listFields');
   107     public function confirmDeleteFields(): 
void   109         $this->
tabs->clearSubTabs();
   111         $conf->setFormAction($this->
ctrl->getFormAction($this));
   112         $conf->setHeaderText($this->
lng->txt(
'dcl_confirm_delete_fields'));
   114         $has_field_ids = $this->
http->wrapper()->post()->has(
'dcl_field_ids');
   115         if (!$has_field_ids) {
   116             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'dcl_delete_fields_no_selection'), 
true);
   117             $this->
ctrl->redirect($this, 
'listFields');
   120         $field_ids = $this->
http->wrapper()->post()->retrieve(
   124         foreach ($field_ids as $field_id) {
   127             $conf->addItem(
'dcl_field_ids[]', (
string) $field_id, $field->getTitle());
   130         $conf->setConfirm($this->
lng->txt(
'delete'), 
'deleteFields');
   131         $conf->setCancel($this->
lng->txt(
'cancel'), 
'listFields');
   132         $this->tpl->setContent($conf->getHTML());
   140         $table_id = $this->
http->wrapper()->query()->retrieve(
'table_id', $this->
refinery->kindlyTo()->int());
   143         $fields = $table->getFields();
   145         $order = $this->
http->wrapper()->post()->retrieve(
   151         foreach (array_keys($order) as $field_id) {
   152             $order[$field_id] = $val;
   157         if ($this->
http->wrapper()->post()->has(
"exportable")) {
   158             $exportable = $this->
http->wrapper()->post()->retrieve(
   160                 $this->
refinery->kindlyTo()->dictOf(
   161                     $this->
refinery->kindlyTo()->string()
   166         foreach ($fields as $field) {
   167             $field->setExportable(array_key_exists($field->getId(), $exportable) && $exportable[$field->getId()] === 
"on");
   168             $field->setOrder($order[$field->getId()]);
   172         $table->reloadFields();
   173         $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"dcl_table_settings_saved"));
   183         $add_new = $this->ui_factory->button()->primary(
   184             $this->
lng->txt(
"dcl_add_new_field"),
   185             $this->
ctrl->getLinkTargetByClass(ilDclFieldEditGUI::class, 
'create')
   187         $this->
toolbar->addStickyItem($add_new);
   190         $switcher->addTableSwitcherToToolbar(
   191             $this->parent_obj->getDataCollectionObject()->getTables(),
   198         $this->tpl->setContent($list->getHTML());
   210         return $this->parent_obj->getDataCollectionObject();
 ILIAS HTTP Services $http
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static getFieldCache(int $field_id=0)
 
ilDclTableListGUI: ilDclFieldListGUI, ilDclFieldEditGUI, ilDclTableViewGUI, ilDclTableEditGUI ...
 
ilGlobalTemplateInterface $tpl
 
getDataCollectionObject()
 
static http()
Fetches the global http state from ILIAS. 
 
static getTableCache(int $table_id=null)
 
deleteFields()
Delete multiple fields. 
 
ILIAS UI Factory $ui_factory
 
executeCommand()
execute command 
 
ilDclTableListGUI $parent_obj
 
static hasAccessToEditTable(int $ref_id, int $table_id)
 
ILIAS Refinery Factory $refinery
 
ILIAS UI Renderer $renderer
 
__construct(ilDclTableListGUI $a_parent_obj)