4 require_once
"Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php";
38 $def->setNumeric(
false);
58 if($a_values !== null)
60 foreach($a_values as $idx => $value)
62 $a_values[$idx] = trim($value);
65 unset($a_values[$idx]);
68 $a_values = array_unique($a_values);
71 $this->options = $a_values;
103 return array($lng->txt(
"options") => implode(
",", $this->
getOptions()));
118 $field->setMulti(
true);
119 $field->setMaxLength(255);
126 $field->setValue(array_shift(
$options));
131 $field->setDisabled(
true);
143 $recipes = $a_form->
getInput(
"conf_det");
147 $sum = $a_form->
getInput(
"conf_det_act");
153 foreach($recipes as $old_option => $recipe)
155 $sum_act = $sum[$old_option];
156 $sgl_act = $sgl[$old_option];
160 foreach(array_keys($sgl_act) as $obj_idx)
162 $res[$old_option][$obj_idx] = $sum_act;
167 $res[$old_option] = $sgl_act;
185 $missing = array_diff($old, $new);
189 if(!is_array($this->confirmed_objects))
193 "field_id" => array(
"integer", $this->
getFieldId()),
199 $this->confirm_objects = array();
200 foreach($in_use as $item)
218 global
$lng, $objDefinition;
222 if(
sizeof($this->confirm_objects))
224 $new_options = $a_form->
getInput(
"opts");
227 $sec->setTitle($lng->txt(
"md_adv_confirm_definition_select_section"));
230 foreach($this->confirm_objects as $old_option => $items)
232 $details =
new ilRadioGroupInputGUI($lng->txt(
"md_adv_confirm_definition_select_option").
': "'.$old_option.
'"',
"conf_det[".$this->getFieldId().
"][".$old_option.
"]");
233 $details->setRequired(
true);
234 $details->setValue(
"sum");
237 $sum =
new ilRadioOption($lng->txt(
"md_adv_confirm_definition_select_option_all"),
"sum");
238 $details->addOption($sum);
240 $sel =
new ilSelectInputGUI($lng->txt(
"md_adv_confirm_definition_select_option_all_action"),
241 "conf_det_act[".$this->getFieldId().
"][".$old_option.
"]");
242 $options = array(
""=>$lng->txt(
"md_adv_confirm_definition_select_option_remove"));
243 foreach($new_options as $new_option)
245 $options[$new_option] = $lng->txt(
"md_adv_confirm_definition_select_option_overwrite").
': "'.$new_option.
'"';
248 $sum->addSubItem($sel);
250 $single =
new ilRadioOption($lng->txt(
"md_adv_confirm_definition_select_option_single"),
"sgl");
251 $details->addOption($single);
253 foreach($items as $item)
256 $sub_type = $item[1];
259 $item_id = $obj_id.
"_".$sub_type.
"_".$sub_id;
262 $type_title = $lng->txt(
"obj_".$type);
263 $title =
' "'.ilObject::_lookupTitle($obj_id).
'"';
267 $class =
"ilObj".$objDefinition->getClassName($type);
268 $class_path = $objDefinition->getLocation($type);
269 include_once $class_path.
"/class.".$class.
".php";
270 if(class_implements($class, ilAdvancedMetaDataSubItem))
272 $sub_title = $class::getAdvMDSubItemTitle($obj_id, $sub_type, $sub_id);
275 $title .=
' ('.$sub_title.
')';
281 "conf[".$this->getFieldId().
"][".$old_option.
"][".$item_id.
"]");
282 $options = array(
""=>$lng->txt(
"md_adv_confirm_definition_select_option_remove"));
283 foreach($new_options as $new_option)
285 $options[$new_option] = $lng->txt(
"md_adv_confirm_definition_select_option_overwrite").
': "'.$new_option.
'"';
289 $single->addSubItem($sel);
306 if(
sizeof($this->confirmed_objects))
309 foreach($this->confirmed_objects as $old_option => $item_ids)
311 foreach($item_ids as $item => $new_option)
313 $item = explode(
"_", $item);
315 $sub_type = $item[1];
322 "obj_id" => array(
"integer", $obj_id),
323 "sub_type" => array(
"text", $sub_type),
324 "sub_id" => array(
"integer", $sub_id),
325 "field_id" => array(
"integer", $this->
getFieldId())
333 "obj_id" => array(
"integer", $obj_id),
334 "sub_type" => array(
"text", $sub_type),
335 "sub_id" => array(
"integer", $sub_id),
336 "field_id" => array(
"integer", $this->
getFieldId())
341 if($sub_type ==
"wpg")
344 include_once
"Modules/Wiki/classes/class.ilPCAMDPageList.php";
361 $a_writer->
xmlElement(
'FieldValue',null,$value);
367 $this->options[] = $a_value;
377 return $element->getSelection();
382 $this->
getADT()->setSelection($a_cdata);