4require_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(
"meta_advmd_select_options") => implode(
",", $this->
getOptions()));              
 
  117                $field->setRequired(
true);
 
  118                $field->setMulti(
true, 
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);
 
  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);
 
  304                if(
sizeof($this->confirmed_objects))
 
  307                        foreach($this->confirmed_objects as $old_option => $item_ids)
 
  309                                foreach($item_ids as $item => $new_option)
 
  311                                        $item = explode(
"_", $item);
 
  313                                        $sub_type = $item[1];
 
  320                                                        "obj_id" => array(
"integer", $obj_id),
 
  321                                                        "sub_type" => array(
"text", $sub_type),
 
  322                                                        "sub_id" => array(
"integer", $sub_id),
 
  323                                                        "field_id" => array(
"integer", $this->
getFieldId())
 
  331                                                        "obj_id" => array(
"integer", $obj_id),
 
  332                                                        "sub_type" => array(
"text", $sub_type),
 
  333                                                        "sub_id" => array(
"integer", $sub_id),
 
  334                                                        "field_id" => array(
"integer", $this->
getFieldId())
 
  339                                        if($sub_type == 
"wpg")
 
  342                                                include_once 
"Modules/Wiki/classes/class.ilPCAMDPageList.php";
 
  359                        $a_writer->
xmlElement(
'FieldValue',
null,$value);                        
 
  365                $this->options[] = $a_value;
 
  375                return $element->getSelection();
 
  380                $this->
getADT()->setSelection($a_cdata);                        
 
static writeByPrimary($a_table, array $a_primary, $a_type, $a_value)
Write directly.
static deleteByPrimary($a_table, array $a_primary, $a_type=null)
Delete values by (partial) primary key.
static readByPrimary($a_table, array $a_primary, $a_type=null)
Read directly.
static getInstance()
Get singleton.
static initActiveRecordByType()
Init active record by type.
importXMLProperty($a_key, $a_value)
Import property from XML.
getFieldDefinitionForTableGUI()
Parse properties for table gui.
prepareCustomDefinitionFormConfirmation(ilPropertyFormGUI $a_form)
importCustomDefinitionFormPostValues(ilPropertyFormGUI $a_form)
Import custom post values from definition form.
setOptions(array $a_values=null)
Set options.
importValueFromXML($a_cdata)
Import value from xml.
importFieldDefinition(array $a_def)
Import (type-specific) field definition from DB.
importDefinitionFormPostValuesNeedsConfirmation()
update()
Update field entry.
getValueForXML(ilADT $element)
Parse ADT value for xml (export)
addCustomFieldToDefinitionForm(ilPropertyFormGUI $a_form, $a_disabled=false)
Add input elements to definition form.
getFieldDefinition()
Get (type-specific) field definition.
prepareElementForEditor(ilADTEnumFormBridge $a_enum)
initADTDefinition()
Init adt instance.
buildConfirmedObjects(ilPropertyFormGUI $a_form)
Process custom post values from definition form.
addPropertiesToXML(ilXmlWriter $a_writer)
Add (type-specific) properties to xml export.
AMD field abstract base class.
getFieldId()
Get field_id.
getADT()
Get ADT instance.
static _lookupType($a_id, $a_reference=false)
lookup object type
static migrateField($a_obj_id, $a_field_id, $old_option, $new_option, $a_is_multi=false)
Migrate search/filter values on advmd change.
This class represents an option in a radio group.
This class represents a text property in a property form.
xmlElement($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
Writes a basic element (no children, just textual content)