13 include_once(
'Services/Table/classes/class.ilTable2GUI.php');
14 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
35 $this->permissions = $a_permissions;
37 parent::__construct($a_parent_obj,$a_parent_cmd);
39 $this->
addColumn($this->lng->txt(
'title'),
'title');
40 $this->
addColumn($this->lng->txt(
'md_fields'),
'fields');
41 $this->
addColumn($this->lng->txt(
'md_adv_active'),
'active');
42 $this->
addColumn($this->lng->txt(
'md_obj_types'),
'obj_types');
44 $this->
addColumn($this->lng->txt(
'actions'));
46 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
47 $this->
setRowTemplate(
"tpl.show_records_row.html",
"Services/AdvancedMetaData");
64 0 => $this->lng->txt(
"meta_obj_type_inactive"),
65 1 => $this->lng->txt(
"meta_obj_type_mandatory"),
66 2 => $this->lng->txt(
"meta_obj_type_optional")
69 $do_select = (!$a_set[
"readonly"] && !$a_set[
"local"]);
73 foreach ($a_set[
'obj_types'] as
$t)
75 if ($obj_type[
"obj_type"] == $t[
"obj_type"] &&
76 $obj_type[
"sub_type"] == $t[
"sub_type"])
81 $obj_type[
"text"] =
'<span class="il_ItemAlertProperty">'.$obj_type[
"text"].
'</span>';
84 $value = $t[
"optional"]
91 if(!$do_select && !$value)
96 $this->tpl->setCurrentBlock(
'ass_obj_types');
97 $this->tpl->setVariable(
'VAL_OBJ_TYPE', $obj_type[
"text"]);
102 switch($obj_type[
"obj_type"])
106 unset($type_options[1]);
110 unset($type_options[1]);
114 unset($type_options[2]);
119 "obj_types[".$a_set[
'id'].
"][".$obj_type[
"obj_type"].
":".$obj_type[
"sub_type"].
"]",
125 array(
"style"=>
"min-width:125px"),
128 $this->tpl->setVariable(
'VAL_OBJ_TYPE_STATUS', $select);
131 $this->tpl->parseCurrentBlock();
134 if($a_set[
"readonly"] && !$a_set[
"local"])
136 $a_set[
'description'] .=
' <span class="il_ItemAlertProperty">'.$this->lng->txt(
"meta_global").
'</span>';
139 if(!$a_set[
"readonly"] || $a_set[
"local"])
141 $this->tpl->setVariable(
'VAL_ID',$a_set[
'id']);
144 $this->tpl->setVariable(
'VAL_TITLE',$a_set[
'title']);
145 if(strlen($a_set[
'description']))
147 $this->tpl->setVariable(
'VAL_DESCRIPTION',$a_set[
'description']);
152 $this->tpl->setVariable(
'TXT_FIELDS',$this->lng->txt(
'md_adv_no_fields'));
154 foreach($defs as $definition_obj)
156 $this->tpl->setCurrentBlock(
'field_entry');
157 $this->tpl->setVariable(
'FIELD_NAME',$definition_obj->getTitle().
158 ": ".$this->lng->txt($definition_obj->getTypeTitle()));
159 $this->tpl->parseCurrentBlock();
162 $this->tpl->setVariable(
'ACTIVE_CHECKED',$a_set[
'active'] ?
' checked="checked" ' :
'');
163 $this->tpl->setVariable(
'ACTIVE_ID',$a_set[
'id']);
165 if(($a_set[
"readonly"] && !$a_set[
"optional"]) ||
168 $this->tpl->setVariable(
'ACTIVE_DISABLED',
'disabled="disabled"');
171 if(!$a_set[
"readonly"])
173 $this->ctrl->setParameter($this->parent_obj,
'record_id',$a_set[
'id']);
177 $this->tpl->setVariable(
'EDIT_LINK',$this->ctrl->getLinkTarget($this->parent_obj,
'editRecord'));
178 $this->tpl->setVariable(
'TXT_EDIT_RECORD',$this->lng->txt(
'edit'));
182 $this->tpl->setVariable(
'EDIT_FIELDS_LINK',$this->ctrl->getLinkTarget($this->parent_obj,
'editFields'));
183 $this->tpl->setVariable(
'TXT_EDIT_FIELDS',$this->lng->txt(
'md_adv_field_table'));
const ACTION_RECORD_EDIT_PROPERTY
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
Advanced metadata permission helper.
static getInstancesByRecordId($a_record_id, $a_only_searchable=false)
Get definitions by record id.
if(!is_array($argv)) $options
const SUBACTION_RECORD_OBJECT_TYPES
static formSelect($selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
const ACTION_RECORD_TOGGLE_ACTIVATION
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
const ACTION_RECORD_EDIT_FIELDS
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
static _getAssignableObjectTypes($a_include_text=false)
Get assignable object type.
__construct($a_parent_obj, $a_parent_cmd='', ilAdvancedMDPermissionHelper $a_permissions, $a_in_object_context=false)
Constructor.
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.