4 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
5 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
6 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDPermissionHelper.php');
33 public function __construct($a_obj_id = null, $a_obj_type = null, $a_sub_type = null)
39 $this->lng->loadLanguageModule(
'meta');
41 $this->tabs_gui = $ilTabs;
43 $this->obj_id = $a_obj_id;
44 $this->obj_type = $a_obj_type;
45 $this->sub_type = $a_sub_type
72 $next_class = $this->ctrl->getNextClass($this);
73 $cmd = $this->ctrl->getCmd();
100 global $ilToolbar, $ilAccess;
112 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
114 $button->setCaption(
"add");
115 $button->setUrl($this->ctrl->getLinkTarget($this,
"createRecord"));
116 $ilToolbar->addButtonInstance($button);
120 $ilToolbar->addSeparator();
126 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
128 $button->setCaption(
"import");
129 $button->setUrl($this->ctrl->getLinkTarget($this,
"importRecords"));
130 $ilToolbar->addButtonInstance($button);
133 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.show_records.html',
'Services/AdvancedMetaData');
135 include_once(
"./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordTableGUI.php");
137 $table_gui->setTitle($this->lng->txt(
"md_record_list_table"));
142 $table_gui->addMultiCommand(
"exportRecords",$this->lng->txt(
'export'));
143 $table_gui->setSelectAllCheckbox(
"record_id");
145 if($ilAccess->checkAccess(
'write',
'',$_REQUEST[
"ref_id"]))
147 $table_gui->addMultiCommand(
"confirmDeleteRecords", $this->lng->txt(
"delete"));
148 $table_gui->addCommandButton(
"updateRecords", $this->lng->txt(
"save"));
152 $this->tpl->setVariable(
'RECORD_TABLE',$table_gui->getHTML());
161 if (is_object($this->form))
163 $this->tabs_gui->setSubTabActive(
'md_adv_presentation');
164 return $this->tpl->setContent($this->form->getHTML());
180 if(!$ilAccess->checkAccess(
'write',
'',$_REQUEST[
"ref_id"]))
182 $this->ctrl->redirect($this,
"showPresentation");
189 if(in_array($obj_type,
array(
"crs",
"cat")))
201 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDSubstitution.php');
206 $sub->enableDescription(
$_POST[
'enabled_desc_'.$obj_type]);
211 $sub->enableFieldNames((
int)
$_POST[
'enabled_field_names_'.$obj_type]);
215 $definitions = $sub->sortDefinitions($definitions);
220 foreach($definitions as $def)
222 $field_id = $def->getFieldId();
223 $old_sub[$field_id] =
array(
224 "active" => $sub->isSubstituted($field_id),
226 "bold" => $sub->isBold($field_id),
227 "newline" => $sub->hasNewline($field_id)
231 $sub->resetSubstitutions(
array());
234 foreach($definitions as $def)
236 $field_id = $def->getFieldId();
237 $old = $old_sub[$field_id];
240 if($perm_def[
"show"])
246 $active =
$old[
"active"];
251 $new_sub[$field_id] =
$old;
255 $new_sub[$field_id][
"pos"] = (int)
$_POST[
'position'][$obj_type][$field_id];
257 if($perm_def[
"bold"])
259 $new_sub[$field_id][
"bold"] = (isset(
$_POST[
'bold'][$obj_type][$field_id]) &&
$_POST[
'bold'][
$obj_type][$field_id]);
261 if($perm_def[
"newline"])
263 $new_sub[$field_id][
"newline"] = (isset(
$_POST[
'newline'][$obj_type][$field_id]) &&
$_POST[
'newline'][
$obj_type][$field_id]);
271 foreach($new_sub as $field_id => $field)
273 $sub->appendSubstitution($field_id, $field[
"bold"], $field[
"newline"]);
282 $this->ctrl->redirect($this,
"showPresentation");
292 if(!isset(
$_POST[
'record_id']))
301 foreach(
$_POST[
'record_id'] as $record_id)
309 $fail[] = $record->getTitle();
315 $this->ctrl->redirect($this,
"showRecords");
318 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordXMLWriter.php');
320 $xml_writer->write();
322 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordExportFiles.php');
324 $export_files->create($xml_writer->xmlDumpMem());
339 $this->tabs_gui->setSubTabActive(
'md_adv_file_list');
341 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordExportFiles.php');
343 $file_data =
$files->readFilesInfo();
345 include_once(
"./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordExportFilesTableGUI.php");
347 $table_gui->setTitle($this->lng->txt(
"md_record_export_table"));
348 $table_gui->parseFiles($file_data);
349 $table_gui->addMultiCommand(
"downloadFile",$this->lng->txt(
'download'));
350 $table_gui->addMultiCommand(
"confirmDeleteFiles", $this->lng->txt(
"delete"));
351 $table_gui->addCommandButton(
'showFiles',$this->lng->txt(
'cancel'));
352 $table_gui->setSelectAllCheckbox(
"file_id");
354 $this->tpl->setContent($table_gui->getHTML());
373 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordExportFiles.php');
375 $abs_path =
$files->getAbsolutePathByFileId((
int)
$_POST[
'file_id'][0]);
388 if(!isset(
$_POST[
'file_id']))
395 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
399 $c_gui->setFormAction($this->ctrl->getFormAction($this,
"deleteFiles"));
400 $c_gui->setHeaderText($this->lng->txt(
"md_adv_delete_files_sure"));
401 $c_gui->setCancel($this->lng->txt(
"cancel"),
"showFiles");
402 $c_gui->setConfirm($this->lng->txt(
"confirm"),
"deleteFiles");
404 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordExportFiles.php');
406 $file_data =
$files->readFilesInfo();
410 foreach(
$_POST[
"file_id"] as $file_id)
412 $info = $file_data[$file_id];
413 $c_gui->addItem(
"file_id[]", $file_id, is_array(
$info[
'name']) ? implode(
',',
$info[
'name']) :
'No Records');
415 $this->tpl->setContent($c_gui->getHTML());
427 if(!isset(
$_POST[
'file_id']))
434 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordExportFiles.php');
437 foreach(
$_POST[
'file_id'] as $file_id)
439 $files->deleteByFileId((
int) $file_id);
453 if(!isset(
$_POST[
'record_id']))
460 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
464 $c_gui->setFormAction($this->ctrl->getFormAction($this,
"deleteRecords"));
465 $c_gui->setHeaderText($this->lng->txt(
"md_adv_delete_record_sure"));
466 $c_gui->setCancel($this->lng->txt(
"cancel"),
"showRecords");
467 $c_gui->setConfirm($this->lng->txt(
"confirm"),
"deleteRecords");
470 foreach(
$_POST[
"record_id"] as $record_id)
473 $c_gui->addItem(
"record_id[]", $record_id, $record->getTitle() ? $record->getTitle() :
'No Title');
475 $this->tpl->setContent($c_gui->getHTML());
486 if(!isset(
$_POST[
'record_id']))
495 foreach(
$_POST[
'record_id'] as $record_id)
501 if(!$record->getParentObject())
503 $fail[] = $record->getTitle();
513 $fail[] = $record->getTitle();
519 $this->ctrl->redirect($this,
"showRecords");
522 foreach(
$_POST[
'record_id'] as $record_id)
528 $this->ctrl->redirect($this,
"showRecords");
540 $selected_global =
array();
558 $obj_types =
array();
559 if (is_array(
$_POST[
'obj_types'][$record_obj->getRecordId()]))
561 foreach (
$_POST[
'obj_types'][$record_obj->getRecordId()] as $type => $status)
565 $type = explode(
":", $type);
566 $obj_types[] =
array(
569 "optional" => ((
int)$status == 2)
574 $record_obj->setAssignedObjectTypes($obj_types);
579 $record_obj->setActive(isset(
$_POST[
'active'][$record_obj->getRecordId()]));
582 $record_obj->update();
587 if($item[
'readonly'] &&
589 $_POST[
'active'][$item[
'id']])
591 $selected_global[] = $item[
'id'];
593 else if($item[
'local'])
596 $record_obj->setActive(isset(
$_POST[
'active'][$item[
'id']]));
597 $record_obj->update();
608 $this->ctrl->redirect($this,
"showRecords");
619 if(!isset(
$_POST[
'field_id']))
626 $this->ctrl->saveParameter($this,
'record_id');
628 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
632 $c_gui->setFormAction($this->ctrl->getFormAction($this,
"deleteFields"));
633 $c_gui->setHeaderText($this->lng->txt(
"md_adv_delete_fields_sure"));
634 $c_gui->setCancel($this->lng->txt(
"cancel"),
"editFields");
635 $c_gui->setConfirm($this->lng->txt(
"confirm"),
"deleteFields");
638 foreach(
$_POST[
"field_id"] as $field_id)
641 $c_gui->addItem(
"field_id[]", $field_id, $field->getTitle() ? $field->getTitle() :
'No Title');
643 $this->tpl->setContent($c_gui->getHTML());
655 $this->ctrl->saveParameter($this,
'record_id');
657 if(!isset(
$_POST[
'field_id']))
666 foreach(
$_POST[
'field_id'] as $field_id)
674 $fail[] = $field->getTitle();
680 $this->ctrl->redirect($this,
"editFields");
683 foreach(
$_POST[
"field_id"] as $field_id)
689 $this->ctrl->redirect($this,
"editFields");
701 $this->ctrl->saveParameter($this,
'record_id');
704 $this->tpl->setContent($this->form->getHTML());
712 $this->ctrl->saveParameter($this,
'record_id');
717 $this->record->getRecordId(),
723 $filter_warn =
array();
727 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
733 $options[$type] = $this->lng->txt($field->getTypeTitle());
735 if(!$field->isFilterSupported())
737 $filter_warn[] = $this->lng->txt($field->getTypeTitle());
741 $ilToolbar->addInputItem($types);
743 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"createField"));
745 include_once
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
747 $button->setCaption(
"add");
748 $button->setCommand(
"createField");
749 $ilToolbar->addButtonInstance($button);
753 if(
sizeof($filter_warn))
755 ilUtil::sendInfo(sprintf($this->lng->txt(
"md_adv_field_filter_warning"), implode(
", ", $filter_warn)));
759 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
762 include_once(
"./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldTableGUI.php");
764 $table_gui->setTitle($this->lng->txt(
"md_adv_field_table"));
765 $table_gui->parseDefinitions($fields);
768 $table_gui->addCommandButton(
"updateFields", $this->lng->txt(
"save"));
770 $table_gui->addCommandButton(
"showRecords", $this->lng->txt(
'cancel'));
771 $table_gui->addMultiCommand(
"confirmDeleteFields", $this->lng->txt(
"delete"));
772 $table_gui->setSelectAllCheckbox(
"field_id");
774 $this->tpl->setContent($table_gui->getHTML());
785 $this->ctrl->saveParameter($this,
'record_id');
794 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
808 asort(
$_POST[
'position'],SORT_NUMERIC);
809 $positions = array_flip(array_keys(
$_POST[
'position']));
810 foreach($fields as $field)
812 $field->setPosition($positions[$field->getFieldId()]);
817 foreach($fields as $field)
821 $field->getFieldId(),
825 $field->setSearchable(isset(
$_POST[
'searchable'][$field->getFieldId()]) ?
true :
false);
832 $this->ctrl->redirect($this,
"editFields");
853 if(!$this->record->validate())
859 $this->record->update();
877 $this->tpl->setContent($this->form->getHTML());
885 $this->tpl->setContent($this->import_form->getHTML());
895 if(is_object($this->import_form))
900 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
902 $this->import_form->setMultipart(
true);
903 $this->import_form->setFormAction($this->ctrl->getFormAction($this));
908 $file->setRequired(
true);
909 $this->import_form->addItem(
$file);
911 $this->import_form->setTitle($this->lng->txt(
'md_adv_import_record'));
912 $this->import_form->addCommandButton(
'importRecord',$this->lng->txt(
'import'));
913 $this->import_form->addCommandButton(
'showRecords',$this->lng->txt(
'cancel'));
926 if(!$this->import_form->checkInput())
928 $this->import_form->setValuesByPost();
933 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordImportFiles.php');
935 if(!$create_time = $import_files->moveUploadedFile($_FILES[
'file'][
'tmp_name']))
943 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordParser.php');
949 $parser->setContext($this->obj_id, $this->obj_type, $this->sub_type);
960 $this->ctrl->redirect($this,
"showRecords");
962 catch(ilSAXParserException $exc)
965 $this->ctrl->redirect($this,
"importRecords");
969 $import_files->deleteFileByCreationDate($create_time);
988 $this->record->setAssignedObjectTypes(
array(
990 "obj_type"=>$this->obj_type,
991 "sub_type"=>$this->sub_type,
996 if(!$this->record->validate())
1002 $this->record->save();
1016 if(!$_REQUEST[
"record_id"] || !$_REQUEST[
"field_id"])
1021 $this->ctrl->saveParameter($this,
'record_id');
1022 $this->ctrl->saveParameter($this,
'field_id');
1029 $this->tpl->setContent($a_form->getHTML());
1040 if(!$_REQUEST[
"record_id"] || !$_REQUEST[
"field_id"])
1045 $this->ctrl->saveParameter($this,
'record_id');
1046 $this->ctrl->saveParameter($this,
'field_id');
1051 if($form->checkInput())
1053 $field_definition->importDefinitionFormPostValues($form, $this->
getPermissions());
1054 if(!$field_definition->importDefinitionFormPostValuesNeedsConfirmation())
1056 $field_definition->update();
1059 $this->ctrl->redirect($this,
"editFields");
1067 $form->setValuesByPost();
1073 $field_definition->prepareDefinitionFormConfirmation($form);
1088 if(!$_REQUEST[
"record_id"] || !$_REQUEST[
"ftype"])
1093 $this->ctrl->saveParameter($this,
'record_id');
1094 $this->ctrl->saveParameter($this,
'ftype');
1098 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1100 $field_definition->setRecordId($_REQUEST[
"record_id"]);
1103 $this->tpl->setContent($a_form->getHTML());
1113 if(!$_REQUEST[
"record_id"] || !$_REQUEST[
"ftype"])
1118 $this->ctrl->saveParameter($this,
'record_id');
1119 $this->ctrl->saveParameter($this,
'ftype');
1121 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1123 $field_definition->setRecordId($_REQUEST[
"record_id"]);
1126 if($form->checkInput())
1128 $field_definition->importDefinitionFormPostValues($form, $this->
getPermissions());
1129 $field_definition->save();
1132 $this->ctrl->redirect($this,
"editFields");
1135 $form->setValuesByPost();
1146 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1149 $form->setFormAction($this->ctrl->getFormAction($this));
1153 $form->addItem($type);
1159 $form->setTitle($this->lng->txt(
'md_adv_create_field'));
1160 $form->addCommandButton(
'saveField',$this->lng->txt(
'create'));
1164 $form->setTitle($this->lng->txt(
'md_adv_edit_field'));
1165 $form->addCommandButton(
'updateField',$this->lng->txt(
'save'));
1168 $form->addCommandButton(
'editFields',$this->lng->txt(
'cancel'));
1180 if(is_object($this->form))
1187 $this->record->getRecordId(),
1198 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1201 $this->form->setFormAction($this->ctrl->getFormAction($this));
1206 $title->setValue($this->record->getTitle());
1208 $title->setMaxLength(70);
1209 $title->setRequired(
true);
1210 $this->form->addItem(
$title);
1214 $title->setDisabled(
true);
1219 $desc->
setValue($this->record->getDescription());
1222 $this->form->addItem($desc);
1226 $desc->setDisabled(
true);
1231 $check->
setChecked($this->record->isActive());
1232 $check->setValue(1);
1233 $this->form->addItem($check);
1237 $check->setDisabled(
true);
1240 if(!$this->obj_type)
1243 $section->setTitle($this->lng->txt(
'md_obj_types'));
1248 0 => $this->lng->txt(
"meta_obj_type_inactive"),
1249 1 => $this->lng->txt(
"meta_obj_type_mandatory"),
1250 2 => $this->lng->txt(
"meta_obj_type_optional")
1256 $t = $type[
"obj_type"].
":".$type[
"sub_type"];
1257 $this->lng->loadLanguageModule($type[
"obj_type"]);
1260 switch($type[
"obj_type"])
1264 unset($type_options[1]);
1268 unset($type_options[1]);
1272 unset($type_options[2]);
1277 if($a_mode ==
"edit")
1279 foreach($this->record->getAssignedObjectTypes() as $item)
1281 if($item[
"obj_type"] == $type[
"obj_type"] &&
1282 $item[
"sub_type"] == $type[
"sub_type"])
1284 $value = $item[
"optional"]
1292 $check->setOptions($type_options);
1293 $check->setValue($value);
1294 $this->form->addItem($check);
1298 $check->setDisabled(
true);
1306 $this->form->setTitle($this->lng->txt(
'md_adv_create_record'));
1307 $this->form->addCommandButton(
'saveRecord',$this->lng->txt(
'add'));
1308 $this->form->addCommandButton(
'showRecords',$this->lng->txt(
'cancel'));
1313 $this->form->setTitle($this->lng->txt(
'md_adv_edit_record'));
1314 $this->form->addCommandButton(
'updateRecord',$this->lng->txt(
'save'));
1315 $this->form->addCommandButton(
'showRecords',$this->lng->txt(
'cancel'));
1323 if($a_obj_type ==
"crs")
1341 else if($a_obj_type ==
"cat")
1370 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1378 $this->form->setFormAction($this->ctrl->getFormAction($this));
1379 #$this->form->setTableWidth('100%'); 1398 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDSubstitution.php');
1403 $section->setTitle($this->lng->txt(
'objs_'.$obj_type));
1406 $check =
new ilCheckboxInputGUI($this->lng->txt(
'description'),
'enabled_desc_'.$obj_type);
1408 $check->setOptionTitle($this->lng->txt(
'md_adv_desc_show'));
1409 $check->setChecked($sub->isDescriptionEnabled() ? true :
false);
1410 $this->form->addItem($check);
1414 $check->setDisabled(
true);
1417 $check =
new ilCheckboxInputGUI($this->lng->txt(
'md_adv_field_names'),
'enabled_field_names_'.$obj_type);
1419 $check->setOptionTitle($this->lng->txt(
'md_adv_fields_show'));
1420 $check->setChecked($sub->enabledFieldNames() ? true :
false);
1421 $this->form->addItem($check);
1425 $check->setDisabled(
true);
1428 #$area = new ilTextAreaInputGUI($this->lng->txt('md_adv_substitution'),'substitution_'.$obj_type); 1429 #$area->setUseRte(true); 1430 #$area->setRteTagSet('standard'); 1431 #$area->setValue(ilUtil::prepareFormOutput($sub->getSubstitutionString())); 1433 #$area->setCols(80); 1434 #$this->form->addItem($area); 1442 $definitions = $sub->sortDefinitions($definitions);
1445 foreach($definitions as $def)
1447 $definition_id = $def->getFieldId();
1452 $title = $def->getTitle().
' ('.$title.
')';
1455 $check->setValue(1);
1456 $check->setOptionTitle($this->lng->txt(
'md_adv_show'));
1457 $check->setChecked($sub->isSubstituted($definition_id));
1459 if($perm && !$perm[
"show"])
1461 $check->setDisabled(
true);
1464 $pos =
new ilNumberInputGUI($this->lng->txt(
'position'),
'position['.$obj_type.
']['.$definition_id.
']');
1466 $pos->setMaxLength(4);
1467 $pos->allowDecimals(
true);
1468 $pos->setValue(sprintf(
'%.1f',
$counter++));
1469 $check->addSubItem($pos);
1471 if($perm && !$perm_pos)
1473 $pos->setDisabled(
true);
1476 $bold =
new ilCheckboxInputGUI($this->lng->txt(
'bold'),
'bold['.$obj_type.
']['.$definition_id.
']');
1478 $bold->setChecked($sub->isBold($definition_id));
1479 $check->addSubItem($bold);
1481 if($perm && !$perm[
"bold"])
1483 $bold->setDisabled(
true);
1486 $bold =
new ilCheckboxInputGUI($this->lng->txt(
'newline'),
'newline['.$obj_type.
']['.$definition_id.
']');
1488 $bold->setChecked($sub->hasNewline($definition_id));
1489 $check->addSubItem($bold);
1491 if($perm && !$perm[
"newline"])
1493 $bold->setDisabled(
true);
1497 $this->form->addItem($check);
1525 $this->form->setTitle($this->lng->txt(
'md_adv_substitution_table'));
1527 if($ilAccess->checkAccess(
'write',
'',$_REQUEST[
"ref_id"]))
1529 $this->form->addCommandButton(
'updateSubstitutions',$this->lng->txt(
'save'));
1544 $this->record->getRecordId(),
1568 if(!$this->obj_type)
1572 $obj_types =
array();
1573 if (is_array(
$_POST[
'obj_types']))
1575 foreach (
$_POST[
'obj_types'] as
$t => $value)
1579 $t = explode(
":",
$t);
1580 $obj_types[] =
array(
1583 "optional" => ($value > 1)
1588 $this->record->setAssignedObjectTypes($obj_types);
1600 if(!is_object($this->record))
1602 $record_id = isset(
$_GET[
'record_id'])
1603 ?
$_GET[
'record_id']
1611 $this->record->setParentObject($this->obj_id);
1615 return $this->record;
1625 $this->tabs_gui->clearSubTabs();
1627 $this->tabs_gui->addSubTabTarget(
"md_adv_record_list",
1628 $this->ctrl->getLinkTarget($this,
"showRecords"),
1637 $this->tabs_gui->addSubTabTarget(
"md_adv_presentation",
1638 $this->ctrl->getLinkTarget($this,
"showPresentation"));
1641 $this->tabs_gui->addSubTabTarget(
"md_adv_file_list",
1642 $this->ctrl->getLinkTarget($this,
"showFiles"),
1662 $parent_id = $record->getParentObject();
1664 if(!$this->obj_type)
1675 $parent_id != $this->obj_id)
1682 !$record->isActive())
1689 $tmp_arr[
'id'] = $record->getRecordId();
1690 $tmp_arr[
'active'] = $record->isActive();
1691 $tmp_arr[
'title'] = $record->getTitle();
1692 $tmp_arr[
'description'] = $record->getDescription();
1693 $tmp_arr[
'fields'] =
array();
1694 $tmp_arr[
'obj_types'] = $record->getAssignedObjectTypes();
1696 $tmp_arr[
'perm'] = $this->permissions->hasPermissions(
1698 $record->getRecordId(),
1709 $tmp_arr[
"readonly"] = !(bool)$parent_id;
1710 $tmp_arr[
"local"] = $parent_id;
1713 $assigned = $optional =
false;
1714 foreach($tmp_arr[
'obj_types'] as $idx => $item)
1716 if($item[
"obj_type"] == $this->obj_type &&
1717 $item[
"sub_type"] == $this->sub_type)
1720 $optional = $item[
"optional"];
1721 $tmp_arr[
'obj_types'][$idx][
'context'] =
true;
1729 $tmp_arr[
'optional'] = $optional;
1733 $tmp_arr[
'active'] = in_array($record->getRecordId(), $selected);
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
const ACTION_RECORD_FIELD_POSITIONS
deleteFields()
delete fields
const CONTEXT_SUBSTITUTION_COURSE
downloadFile()
Download XML file.
static getInstance($a_user_id=null, $a_ref_id=null)
Factory.
const ACTION_RECORD_EDIT_PROPERTY
const CONTEXT_SUBSTITUTION
const SUBACTION_SUBSTITUTION_NEWLINE
setValue($a_value)
Set Value.
updateRecord()
Update record.
static _getRecords()
Get records.
const ACTION_RECORD_EXPORT
setSubTabs()
Set sub tabs.
deleteRecords()
Permanently delete records.
const SUBACTION_SUBSTITUTION_BOLD
updateRecords()
Save records (assigned object typed)
const ACTION_FIELD_DELETE
const CONTEXT_SUBSTITUTION_CATEGORY
AMD field abstract base class.
const ACTION_RECORD_CREATE_FIELD
getSubstitutionFieldPermissions($a_obj_type, $a_field_id)
initRecordObject()
Init record object.
setValue($a_value)
Set Value.
const SUBACTION_RECORD_TITLE
const ACTION_FIELD_EDIT_PROPERTY
getParsedRecordObjects()
Get and cache record objects.
importRecord()
import xml file
updateFields()
Update fields.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
updateField()
Update field.
const ACTION_MD_CREATE_RECORD
static saveObjRecSelection($a_obj_id, $a_sub_type="", array $a_records=null, $a_delete_before=true)
Save repository object record selection.
static _getInstanceByObjectType($a_type)
Singleton: use this method to get an instance.
const SUBACTION_FIELD_SEARCHABLE
const ACTION_SUBSTITUTION_SHOW_DESCRIPTION
const ACTION_MD_IMPORT_RECORDS
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
confirmDeleteFiles()
confirm delete files
confirmDeleteRecords()
Confirm delete.
static _getInstanceByRecordId($a_record_id)
Get instance by record id.
showFiles()
show export files
static getInstancesByRecordId($a_record_id, $a_only_searchable=false)
Get definitions by record id.
if(!is_array($argv)) $options
const SUBACTION_RECORD_OBJECT_TYPES
executeCommand()
Execute command.
const ACTION_SUBSTITUTION_CATEGORY_SHOW_FIELD
static getInstancesByObjType($a_obj_type, $a_active_only=true)
static getInstance($a_field_id, $a_type=null)
Get definition instance by type.
addToFieldDefinitionForm(ilPropertyFormGUI $a_form, ilAdvancedMDPermissionHelper $a_permissions)
Add input elements to definition form.
const ACTION_RECORD_TOGGLE_ACTIVATION
This class represents a text property in a property form.
initImportForm()
show import form
const ACTION_SUBSTITUTION_COURSE_EDIT_FIELD_PROPERTY
static _getAllRecordsByObjectType()
Get records by obj_type Note: this returns only records with no sub types! public.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static _lookupTitle($a_record_id)
Lookup title.
createField(ilPropertyFormGUI $a_form=null)
Show field type selection.
static getValidTypes()
Get all valid types.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
editField(ilPropertyFormGUI $a_form=null)
Edit field.
editRecord()
Edit one record.
const ACTION_RECORD_EDIT_FIELDS
const ACTION_RECORD_DELETE
const ACTION_SUBSTITUTION_SHOW_FIELDNAMES
const ACTION_SUBSTITUTION_COURSE_SHOW_FIELD
static _getAssignableObjectTypes($a_include_text=false)
Get assignable object type.
updateSubstitutions()
Update substitution.
const ACTION_SUBSTITUTION_FIELD_POSITIONS
This class represents a non editable value in a property form.
initForm($a_mode)
Init Form.
This class represents a text area property in a property form.
const SUBACTION_RECORD_DESCRIPTION
exportRecords()
Export records.
const ACTION_SUBSTITUTION_CATEGORY_EDIT_FIELD_PROPERTY
initFormSubstitutions()
init form table 'substitutions'
static _getActivatedObjTypes()
get activated obj types
initFieldForm(ilAdvancedMDFieldDefinition $a_definition)
init field form
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
deleteFiles()
Delete files.
showRecords()
show record list
getTypeTitle()
Get type title (lang id)
SAX based XML parser for record import files.
getFieldId()
Get field_id.
__construct($a_obj_id=null, $a_obj_type=null, $a_sub_type=null)
Constructor.
static getObjRecSelection($a_obj_id, $a_sub_type="")
Get repository object record selection.
loadRecordFormData()
load record form data
confirmDeleteFields()
show delete fields confirmation screen
const MODE_INSERT_VALIDATION
Confirmation screen class.