4require_once 
"Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php";
 
   40                $def->setNumeric(
false);
 
   60                if($a_values !== 
null)
 
   62                        foreach($a_values as $idx => $value)
 
   64                                $a_values[$idx] = trim($value);
 
   67                                        unset($a_values[$idx]);
 
   70                        $a_values = array_unique($a_values);
 
   73                $this->options = $a_values;      
 
  105                return array(
$lng->txt(
"meta_advmd_select_options") => implode(
",", $this->
getOptions()));              
 
  119                $field->setRequired(
true);
 
  120                $field->setMulti(
true, 
true);
 
  121                $field->setMaxLength(255); 
 
  128                        $field->setValue(array_shift(
$options));
 
  133                        $field->setDisabled(
true);
 
  145                $recipes = $a_form->
getInput(
"conf_det");       
 
  149                        $sum = $a_form->
getInput(
"conf_det_act");
 
  155                        foreach($recipes as $old_option => $recipe)
 
  157                                $sum_act = $sum[$old_option];
 
  158                                $sgl_act = $sgl[$old_option];
 
  168                                        foreach(array_keys($sgl_act) as $obj_idx)
 
  170                                                if($sum_act == self::REMOVE_ACTION_ID)
 
  174                                                $res[$old_option][$obj_idx] = $sum_act;
 
  180                                        foreach($sgl_act as $sgl_index => $sgl_item)
 
  186                                                else if($sgl_item == self::REMOVE_ACTION_ID)
 
  188                                                        $sgl_act[$sgl_index] = 
"";
 
  192                                        $res[$old_option] = $sgl_act;
 
  214                        if(!is_array($this->confirmed_objects))
 
  218                                        "field_id" => array(
"integer", $this->
getFieldId()),
 
  224                                        $this->confirm_objects = array();
 
  225                                        foreach($in_use as $item)
 
  243                global 
$lng, $objDefinition;
 
  247                if(
sizeof($this->confirm_objects))
 
  249                        $new_options = $a_form->
getInput(
"opts");               
 
  252                        $sec->setTitle(
$lng->txt(
"md_adv_confirm_definition_select_section"));
 
  255                        foreach($this->confirm_objects as $old_option => $items)
 
  257                                $details = 
new ilRadioGroupInputGUI(
$lng->txt(
"md_adv_confirm_definition_select_option").
': "'.$old_option.
'"', 
"conf_det[".$this->getFieldId().
"][".$old_option.
"]");                  
 
  258                                $details->setRequired(
true);                    
 
  259                                $details->setValue(
"sum");
 
  268                                $sum = 
new ilRadioOption(
$lng->txt(
"md_adv_confirm_definition_select_option_all"), 
"sum");                              
 
  269                                $details->addOption($sum);
 
  272                                        "conf_det_act[".$this->getFieldId().
"][".$old_option.
"]");      
 
  273                                $sel->setRequired(
true);
 
  275                                        "" => 
$lng->txt(
"please_select"),
 
  276                                        self::REMOVE_ACTION_ID => 
$lng->txt(
"md_adv_confirm_definition_select_option_remove")
 
  278                                foreach($new_options as $new_option)
 
  280                                        $options[$new_option] = 
$lng->txt(
"md_adv_confirm_definition_select_option_overwrite").
': "'.$new_option.
'"';
 
  283                                $sum->addSubItem($sel);
 
  294                                                $sel->setAlert(
$lng->txt(
"msg_input_is_required"));
 
  299                                $single = 
new ilRadioOption(
$lng->txt(
"md_adv_confirm_definition_select_option_single"), 
"sgl");
 
  300                                $details->addOption($single);
 
  302                                foreach($items as $item)
 
  305                                        $sub_type = $item[1];
 
  308                                        $item_id = $obj_id.
"_".$sub_type.
"_".$sub_id;
 
  311                                        $type_title = 
$lng->txt(
"obj_".$type);
 
  312                                        $title = 
' "'.ilObject::_lookupTitle($obj_id).
'"';
 
  316                                                $class = 
"ilObj".$objDefinition->getClassName($type);                                           
 
  317                                                $class_path = $objDefinition->getLocation($type);
 
  318                                                include_once $class_path.
"/class.".$class.
".php";
 
  319                                                if(class_implements($class, ilAdvancedMetaDataSubItem))
 
  321                                                        $sub_title = $class::getAdvMDSubItemTitle($obj_id, $sub_type, $sub_id);
 
  324                                                                        $title .= 
' ('.$sub_title.
')';
 
  330                                                "conf[".$this->getFieldId().
"][".$old_option.
"][".$item_id.
"]");        
 
  331                                        $sel->setRequired(
true);
 
  333                                                "" => 
$lng->txt(
"please_select"),
 
  334                                                self::REMOVE_ACTION_ID => 
$lng->txt(
"md_adv_confirm_definition_select_option_remove")
 
  336                                        foreach($new_options as $new_option)
 
  338                                                $options[$new_option] = 
$lng->txt(
"md_adv_confirm_definition_select_option_overwrite").
': "'.$new_option.
'"';
 
  351                                                        $sel->setAlert(
$lng->txt(
"msg_input_is_required"));
 
  356                                        $single->addSubItem($sel);
 
  371                if(
sizeof($this->confirmed_objects))
 
  374                        foreach($this->confirmed_objects as $old_option => $item_ids)
 
  376                                foreach($item_ids as $item => $new_option)
 
  378                                        $item = explode(
"_", $item);
 
  380                                        $sub_type = $item[1];
 
  387                                                        "obj_id" => array(
"integer", $obj_id),
 
  388                                                        "sub_type" => array(
"text", $sub_type),
 
  389                                                        "sub_id" => array(
"integer", $sub_id),
 
  390                                                        "field_id" => array(
"integer", $this->
getFieldId())
 
  398                                                        "obj_id" => array(
"integer", $obj_id),
 
  399                                                        "sub_type" => array(
"text", $sub_type),
 
  400                                                        "sub_id" => array(
"integer", $sub_id),
 
  401                                                        "field_id" => array(
"integer", $this->
getFieldId())
 
  406                                        if($sub_type == 
"wpg")
 
  409                                                include_once 
"Modules/Wiki/classes/class.ilPCAMDPageList.php";
 
  426                        $a_writer->
xmlElement(
'FieldValue',
null,$value);                        
 
  432                $this->options[] = $a_value;
 
  442                return $element->getSelection();
 
  447                $this->
getADT()->setSelection($a_cdata);                        
 
  459                $a_enum->setAutoSort(
false);            
 
An exception for terminatinating execution or to throw for unit testing.
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.
prepareElementForEditor(ilADTFormBridge $a_enum)
Prepare editor form elements.
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.
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.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
xmlElement($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
Writes a basic element (no children, just textual content)