/** * initRecordListViewdefinitionForm * */ public function initForm() { global $lng, $ilCtrl, $ilToolbar; // Show tables require_once "./Modules/DataCollection/classes/class.ilDataCollectionTable.php"; $arrTables = ilDataCollectionTable::getAll($this->obj_id); foreach ($arrTables as $table) { $options[$table['id']] = $table['title']; } include_once './Services/Form/classes/class.ilSelectInputGUI.php'; $table_selection = new ilSelectInputGUI('', 'table_id'); $table_selection->setOptions($options); $table_selection->setValue($this->table_id); $ilToolbar->setFormAction($ilCtrl->getFormActionByClass("ilDataCollectionRecordListViewdefinitionGUI", "doTableSwitch")); $ilToolbar->addInputItem($table_selection); $ilToolbar->addFormButton($lng->txt('change'), 'doTableSwitch'); // Form require_once "./Services/Form/classes/class.ilPropertyFormGUI.php"; $this->form = new ilPropertyFormGUI(); $this->form->setFormAction($ilCtrl->getFormAction($this), "save"); $this->form->addCommandButton('save', $lng->txt('dcl_listviewdefinition_update')); $this->form->addCommandButton('cancel', $lng->txt('cancel')); //Table-ID $hidden_prop = new ilHiddenInputGUI("table_id"); $hidden_prop->setValue($this->table_id); $this->form->addItem($hidden_prop); //Get fields require_once "./Modules/DataCollection/classes/class.ilDataCollectionField.php"; $fields = ilDataCollectionField::getAll($this->table_id); $tabledefinition = array("id" => array("title" => $lng->txt("id")), "table_id" => array("title" => $lng->txt("dcl_table_id")), "create_date" => array("title" => $lng->txt("create_date")), "last_update" => array("title" => $lng->txt("last_update")), "owner" => array("title" => $lng->txt("owner"))); //Array zusammenführen foreach ($fields as $key => $value) { $tabledefinition[$key] = $value; } foreach ($tabledefinition as $key => $field) { $chk_prop = new ilCheckboxInputGUI($field['title'], 'visible_' . $key); $chk_prop->setOptionTitle($lng->txt('visible')); $text_prop = new ilTextInputGUI($lng->txt('dcl_field_ordering'), 'order_' . $key); $chk_prop->addSubItem($text_prop); $this->form->addItem($chk_prop); } $this->form->setTitle($lng->txt('dcl_view_viewdefinition')); }