4require_once 
"Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php";
 
   40        $def->setNumeric(
false);
 
   60        if ($a_values !== 
null) {
 
   61            foreach ($a_values as $idx => $value) {
 
   62                $a_values[$idx] = trim($value);
 
   63                if (!$a_values[$idx]) {
 
   64                    unset($a_values[$idx]);
 
   67            $a_values = array_unique($a_values);
 
   70        $this->options = $a_values;
 
  104        return array(
$lng->txt(
"meta_advmd_select_options") => implode(
",", $this->
getOptions()));
 
  120        $field->setRequired(
true);
 
  121        $field->setMulti(
true, 
true);
 
  122        $field->setMaxLength(255); 
 
  128            $field->setValue(array_shift(
$options));
 
  132            $field->setDisabled(
true);
 
  144        $recipes = $a_form->
getInput(
"conf_det");
 
  145        if (is_array($recipes[$this->
getFieldId()])) {
 
  147            $sum = $a_form->
getInput(
"conf_det_act");
 
  153            foreach ($recipes as $old_option => $recipe) {
 
  154                $sum_act = $sum[$old_option];
 
  155                $sgl_act = $sgl[$old_option];
 
  157                if ($recipe == 
"sum") {
 
  163                    foreach (array_keys($sgl_act) as $obj_idx) {
 
  164                        if ($sum_act == self::REMOVE_ACTION_ID) {
 
  167                        $res[$old_option][$obj_idx] = $sum_act;
 
  171                    foreach ($sgl_act as $sgl_index => $sgl_item) {
 
  174                        } elseif ($sgl_item == self::REMOVE_ACTION_ID) {
 
  175                            $sgl_act[$sgl_index] = 
"";
 
  179                    $res[$old_option] = $sgl_act;
 
  198        if (
sizeof($missing)) {
 
  200            if (!is_array($this->confirmed_objects)) {
 
  203                    "field_id" => array(
"integer", $this->
getFieldId()),
 
  208                    $this->confirm_objects = array();
 
  209                    foreach ($in_use as $item) {
 
  229        $objDefinition = 
$DIC[
'objDefinition'];
 
  233        if (is_array($this->confirm_objects) && count($this->confirm_objects) > 0) {
 
  234            $new_options = $a_form->
getInput(
"opts");
 
  237            $sec->setTitle(
$lng->txt(
"md_adv_confirm_definition_select_section"));
 
  240            foreach ($this->confirm_objects as $old_option => $items) {
 
  241                $details = 
new ilRadioGroupInputGUI(
$lng->txt(
"md_adv_confirm_definition_select_option") . 
': "' . $old_option . 
'"', 
"conf_det[" . $this->getFieldId() . 
"][" . $old_option . 
"]");
 
  242                $details->setRequired(
true);
 
  243                $details->setValue(
"sum");
 
  251                $sum = 
new ilRadioOption(
$lng->txt(
"md_adv_confirm_definition_select_option_all"), 
"sum");
 
  252                $details->addOption($sum);
 
  255                    $lng->txt(
"md_adv_confirm_definition_select_option_all_action"),
 
  256                    "conf_det_act[" . $this->getFieldId() . 
"][" . $old_option . 
"]" 
  258                $sel->setRequired(
true);
 
  260                    "" => 
$lng->txt(
"please_select"),
 
  261                    self::REMOVE_ACTION_ID => 
$lng->txt(
"md_adv_confirm_definition_select_option_remove")
 
  263                foreach ($new_options as $new_option) {
 
  264                    $options[$new_option] = 
$lng->txt(
"md_adv_confirm_definition_select_option_overwrite") . 
': "' . $new_option . 
'"';
 
  267                $sum->addSubItem($sel);
 
  274                        $sel->setAlert(
$lng->txt(
"msg_input_is_required"));
 
  279                $single = 
new ilRadioOption(
$lng->txt(
"md_adv_confirm_definition_select_option_single"), 
"sgl");
 
  280                $details->addOption($single);
 
  282                foreach ($items as $item) {
 
  284                    $sub_type = $item[1];
 
  287                    $item_id = $obj_id . 
"_" . $sub_type . 
"_" . $sub_id;
 
  294                        $class = 
"ilObj" . $objDefinition->getClassName(
$type);
 
  295                        $class_path = $objDefinition->getLocation(
$type);
 
  296                        include_once $class_path . 
"/class." . $class . 
".php";
 
  297                        if (class_implements($class, ilAdvancedMetaDataSubItem)) {
 
  298                            $sub_title = $class::getAdvMDSubItemTitle($obj_id, $sub_type, $sub_id);
 
  300                                $title .= 
' (' . $sub_title . 
')';
 
  306                        $type_title . 
' ' . 
$title,
 
  307                        "conf[" . $this->
getFieldId() . 
"][" . $old_option . 
"][" . $item_id . 
"]" 
  309                    $sel->setRequired(
true);
 
  311                        "" => 
$lng->txt(
"please_select"),
 
  312                        self::REMOVE_ACTION_ID => 
$lng->txt(
"md_adv_confirm_definition_select_option_remove")
 
  314                    foreach ($new_options as $new_option) {
 
  315                        $options[$new_option] = 
$lng->txt(
"md_adv_confirm_definition_select_option_overwrite") . 
': "' . $new_option . 
'"';
 
  324                            $sel->setAlert(
$lng->txt(
"msg_input_is_required"));
 
  329                    $single->addSubItem($sel);
 
  344        if (is_array($this->confirmed_objects) && count($this->confirmed_objects) > 0) {
 
  346            foreach ($this->confirmed_objects as $old_option => $item_ids) {
 
  347                foreach ($item_ids as $item => $new_option) {
 
  348                    $item = explode(
"_", $item);
 
  350                    $sub_type = $item[1];
 
  356                            "obj_id" => array(
"integer", $obj_id),
 
  357                            "sub_type" => array(
"text", $sub_type),
 
  358                            "sub_id" => array(
"integer", $sub_id),
 
  359                            "field_id" => array(
"integer", $this->
getFieldId())
 
  365                            "obj_id" => array(
"integer", $obj_id),
 
  366                            "sub_type" => array(
"text", $sub_type),
 
  367                            "sub_id" => array(
"integer", $sub_id),
 
  368                            "field_id" => array(
"integer", $this->
getFieldId())
 
  373                    if ($sub_type == 
"wpg") {
 
  375                        include_once 
"Modules/Wiki/classes/class.ilPCAMDPageList.php";
 
  391            $a_writer->
xmlElement(
'FieldValue', 
null, $value);
 
  397        $this->options[] = $a_value;
 
  407        return $element->getSelection();
 
  412        $this->
getADT()->setSelection($a_cdata);
 
  424        $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 _lookupTitle($a_id)
lookup object title
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)
update($pash, $contents, Config $config)
foreach($_POST as $key=> $value) $res