32 include_once(
'Services/Table/classes/class.ilTable2GUI.php');
33 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
57 $this->permissions = $a_permissions;
58 $this->may_edit_pos = (bool) $a_may_edit_pos;
60 parent::__construct($a_parent_obj, $a_parent_cmd);
62 $this->
addColumn($this->lng->txt(
'position'),
'position',
"5%");
63 $this->
addColumn($this->lng->txt(
'title'),
'title',
"30%");
64 $this->
addColumn($this->lng->txt(
'md_adv_field_fields'),
'fields',
"35%");
65 $this->
addColumn($this->lng->txt(
'options'),
'obj_types',
"30%");
67 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
68 $this->
setRowTemplate(
"tpl.edit_fields_row.html",
"Services/AdvancedMetaData");
70 #$this->setDefaultOrderDirection("desc"); 82 $this->tpl->setVariable(
'TXT_SEARCHABLE', $this->lng->txt(
'md_adv_searchable'));
83 $this->tpl->setVariable(
'ASS_ID', $a_set[
'id']);
84 if ($a_set[
'searchable']) {
85 $this->tpl->setVariable(
'ASS_CHECKED',
'checked="checked"');
88 !(
bool) $a_set[
'supports_search']) {
89 $this->tpl->setVariable(
'ASS_DISABLED',
' disabled="disabled"');
92 $this->tpl->setVariable(
'VAL_POS', $a_set[
'position']);
93 if (!$this->may_edit_pos) {
94 $this->tpl->setVariable(
'POS_DISABLED',
' disabled="disabled"');
97 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
98 $this->tpl->setVariable(
'VAL_TITLE', $a_set[
'title']);
99 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) {
106 $this->tpl->setCurrentBlock(
'field_value');
107 $this->tpl->setVariable(
'FIELD_KEY',
$key);
108 $this->tpl->setVariable(
'FIELD_VAL', $value);
109 $this->tpl->parseCurrentBlock();
113 $this->ctrl->setParameter($this->parent_obj,
'field_id', $a_set[
'id']);
114 $this->tpl->setVariable(
'EDIT_LINK', $this->ctrl->getLinkTarget($this->parent_obj,
'editField'));
115 $this->tpl->setVariable(
'TXT_EDIT_RECORD', $this->lng->txt(
'edit'));
130 foreach ($a_definitions as $definition) {
131 $tmp_arr[
'position'] = ++$counter * 10;
132 $tmp_arr[
'id'] = $definition->getFieldId();
133 $tmp_arr[
'title'] = $definition->getTitle();
134 $tmp_arr[
'description'] = $definition->getDescription();
135 $tmp_arr[
'fields'] = array();
136 $tmp_arr[
'searchable'] = $definition->isSearchable();
137 $tmp_arr[
'type'] = $this->lng->txt($definition->getTypeTitle());
138 $tmp_arr[
'properties'] = $definition->getFieldDefinitionForTableGUI();
139 $tmp_arr[
'supports_search'] = $definition->isSearchSupported();
141 $tmp_arr[
'perm'] = $this->permissions->hasPermissions(
143 $definition->getFieldId(),
151 $defs_arr[] = $tmp_arr;
153 $this->
setData($defs_arr ? $defs_arr : array());
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
const ACTION_FIELD_EDIT_PROPERTY
parseDefinitions($a_definitions)
parese field data
const SUBACTION_FIELD_SEARCHABLE
Advanced metadata permission helper.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
__construct($a_parent_obj, $a_parent_cmd='', ilAdvancedMDPermissionHelper $a_permissions, $a_may_edit_pos)
Constructor.