4 require_once
"Services/AdvancedMetaData/classes/Types/class.ilAdvancedMDFieldDefinitionSelect.php";
24 return self::TYPE_SELECT_MULTI;
35 $def->setNumeric(
false);
56 $missing = array_diff($old, $new);
57 if (
sizeof($missing)) {
59 if (!is_array($this->confirmed_objects)) {
63 foreach ($missing as $missing_value) {
65 if (
sizeof($in_use)) {
66 foreach ($in_use as $item) {
67 $this->confirm_objects[$missing_value][] = $item;
74 $this->old_options = $old;
82 $a_search->
getADT()->setSelections(array($a_value));
92 foreach ($in_use as $item) {
93 $res[] = array($item[
"obj_id"], $item[
"sub_type"], $item[
"sub_id"], $item[
"value"]);
107 if (is_array($this->confirmed_objects) && count($this->confirmed_objects) > 0) {
111 $def->setOptions(array_combine($this->old_options, $this->old_options));
115 foreach ($this->confirmed_objects as $old_option => $item_ids) {
117 $old_values = array();
119 $old_values[$item[0] .
"_" . $item[1] .
"_" . $item[2]] = $item[3];
122 foreach ($item_ids as $item => $new_option) {
123 $parts = explode(
"_", $item);
125 $sub_type = $parts[1];
129 if (isset($old_values[$item])) {
133 array_shift($old_value);
134 array_pop($old_value);
136 $old_idx = array_keys($old_value, $old_option);
137 if (
sizeof($old_idx)) {
138 $old_idx = array_pop($old_idx);
142 $old_value[$old_idx] = $new_option;
146 unset($old_value[$old_idx]);
148 $new_value = array_unique($old_value);
151 "obj_id" => array(
"integer", $obj_id),
152 "sub_type" => array(
"text", $sub_type),
153 "sub_id" => array(
"integer", $sub_id),
154 "field_id" => array(
"integer", $this->
getFieldId())
158 if (
sizeof($new_value)) {
173 if ($sub_type ==
"wpg") {
175 include_once
"Modules/Wiki/classes/class.ilPCAMDPageList.php";
181 $this->confirmed_objects = array();
194 return self::XML_SEPARATOR .
195 implode(self::XML_SEPARATOR, $element->getSelections()) .
201 $this->
getADT()->setSelections(explode(self::XML_SEPARATOR, $a_cdata));
213 $a_enum->setAutoSort(
false);
findBySingleValue(ilADTEnumSearchBridgeMulti $a_search, $a_value)
getADTDefinition()
Get ADT definition instance.
static initActiveRecordByType()
Init active record by type.
getADT()
Get ADT instance.
static writeByPrimary($a_table, array $a_primary, $a_type, $a_value)
Write directly.
importValueFromXML($a_cdata)
static getInstance()
Get singleton.
importCustomDefinitionFormPostValues(ilPropertyFormGUI $a_form)
static find($a_table, $a_type, $a_field_id, $a_condition, $a_additional_fields=null)
Find entries.
foreach($_POST as $key=> $value) $res
static deleteByPrimary($a_table, array $a_primary, $a_type=null)
Delete values by (partial) primary key.
getSQLCondition($a_element_id)
setOptions(array $a_values=null)
Set options.
static migrateField($a_obj_id, $a_field_id, $old_option, $new_option, $a_is_multi=false)
Migrate search/filter values on advmd change.
update($pash, $contents, Config $config)
getValueForXML(ilADT $element)
prepareElementForEditor(ilADTFormBridge $a_enum)
getFieldId()
Get field_id.
buildConfirmedObjects(ilPropertyFormGUI $a_form)
Process custom post values from definition form.