4 require_once
"Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php";
27 $def->setNumeric(
false);
47 if ($a_values !== null) {
48 foreach ($a_values as $idx => $value) {
49 $a_values[$idx] = trim($value);
50 if (!$a_values[$idx]) {
51 unset($a_values[$idx]);
54 $a_values = array_unique($a_values);
57 $this->options = $a_values;
78 $this->complex = $a_def[
"complex"];
84 "options" => $this->options,
85 "complex" => $this->complex
93 return array($lng->txt(
"options") => implode(
",", $this->
getOptions()));
107 $field->setRequired(
true);
108 $field->setMulti(
true);
109 $field->setMaxLength(255);
115 $field->setValue(array_shift(
$options));
119 $field->setDisabled(
true);
133 if (is_array($old)) {
134 $missing = array_diff($old, $new);
135 if (
sizeof($missing)) {
136 foreach ($missing as $item) {
137 unset($this->complex[$item]);
153 $a_writer->
xmlElement(
'FieldValue', null, $value);
159 $this->options[] = $a_value;
169 return $element->getSelection();
174 $this->
getADT()->setSelection($a_cdata);
194 if (array_key_exists($a_option, $this->complex)) {
195 $adt->importStdClass($this->complex[$a_option]);
207 include_once
"Services/AdvancedMetaData/classes/Types/class.ilAdvancedMDFieldDefinitionGroupTableGUI.php";
209 return $tbl->getHTML();
215 foreach (
$adt->getElements() as
$title => $element) {
217 $a_item[
$title] = $pres->getList();
230 $title->setValue($option);
231 $title->setDisabled(
true);
236 $adt_form->setForm($a_form);
239 foreach ($adt_form->getElements() as $id => $element) {
240 $element->setTitle($titles[$id]);
243 $adt_form->addToForm();
253 $adt_form->setForm($a_form);
254 if ($adt_form->validate()) {
255 $adt_form->importFromPost();
272 if (md5($item) == $a_id) {
getComplexOptionsOverview($a_parent_gui, string $a_parent_cmd)
getValueForXML(ilADT $element)
importValueFromXML($a_cdata)
exportOptionToTableGUI($a_option, array &$a_item)
AMD field abstract base class.
addCustomFieldToDefinitionForm(ilPropertyFormGUI $a_form, $a_disabled=false)
Add input elements to definition form.
getADT()
Get ADT instance.
static getInstance()
Get singleton.
exportStdClass()
Export value as stdClass.
importComplexOptionFromForm($a_option, ilADT $a_adt)
addPropertiesToXML(ilXmlWriter $a_writer)
getADTForOption($a_option)
Table GUI for complex AdvMD options.
updateComplexOption(ilPropertyFormGUI $a_form, $a_option_id)
importFieldDefinition(array $a_def)
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
setOptions(array $a_values=null)
Set options.
importXMLProperty($a_key, $a_value)
importCustomDefinitionFormPostValues(ilPropertyFormGUI $a_form)
Import custom post values from definition form.
getFieldDefinitionForTableGUI()
initOptionForm(ilPropertyFormGUI $a_form, $a_option_id)