32 include_once(
'Services/Table/classes/class.ilTable2GUI.php');
33 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
54 $this->
addColumn($this->lng->txt(
'position'),
'position',
"5%");
55 $this->
addColumn($this->lng->txt(
'title'),
'title',
"30%");
56 $this->
addColumn($this->lng->txt(
'md_adv_field_fields'),
'fields',
"35%");
57 $this->
addColumn($this->lng->txt(
'options'),
'obj_types',
"30%");
59 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
60 $this->
setRowTemplate(
"tpl.edit_fields_row.html",
"Services/AdvancedMetaData");
62 #$this->setDefaultOrderDirection("desc");
74 $this->tpl->setVariable(
'TXT_SEARCHABLE',$this->lng->txt(
'md_adv_searchable'));
75 $this->tpl->setVariable(
'ASS_ID',$a_set[
'id']);
76 if($a_set[
'searchable'])
78 $this->tpl->setVariable(
'ASS_CHECKED',
'checked="checked"');
80 $this->tpl->setVariable(
'VAL_POS',$a_set[
'position']);
82 $this->tpl->setVariable(
'VAL_ID',$a_set[
'id']);
83 $this->tpl->setVariable(
'VAL_TITLE',$a_set[
'title']);
84 if(strlen($a_set[
'description']))
86 $this->tpl->setVariable(
'VAL_DESCRIPTION',$a_set[
'description']);
89 foreach($a_set[
'values'] as $value)
91 $this->tpl->setCurrentBlock(
'field_value');
92 $this->tpl->setVariable(
'FIELD_VAL',$value);
93 $this->tpl->parseCurrentBlock();
95 if(count($a_set[
'values']))
97 # $this->tpl->setCurrentBlock('field_select');
98 # $this->tpl->parseCurrentBlock();
100 switch($a_set[
'type'])
103 $this->tpl->setVariable(
'FIELD_TYPE',$this->lng->txt(
'udf_type_text'));
107 $this->tpl->setVariable(
'FIELD_TYPE',$this->lng->txt(
'udf_type_select'));
111 $this->tpl->setVariable(
'FIELD_TYPE',$this->lng->txt(
'udf_type_date'));
115 $this->tpl->setVariable(
'FIELD_TYPE',$this->lng->txt(
'udf_type_datetime'));
118 $this->ctrl->setParameter($this->parent_obj,
'field_id',$a_set[
'id']);
119 $this->tpl->setVariable(
'EDIT_LINK',$this->ctrl->getLinkTarget($this->parent_obj,
'editField'));
120 $this->tpl->setVariable(
'TXT_EDIT_RECORD',$this->lng->txt(
'edit'));
134 foreach($a_definitions as $definition)
136 $tmp_arr[
'position'] = sprintf(
"%.1f",$counter++);
137 $tmp_arr[
'id'] = $definition->getFieldId();
138 $tmp_arr[
'title'] = $definition->getTitle();
139 $tmp_arr[
'description'] = $definition->getDescription();
140 $tmp_arr[
'fields'] = array();
141 $tmp_arr[
'searchable'] = $definition->isSearchable();
142 $tmp_arr[
'type'] = $definition->getFieldType();
143 $tmp_arr[
'values'] = $definition->getFieldValues();
145 $defs_arr[] = $tmp_arr;
147 $this->
setData($defs_arr ? $defs_arr : array());