5 require_once(
"./Modules/DataCollection/classes/class.ilDataCollectionRecordListViewdefinition.php");
25 $this->main_table_id = $a_parent_obj->object->getMainTableId();
26 $this->table_id = $table_id;
27 $this->obj_id = $a_parent_obj->obj_id;
37 $this->view_obj->setTableId($table_id);
50 $cmd = $ilCtrl->getCmd();
76 $this->getFormValues();
78 $tpl->setContent($this->form->getHTML());
90 require_once(
"./Modules/DataCollection/classes/class.ilDataCollectionTable.php");
92 foreach($arrTables as $table)
94 $options[$table[
'id']] = $table[
'title'];
96 include_once
'./Services/Form/classes/class.ilSelectInputGUI.php';
101 $table_selection->setOptions(
$options);
102 $table_selection->setValue($this->table_id);
103 $ilToolbar->setFormAction($ilCtrl->getFormActionByClass(
"ilDataCollectionRecordListViewdefinitionGUI",
"doTableSwitch"));
104 $ilToolbar->addInputItem($table_selection);
105 $ilToolbar->addFormButton($lng->txt(
'change'),
'doTableSwitch');
108 require_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
111 $this->form->setFormAction($ilCtrl->getFormAction($this),
"save");
112 $this->form->addCommandButton(
'save', $lng->txt(
'dcl_listviewdefinition_update'));
113 $this->form->addCommandButton(
'cancel', $lng->txt(
'cancel'));
117 $hidden_prop->setValue($this->table_id);
118 $this->form->addItem($hidden_prop);
121 require_once(
"./Modules/DataCollection/classes/class.ilDataCollectionField.php");
122 $fields = ilDataCollectionField::getAll($this->table_id);
124 $tabledefinition = array(
125 "id" => array(
"title" => $lng->txt(
"id")),
126 "table_id" => array(
"title" => $lng->txt(
"dcl_table_id")),
127 "create_date" => array(
"title" => $lng->txt(
"create_date")),
128 "last_update" => array(
"title" => $lng->txt(
"last_update")),
129 "owner" => array(
"title" => $lng->txt(
"owner"))
133 foreach($fields as $key => $value)
135 $tabledefinition[$key] = $value;
138 foreach($tabledefinition as $key => $field)
141 $chk_prop->setOptionTitle($lng->txt(
'visible'));
143 $text_prop =
new ilTextInputGUI($lng->txt(
'dcl_field_ordering'),
'order_'.$key);
146 $this->form->addItem($chk_prop);
149 $this->form->setTitle($lng->txt(
'dcl_view_viewdefinition'));
158 public function save($a_mode =
"create")
164 if($this->form->checkInput())
167 require_once(
"./Modules/DataCollection/classes/class.ilDataCollectionField.php");
168 $fields = ilDataCollectionField::getAll($this->table_id);
171 $tabledefinition = array(
172 "id" => array(
"title" => $lng->txt(
"id")),
173 "table_id" => array(
"title" => $lng->txt(
"dcl_table_id")),
174 "create_date" => array(
"title" => $lng->txt(
"create_date")),
175 "last_update" => array(
"title" => $lng->txt(
"last_update")),
176 "owner" => array(
"title" => $lng->txt(
"owner"))
179 foreach($fields as $key => $value)
181 $tabledefinition[$key] = $value;
184 foreach($tabledefinition as $key => $field)
186 if($this->form->getInput(
"visible_".$key))
188 $this->view_obj->setArrFieldOrder($this->form->getInput(
"order_".$key),$key);
192 $this->view_obj->doCreate();
196 $ilCtrl->redirect($this,
"edit");
201 $this->form_gui->setValuesByPost();
202 $this->tpl->setContent($this->form_gui->getHTML());
215 $ilCtrl->setParameterByClass(
"ilObjDataCollectionGUI",
"table_id",
$_POST[
'table_id']);
216 $ilCtrl->redirect($this,
"edit");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilDataCollectionField.
__construct($a_parent_obj, $table_id)
getAll($a_id)
get all tables of a Data Collection Object
save($a_mode="create")
saveRecordListViewdefinition
executeCommand()
execute command
edit()
createRecordListViewdefinition
Class ilDataCollectionField.
if(!is_array($argv)) $options
initForm()
initRecordListViewdefinitionForm
This class represents a text property in a property form.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
doTableSwitch()
doTableSwitch