32 include_once(
'Services/Table/classes/class.ilTable2GUI.php');
33 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
54 $this->permissions = $a_permissions;
55 $this->may_edit_pos = (bool)$a_may_edit_pos;
59 $this->
addColumn($this->lng->txt(
'position'),
'position',
"5%");
60 $this->
addColumn($this->lng->txt(
'title'),
'title',
"30%");
61 $this->
addColumn($this->lng->txt(
'md_adv_field_fields'),
'fields',
"35%");
62 $this->
addColumn($this->lng->txt(
'options'),
'obj_types',
"30%");
64 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
65 $this->
setRowTemplate(
"tpl.edit_fields_row.html",
"Services/AdvancedMetaData");
67 #$this->setDefaultOrderDirection("desc");
79 $this->tpl->setVariable(
'TXT_SEARCHABLE',$this->lng->txt(
'md_adv_searchable'));
80 $this->tpl->setVariable(
'ASS_ID',$a_set[
'id']);
81 if($a_set[
'searchable'])
83 $this->tpl->setVariable(
'ASS_CHECKED',
'checked="checked"');
87 $this->tpl->setVariable(
'ASS_DISABLED',
' disabled="disabled"');
90 $this->tpl->setVariable(
'VAL_POS',$a_set[
'position']);
91 if(!$this->may_edit_pos)
93 $this->tpl->setVariable(
'POS_DISABLED',
' disabled="disabled"');
96 $this->tpl->setVariable(
'VAL_ID',$a_set[
'id']);
97 $this->tpl->setVariable(
'VAL_TITLE',$a_set[
'title']);
98 if(strlen($a_set[
'description']))
100 $this->tpl->setVariable(
'VAL_DESCRIPTION',$a_set[
'description']);
103 $this->tpl->setVariable(
'FIELD_TYPE',$a_set[
'type']);
105 foreach((array)$a_set[
'properties'] as $key => $value)
107 $this->tpl->setCurrentBlock(
'field_value');
108 $this->tpl->setVariable(
'FIELD_KEY',$key);
109 $this->tpl->setVariable(
'FIELD_VAL',$value);
110 $this->tpl->parseCurrentBlock();
115 $this->ctrl->setParameter($this->parent_obj,
'field_id',$a_set[
'id']);
116 $this->tpl->setVariable(
'EDIT_LINK',$this->ctrl->getLinkTarget($this->parent_obj,
'editField'));
117 $this->tpl->setVariable(
'TXT_EDIT_RECORD',$this->lng->txt(
'edit'));
132 foreach($a_definitions as $definition)
134 $tmp_arr[
'position'] = sprintf(
"%.1f",$counter++);
135 $tmp_arr[
'id'] = $definition->getFieldId();
136 $tmp_arr[
'title'] = $definition->getTitle();
137 $tmp_arr[
'description'] = $definition->getDescription();
138 $tmp_arr[
'fields'] = array();
139 $tmp_arr[
'searchable'] = $definition->isSearchable();
140 $tmp_arr[
'type'] = $this->lng->txt($definition->getTypeTitle());
141 $tmp_arr[
'properties'] = $definition->getFieldDefinitionForTableGUI();
143 $tmp_arr[
'perm'] = $this->permissions->hasPermissions(
145 $definition->getFieldId(),
152 $defs_arr[] = $tmp_arr;
154 $this->
setData($defs_arr ? $defs_arr : array());