3require_once
"Services/ADT/classes/Bridges/class.ilADTSearchBridgeMulti.php";
15 $this->search_mode = (int)$a_mode;
26 if($a_adt_def->
getType() ==
"Enum")
28 $this->multi_source =
false;
30 $def->setNumeric($a_adt_def->isNumeric());
31 $def->setOptions($a_adt_def->getOptions());
36 $this->multi_source =
true;
46 $this->
getADT()->setSelections($value);
57 $def = $this->
getADT()->getCopyOfDefinition();
63 $cbox->setValue($this->
getADT()->getSelections());
65 foreach(
$options as $value => $caption)
68 $cbox->addOption($option);
83 $item->setValue($post);
85 else if(array_key_exists($this->
getElementId(), $this->table_filter_fields))
87 $this->table_filter_fields[$this->
getElementId()]->setValue($post);
93 $this->
getADT()->setSelections($post);
98 $this->
getADT()->setSelections();
115 if($this->multi_source)
117 include_once
"Services/ADT/classes/Types/MultiEnum/class.ilADTMultiEnumDBBridge.php";
125 foreach($this->
getADT()->getSelections() as $item)
127 $item =
"%".ilADTMultiEnumDBBridge::SEPARATOR.
130 $parts[] =
$ilDB->like($a_element_id,
"text", $item,
false);
132 return "(".implode($mode_concat, $parts).
")";
135 return $ilDB->in($a_element_id, $this->
getADT()->getSelections(),
"", $type);
141 $current = $this->
getADT()->getSelections();
142 if(is_array($current) &&
146 if($this->search_mode == self::SEARCH_MODE_ANY)
150 if(in_array($value, $current))
159 return !(bool)
sizeof(array_diff($current, (array)$a_adt->
getSelections()));
172 return serialize($this->
getADT()->getSelections());
178 $a_value = unserialize($a_value);
179 if(is_array($a_value))
181 $this->
getADT()->setSelections($a_value);
ADT definition base class.
getType()
Get type (from class/instance)
getSerializedValue()
Get current value(s) in serialized form (for easy persisting)
addToForm()
Add ADT-specific fields to form.
isInCondition(ilADTMultiEnum $a_adt)
getSQLCondition($a_element_id)
Get SQL condition for current value(s)
setSerializedValue($a_value)
Set current value(s) in serialized form (for easy persisting)
convertADTDefinitionToMulti(ilADTDefinition $a_adt_def)
Convert definition to multi version.
isValidADTDefinition(ilADTDefinition $a_adt_def)
Check if given ADT definition is valid.
importFromPost(array $a_post=null)
Import values from (search) form request POST data.
loadFilter()
Load filter value(s) into ADT.
static getInstance()
Get singleton.
readFilter()
Load value(s) from filter store (in session)
extractPostValues(array $a_post=null)
Extract data from (post) values.
addToParentElement(ilFormPropertyGUI $a_field)
Add form field to parent element.
getElementId()
Get element id.
shouldBeImportedFromPost($a_post)
Check if incoming values should be imported at all.
writeFilter($a_value=null)
Write value(s) to filter store (in session)
This class represents an option in a checkbox group.
if(!is_array($argv)) $options