ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilAdvancedMDFieldDefinition.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once "Services/ADT/classes/class.ilADTFactory.php";
5
15{
16 protected $field_id; // [int]
17 protected $record_id; // [int]
18 protected $import_id; // [string]
19 protected $position; // [int]
20 protected $title; // [string]
21 protected $description; // [string]
22 protected $searchable; // [bool]
23 protected $required; // [bool]
24 protected $adt_def; // [ilADTDefinition]
25 protected $adt; // [ilADT]
26
27 const TYPE_SELECT = 1;
28 const TYPE_TEXT = 2;
29 const TYPE_DATE = 3;
30 const TYPE_DATETIME = 4;
31 const TYPE_INTEGER = 5;
32 const TYPE_FLOAT = 6;
33 const TYPE_LOCATION = 7;
35
42 public function __construct($a_field_id = null)
43 {
44 $this->init();
45 $this->read($a_field_id);
46 }
47
55 public static function getInstance($a_field_id, $a_type = null)
56 {
57 global $ilDB;
58
59 if(!$a_type)
60 {
61 $set = $ilDB->query("SELECT field_type".
62 " FROM adv_mdf_definition".
63 " WHERE field_id = ".$ilDB->quote($a_field_id, "integer"));
64 $a_type = $ilDB->fetchAssoc($set);
65 $a_type = $a_type["field_type"];
66 }
67
68 if(self::isValidType($a_type))
69 {
70 $class = "ilAdvancedMDFieldDefinition".self::getTypeString($a_type);
71 require_once "Services/AdvancedMetaData/classes/Types/class.".$class.".php";
72 return new $class($a_field_id);
73 }
74
75 throw new ilException("unknown type ".$a_type);
76 }
77
84 public static function getInstanceByTypeString($a_type)
85 {
86 // see self::getTypeString()
87 $map = array(
88 self::TYPE_TEXT => "Text",
89 self::TYPE_SELECT => "Select",
90 self::TYPE_DATE => "Date",
91 self::TYPE_DATETIME => "DateTime",
92 self::TYPE_FLOAT => "Float",
93 self::TYPE_LOCATION => "Location",
94 self::TYPE_INTEGER => "Integer",
95 self::TYPE_SELECT_MULTI => "SelectMulti"
96 );
97 $map = array_flip($map);
98 if(array_key_exists($a_type, $map))
99 {
100 return self::getInstance(null, $map[$a_type]);
101 }
102 }
103
111 public static function getInstancesByRecordId($a_record_id, $a_only_searchable = false)
112 {
113 global $ilDB;
114
115 $defs = array();
116
117 $query = "SELECT * FROM adv_mdf_definition".
118 " WHERE record_id = ".$ilDB->quote($a_record_id, "integer");
119 if($a_only_searchable)
120 {
121 $query .= " AND searchable = ".$ilDB->quote(1, "integer");
122 }
123 $query .= " ORDER BY position";
124 $set = $ilDB->query($query);
125 while($row = $ilDB->fetchAssoc($set))
126 {
127 $field = self::getInstance(null, $row["field_type"]);
128 $field->import($row);
129 $defs[$row["field_id"]] = $field;
130 }
131
132 return $defs;
133 }
134
135 public static function getInstancesByObjType($a_obj_type, $a_active_only = true)
136 {
137 global $ilDB;
138
139 $defs = array();
140
141 $query = "SELECT amf.* FROM adv_md_record_objs aro".
142 " JOIN adv_md_record amr ON aro.record_id = amr.record_id".
143 " JOIN adv_mdf_definition amf ON aro.record_id = amf.record_id".
144 " WHERE obj_type = ".$ilDB->quote($a_obj_type,'text');
145 if((bool)$a_active_only)
146 {
147 $query .= " AND active = ".$ilDB->quote(1, "integer");
148 }
149 $query .= " ORDER BY aro.record_id,position";
150 $res = $ilDB->query($query);
151 while($row = $ilDB->fetchAssoc($res))
152 {
153 $field = self::getInstance(null, $row["field_type"]);
154 $field->import($row);
155 $defs[$row["field_id"]] = $field;
156 }
157 return $defs;
158 }
159
166 public static function getInstanceByImportId($a_import_id)
167 {
168 global $ilDB;
169
170 $query = "SELECT field_id, field_type FROM adv_mdf_definition".
171 " WHERE import_id = ".$ilDB->quote($a_import_id,'text');
172 $set = $ilDB->query($query);
173 if($ilDB->numRows($set))
174 {
175 $row = $ilDB->fetchAssoc($set);
176 return self::getInstance($row["field_id"], $row["field_type"]);
177 }
178 }
179
185 public static function getSearchableDefinitionIds()
186 {
187 global $ilDB;
188
189 $field_ids = array();
190
191 $query = "SELECT field_id FROM adv_md_record amr".
192 " JOIN adv_mdf_definition amfd ON (amr.record_id = amfd.record_id)".
193 " WHERE active = ".$ilDB->quote(1, "integer").
194 " AND searchable = ".$ilDB->quote(1, "integer");
195 $set = $ilDB->query($query);
196 while($row = $ilDB->fetchAssoc($set))
197 {
198 $field_ids[] = $row["field_id"];
199 }
200 return $field_ids;
201 }
202
209 public static function getADTGroupForDefinitions(array $a_defs)
210 {
211 $factory = ilADTFactory::getInstance();
212 $group_def = $factory->getDefinitionInstanceByType("Group");
213 foreach($a_defs as $def)
214 {
215 $group_def->addElement($def->getFieldId(), $def->getADTDefinition());
216 }
217 $group = $factory->getInstanceByDefinition($group_def);
218
219 // bind adt instances to definition
220 foreach($group->getElements() as $element_id => $element)
221 {
222 $a_defs[$element_id]->setADT($element);
223 }
224
225 return $group;
226 }
227
231 protected function init()
232 {
233 $this->setRequired(false);
234 $this->setSearchable(false);
235 }
236
237
238 //
239 // generic types
240 //
241
247 public static function getValidTypes()
248 {
249 return array(self::TYPE_TEXT, self::TYPE_DATE, self::TYPE_DATETIME,
250 self::TYPE_SELECT, self::TYPE_INTEGER, self::TYPE_FLOAT,
251 self::TYPE_LOCATION, self::TYPE_SELECT_MULTI);
252 }
253
260 public static function isValidType($a_type)
261 {
262 return in_array((int)$a_type, self::getValidTypes());
263 }
264
270 abstract public function getType();
271
278 protected static function getTypeString($a_type)
279 {
280 if(self::isValidType($a_type))
281 {
282 $map = array(
283 self::TYPE_TEXT => "Text",
284 self::TYPE_SELECT => "Select",
285 self::TYPE_DATE => "Date",
286 self::TYPE_DATETIME => "DateTime",
287 self::TYPE_FLOAT => "Float",
288 self::TYPE_LOCATION => "Location",
289 self::TYPE_INTEGER => "Integer",
290 self::TYPE_SELECT_MULTI => "SelectMulti"
291 );
292 return $map[$a_type];
293 }
294 }
295
301 public function getTypeTitle()
302 {
303 // :TODO: reuse udf stuff here ?!
304 return "udf_type_".strtolower(self::getTypeString($this->getType()));
305 }
306
307
308
309 //
310 // ADT
311 //
312
318 abstract protected function initADTDefinition();
319
325 public function getADTDefinition()
326 {
327 if(!$this->adt_def instanceof ilADTDefinition)
328 {
329 $this->adt_def = $this->initADTDefinition();
330 }
331 return $this->adt_def;
332 }
333
339 public function getADT()
340 {
341 if(!$this->adt instanceof ilADT)
342 {
343 $this->adt = ilADTFactory::getInstance()->getInstanceByDefinition($this->getADTDefinition());
344 }
345 return $this->adt;
346 }
347
354 protected function setADT(ilADT $a_adt)
355 {
356 if(!$this->adt instanceof ilADT)
357 {
358 $this->adt = $a_adt;
359 }
360 }
361
362 //
363 // properties
364 //
365
371 protected function setFieldId($a_id)
372 {
373 $this->field_id = (int)$a_id;
374 }
375
381 public function getFieldId()
382 {
383 return $this->field_id;
384 }
385
391 public function setRecordId($a_id)
392 {
393 $this->record_id = (int)$a_id;
394 }
395
401 public function getRecordId()
402 {
403 return $this->record_id;
404 }
405
411 public function setImportId($a_id_string)
412 {
413 if($a_id_string !== null)
414 {
415 $a_id_string = trim($a_id_string);
416 }
417 $this->import_id = $a_id_string;
418 }
419
425 public function getImportId()
426 {
427 return $this->import_id;
428 }
429
435 public function setPosition($a_pos)
436 {
437 $this->position = (int)$a_pos;
438 }
439
445 public function getPosition()
446 {
447 return $this->position;
448 }
449
455 public function setTitle($a_title)
456 {
457 if($a_title !== null)
458 {
459 $a_title = trim($a_title);
460 }
461 $this->title = $a_title;
462 }
463
469 public function getTitle()
470 {
471 return $this->title;
472 }
473
479 public function setDescription($a_desc)
480 {
481 if($a_desc !== null)
482 {
483 $a_desc = trim($a_desc);
484 }
485 $this->description = $a_desc;
486 }
487
493 public function getDescription()
494 {
495 return $this->description;
496 }
497
503 public function isSearchSupported()
504 {
505 return true;
506 }
507
513 public function isFilterSupported()
514 {
515 return true;
516 }
517
523 public function setSearchable($a_status)
524 {
525 // see above
526 if(!$this->isSearchSupported())
527 {
528 $a_status = false;
529 }
530 $this->searchable = (bool)$a_status;
531 }
532
538 public function isSearchable()
539 {
540 return $this->searchable;
541 }
542
548 public function setRequired($a_status)
549 {
550 $this->required = (bool)$a_status;
551 }
552
558 public function isRequired()
559 {
560 return $this->required;
561 }
562
563
564 //
565 // definition (NOT ADT-based)
566 //
567
573 protected function importFieldDefinition(array $a_def)
574 {
575
576 }
577
583 protected function getFieldDefinition()
584 {
585 // type-specific properties
586 }
587
594 {
595 // type-specific properties
596 }
597
604 protected function addCustomFieldToDefinitionForm(ilPropertyFormGUI $a_form, $a_disabled = false)
605 {
606 // type-specific
607 }
608
616 {
617 global $lng;
618
619 $perm = $a_permissions->hasPermissions(
621 $this->getFieldId(),
622 array(
631 ));
632
633 // title
634 $title = new ilTextInputGUI($lng->txt('title'), 'title');
635 $title->setValue($this->getTitle());
636 $title->setSize(20);
637 $title->setMaxLength(70);
638 $title->setRequired(true);
639 $a_form->addItem($title);
640
642 {
643 $title->setDisabled(true);
644 }
645
646 // desc
647 $desc = new ilTextAreaInputGUI($lng->txt('description'), 'description');
648 $desc->setValue($this->getDescription());
649 $desc->setRows(3);
650 $desc->setCols(50);
651 $a_form->addItem($desc);
652
654 {
655 $desc->setDisabled(true);
656 }
657
658 // searchable
659 $check = new ilCheckboxInputGUI($lng->txt('md_adv_searchable'), 'searchable');
660 $check->setChecked($this->isSearchable());
661 $check->setValue(1);
662 $a_form->addItem($check);
663
665 !$this->isSearchSupported())
666 {
667 $check->setDisabled(true);
668 }
669
670 /* required
671 $check = new ilCheckboxInputGUI($lng->txt('md_adv_required'), 'required');
672 $check->setChecked($this->isRequired());
673 $check->setValue(1);
674 $a_form->addItem($check);
675 */
676
677 $this->addCustomFieldToDefinitionForm($a_form,
679 }
680
687 {
688 // type-specific
689 }
690
698 {
699 if(!$a_form->getItemByPostVar("title")->getDisabled())
700 {
701 $this->setTitle($a_form->getInput("title"));
702 }
703 if(!$a_form->getItemByPostVar("description")->getDisabled())
704 {
705 $this->setDescription($a_form->getInput("description"));
706 }
707 if(!$a_form->getItemByPostVar("searchable")->getDisabled())
708 {
709 $this->setSearchable($a_form->getInput("searchable"));
710 }
711
712 if($a_permissions->hasPermission(
714 $this->getFieldId(),
717 {
719 }
720 }
721
723 {
724 return false;
725 }
726
728 {
729 // type-specific
730 }
731
733 {
734 $a_form->getItemByPostVar("title")->setDisabled(true);
735 $a_form->getItemByPostVar("description")->setDisabled(true);
736 $a_form->getItemByPostVar("searchable")->setDisabled(true);
737
738 // checkboxes have no hidden on disabled
739 if($a_form->getInput("searchable"))
740 {
741 $hidden = new ilHiddenInputGUI("searchable");
742 $hidden->setValue(1);
743 $a_form->addItem($hidden);
744 }
745
747 }
748
749
750 //
751 // definition CRUD
752 //
753
759 protected function getLastPosition()
760 {
761 global $ilDB;
762
763 $sql = "SELECT max(position) pos".
764 " FROM adv_mdf_definition".
765 " WHERE record_id = ".$ilDB->quote($this->getRecordId(), "integer");
766 $set = $ilDB->query($sql);
767 if($ilDB->numRows($set))
768 {
769 $pos = $ilDB->fetchAssoc($set);
770 return (int)$pos["pos"];
771 }
772
773 return 0;
774 }
775
782 public function generateImportId($a_field_id)
783 {
784 return 'il_'.IL_INST_ID.'_adv_md_field_'.$a_field_id;
785 }
786
792 protected function getDBProperties()
793 {
794 $fields = array(
795 "field_type" => array("integer", $this->getType()),
796 "record_id" => array("integer", $this->getRecordId()),
797 "import_id" => array("text", $this->getImportId()),
798 "title" => array("text", $this->getTitle()),
799 "description" => array("text", $this->getDescription()),
800 "position" => array("integer", $this->getPosition()),
801 "searchable" => array("integer", $this->isSearchable()),
802 "required" => array("integer", $this->isRequired())
803 );
804
805 $def = $this->getFieldDefinition();
806 if(is_array($def))
807 {
808 $fields["field_values"] = array("text", serialize($def));
809 }
810
811 return $fields;
812 }
813
819 protected function import(array $a_data)
820 {
821 $this->setFieldId($a_data["field_id"]);
822
823 $this->setRecordId($a_data["record_id"]);
824 $this->setImportId($a_data["import_id"]);
825 $this->setTitle($a_data["title"]);
826 $this->setDescription($a_data["description"]);
827 $this->setPosition($a_data["position"]);
828 $this->setSearchable($a_data["searchable"]);
829 $this->setRequired($a_data["required"]);
830
831 if($a_data["field_values"])
832 {
833 $this->importFieldDefinition(unserialize($a_data["field_values"]));
834 }
835 }
836
840 protected function read($a_field_id)
841 {
842 global $ilDB;
843
844 if(!(int)$a_field_id)
845 {
846 return;
847 }
848
849 $sql = "SELECT * FROM adv_mdf_definition".
850 " WHERE field_id = ".$ilDB->quote($a_field_id, "integer");
851 $set = $ilDB->query($sql);
852 if($ilDB->numRows($set))
853 {
854 $row = $ilDB->fetchAssoc($set);
855 $this->import($row);
856 }
857 }
858
862 public function save()
863 {
864 global $ilDB;
865
866 if($this->getFieldId())
867 {
868 return $this->update();
869 }
870
871 $next_id = $ilDB->nextId("adv_mdf_definition");
872
873 // append
874 $this->setPosition($this->getLastPosition()+1);
875
876 // needs unique import id
877 if(!$this->getImportId())
878 {
879 $this->setImportId($this->generateImportId($next_id));
880 }
881
882 $fields = $this->getDBProperties();
883 $fields["field_id"] = array("integer", $next_id);
884
885 $ilDB->insert("adv_mdf_definition", $fields);
886
887 $this->setFieldId($next_id);
888 }
889
893 public function update()
894 {
895 global $ilDB;
896
897 if(!$this->getFieldId())
898 {
899 return $this->save();
900 }
901
902 $ilDB->update("adv_mdf_definition",
903 $this->getDBProperties(),
904 array("field_id"=>array("integer", $this->getFieldId())));
905 }
906
910 public function delete()
911 {
912 global $ilDB;
913
914 if(!$this->getFieldId())
915 {
916 return;
917 }
918
919 // delete all values
920 include_once("Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php");
922
923 $query = "DELETE FROM adv_mdf_definition".
924 " WHERE field_id = ".$ilDB->quote($this->getFieldId(), "integer");
925 $ilDB->manipulate($query);
926 }
927
928
929 //
930 // export/import
931 //
932
940 public function toXML(ilXmlWriter $a_writer)
941 {
942 $a_writer->xmlStartTag('Field',array(
943 'id' => $this->generateImportId($this->getFieldId()),
944 'searchable' => ($this->isSearchable() ? 'Yes' : 'No'),
945 'fieldType' => self::getTypeString($this->getType())));
946
947 $a_writer->xmlElement('FieldTitle',null,$this->getTitle());
948 $a_writer->xmlElement('FieldDescription',null,$this->getDescription());
949 $a_writer->xmlElement('FieldPosition',null,$this->getPosition());
950
951 $this->addPropertiesToXML($a_writer);
952
953 $a_writer->xmlEndTag('Field');
954 }
955
961 protected function addPropertiesToXML(ilXmlWriter $a_writer)
962 {
963 // type-specific properties
964 }
965
972 public function importXMLProperty($a_key, $a_value)
973 {
974
975 }
976
983 abstract public function getValueForXML(ilADT $element);
984
990 abstract public function importValueFromXML($a_cdata);
991
1000 public function importFromECS($a_ecs_type, $a_value, $a_sub_id)
1001 {
1002 return false;
1003 }
1004
1005
1006 //
1007 // presentation
1008 //
1009
1015 public function prepareElementForEditor(ilADTFormBridge $a_bridge)
1016 {
1017 // type-specific
1018 }
1019
1020
1021 //
1022 // search
1023 //
1024
1031 public function getSearchQueryParserValue(ilADTSearchBridge $a_adt_search)
1032 {
1033 return '';
1034 }
1035
1042 public function getSearchValueSerialized(ilADTSearchBridge $a_adt_search)
1043 {
1044 return $a_adt_search->getSerializedValue();
1045 }
1046
1053 public function setSearchValueSerialized(ilADTSearchBridge $a_adt_search, $a_value)
1054 {
1055 return $a_adt_search->setSerializedValue($a_value);
1056 }
1057
1065 protected function parseSearchObjects(array $a_records, array $a_object_types)
1066 {
1067 global $ilDB;
1068
1069 $res = array();
1070
1071 $obj_ids = array();
1072 foreach($a_records as $record)
1073 {
1074 if($record["sub_type"] == "-")
1075 {
1076 $obj_ids[] = $record["obj_id"];
1077 }
1078 }
1079
1080 $sql = "SELECT obj_id,type".
1081 " FROM object_data".
1082 " WHERE ".$ilDB->in("obj_id", $obj_ids, "", "integer").
1083 " AND ".$ilDB->in("type", $a_object_types, "", "text");
1084 $set = $ilDB->query($sql);
1085 while($row = $ilDB->fetchAssoc($set))
1086 {
1087 $res[] = $row;
1088 }
1089
1090 return $res;
1091 }
1092
1093 public function searchSubObjects(ilADTSearchBridge $a_adt_search, $a_obj_id, $sub_obj_type)
1094 {
1095 include_once('Services/ADT/classes/ActiveRecord/class.ilADTActiveRecordByType.php');
1097
1098 // :TODO:
1099 if($a_adt_search instanceof ilADTLocationSearchBridgeSingle)
1100 {
1101 $element_id = "loc";
1102 }
1103
1104 $condition = $a_adt_search->getSQLCondition($element_id);
1105 if($condition)
1106 {
1107 $objects = ilADTActiveRecordByType::find("adv_md_values", $this->getADT()->getType(), $this->getFieldId(), $condition);
1108 if(sizeof($objects))
1109 {
1110 $res = array();
1111 foreach($objects as $item)
1112 {
1113 if($item["obj_id"] == $a_obj_id &&
1114 $item["sub_type"] == $sub_obj_type)
1115 {
1116 $res[] = $item["sub_id"];
1117 }
1118 }
1119 return $res;
1120 }
1121 }
1122
1123 return array();
1124 }
1125
1136 public function searchObjects(ilADTSearchBridge $a_adt_search, ilQueryParser $a_parser, array $a_object_types, $a_locate, $a_search_type)
1137 {
1138 // search type only supported/needed for text
1139
1140 include_once('Services/ADT/classes/ActiveRecord/class.ilADTActiveRecordByType.php');
1142 if($condition)
1143 {
1144 $objects = ilADTActiveRecordByType::find("adv_md_values", $this->getADT()->getType(), $this->getFieldId(), $condition, $a_locate);
1145 if(sizeof($objects))
1146 {
1147 return $this->parseSearchObjects($objects, $a_object_types);
1148 }
1149 return array();
1150 }
1151 }
1152
1159 public function getLuceneSearchString($a_value)
1160 {
1161 return $a_value;
1162 }
1163
1170 {
1171 // type-specific
1172 }
1173}
1174
1175?>
static find($a_table, $a_type, $a_field_id, $a_condition, $a_additional_fields=null)
Find entries.
ADT definition base class.
static getInstance()
Get singleton.
ADT form bridge base class.
ADT search bridge base class.
setSerializedValue($a_value)
Set current value(s) in serialized form (for easy persisting)
getSQLCondition($a_element_id)
Get SQL condition for current value(s)
getSerializedValue()
Get current value(s) in serialized form (for easy persisting)
ADT base class.
Definition: class.ilADT.php:12
getLuceneSearchString($a_value)
Get search string in lucene syntax.
getLastPosition()
Get last position of record.
importXMLProperty($a_key, $a_value)
Import property from XML.
static getInstanceByTypeString($a_type)
Get instance by type string (used by import)
importFromECS($a_ecs_type, $a_value, $a_sub_id)
Import meta data from ECS.
static getInstanceByImportId($a_import_id)
Get definition instance by import id.
addPropertiesToXML(ilXmlWriter $a_writer)
Add (type-specific) properties to xml export.
importFieldDefinition(array $a_def)
Import (type-specific) field definition from DB.
getSearchValueSerialized(ilADTSearchBridge $a_adt_search)
Get value for search persistence.
static getInstance($a_field_id, $a_type=null)
Get definition instance by type.
static getADTGroupForDefinitions(array $a_defs)
Init ADTGroup for definitions.
initADTDefinition()
Init adt instance.
static getInstancesByObjType($a_obj_type, $a_active_only=true)
isSearchSupported()
Is search supported at all.
parseSearchObjects(array $a_records, array $a_object_types)
Add object-data needed for global search to AMD search results.
getSearchQueryParserValue(ilADTSearchBridge $a_adt_search)
Get value for search query parser.
getADTDefinition()
Get ADT definition instance.
importDefinitionFormPostValues(ilPropertyFormGUI $a_form, ilAdvancedMDPermissionHelper $a_permissions)
Import post values from definition form.
getFieldDefinition()
Get (type-specific) field definition.
read($a_field_id)
Read field definition
addToFieldDefinitionForm(ilPropertyFormGUI $a_form, ilAdvancedMDPermissionHelper $a_permissions)
Add input elements to definition form.
getFieldDefinitionForTableGUI()
Parse properties for table gui.
getDBProperties()
Get all definition properties for DB.
searchSubObjects(ilADTSearchBridge $a_adt_search, $a_obj_id, $sub_obj_type)
setSearchValueSerialized(ilADTSearchBridge $a_adt_search, $a_value)
Set value from search persistence.
static getTypeString($a_type)
Get type string.
generateImportId($a_field_id)
Generate unique record id.
importValueFromXML($a_cdata)
Import value from xml.
prepareElementForSearch(ilADTSearchBridge $a_bridge)
Prepare search form elements.
static getSearchableDefinitionIds()
Get searchable definition ids (performance is key)
isFilterSupported()
Is search by filter supported.
searchObjects(ilADTSearchBridge $a_adt_search, ilQueryParser $a_parser, array $a_object_types, $a_locate, $a_search_type)
Search objects.
prepareElementForEditor(ilADTFormBridge $a_bridge)
Prepare editor form elements.
prepareDefinitionFormConfirmation(ilPropertyFormGUI $a_form)
static getInstancesByRecordId($a_record_id, $a_only_searchable=false)
Get definitions by record id.
prepareCustomDefinitionFormConfirmation(ilPropertyFormGUI $a_form)
__construct($a_field_id=null)
Constructor.
getValueForXML(ilADT $element)
Parse ADT value for xml (export)
static isValidType($a_type)
Is given type valid.
addCustomFieldToDefinitionForm(ilPropertyFormGUI $a_form, $a_disabled=false)
Add custom input elements to definition form.
importCustomDefinitionFormPostValues(ilPropertyFormGUI $a_form)
Import custom post values from definition form.
Advanced metadata permission helper
static _deleteByFieldId($a_field_id, ilADT $a_adt)
Delete values by field_id.
This class represents a checkbox property in a property form.
hasPermission($a_context_type, $a_context_id, $a_action_id, $a_action_sub_id=null)
Check permission.
hasPermissions($a_context_type, $a_context_id, array $a_action_ids)
Check permissions.
Base class for ILIAS Exception handling.
This class represents a hidden form property in a property form.
This class represents a property form user interface.
addItem($a_item)
Add Item (Property, SectionHeader).
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
getItemByPostVar($a_post_var)
Get Item by POST variable.
This class represents a text area property in a property form.
This class represents a text property in a property form.
XML writer class.
xmlEndTag($tag)
Writes an endtag.
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
xmlElement($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
Writes a basic element (no children, just textual content)
global $lng
Definition: privfeed.php:40
global $ilDB