ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
class.ilSoapObjectAdministration.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
29{
33 public function getObjIdByImportId(string $sid, string $import_id)
34 {
35 $this->initAuth($sid);
36 $this->initIlias();
37
38 if (!$this->checkSession($sid)) {
39 return $this->raiseError($this->getMessage(), $this->getMessageCode());
40 }
41 if (!$import_id) {
42 return $this->raiseError(
43 'No import id given.',
44 'Client'
45 );
46 }
47
48 global $DIC;
49
50 $ilLog = $DIC['ilLog'];
51 $obj_id = ilObject::_lookupObjIdByImportId($import_id);
52 $ilLog->write("SOAP getObjIdByImportId(): import_id = " . $import_id . ' obj_id = ' . $obj_id);
53 return $obj_id ?: "0";
54 }
55
59 public function getRefIdsByImportId(string $sid, string $import_id)
60 {
61 $this->initAuth($sid);
62 $this->initIlias();
63
64 if (!$this->checkSession($sid)) {
65 return $this->raiseError($this->getMessage(), $this->getMessageCode());
66 }
67 if (!$import_id) {
68 return $this->raiseError(
69 'No import id given.',
70 'Client'
71 );
72 }
73
74 global $DIC;
75
76 $tree = $DIC->repositoryTree();
77 $obj_id = ilObject::_lookupObjIdByImportId($import_id);
78 $ref_ids = ilObject::_getAllReferences($obj_id);
79
80 $new_refs = [];
81 foreach ($ref_ids as $ref_id) {
82 if ($tree->isInTree($ref_id)) {
83 $new_refs[] = $ref_id;
84 }
85 }
86 return $new_refs;
87 }
88
92 public function getRefIdsByObjId(string $sid, int $obj_id)
93 {
94 $this->initAuth($sid);
95 $this->initIlias();
96
97 if (!$this->checkSession($sid)) {
98 return $this->raiseError($this->getMessage(), $this->getMessageCode());
99 }
100 if (!$obj_id) {
101 return $this->raiseError(
102 'No object id given.',
103 'Client'
104 );
105 }
106
107 $ref_ids = ilObject::_getAllReferences($obj_id);
108 $new_refs = [];
109 foreach ($ref_ids as $ref_id) {
110 $new_refs[] = $ref_id;
111 }
112 return $new_refs;
113 }
114
118 public function getObjIdsByRefIds(string $sid, array $ref_ids)
119 {
120 $this->initAuth($sid);
121 $this->initIlias();
122
123 if (!$this->checkSession($sid)) {
124 return $this->raiseError($this->getMessage(), $this->getMessageCode());
125 }
126
127 if (!count($ref_ids)) {
128 return $this->raiseError('No reference id(s) given.', 'Client');
129 }
130
131 $obj_ids = [];
132 foreach ($ref_ids as $ref_id) {
133 $ref_id = trim($ref_id);
134 if (!is_numeric($ref_id)) {
135 return $this->raiseError('Reference ID has to be numeric. Value: ' . $ref_id, 'Client');
136 }
137
139 if (!$obj_id) {
140 return $this->raiseError('No object found for reference ID. Value: ' . $ref_id, 'Client');
141 }
142 if (!ilObject::_hasUntrashedReference($obj_id)) {
143 return $this->raiseError(
144 'No untrashed reference found for reference ID. Value: ' . $ref_id,
145 'Client'
146 );
147 }
148 $obj_ids[] = $obj_id;
149 }
150
151 return $obj_ids;
152 }
153
157 public function getObjectByReference(string $sid, int $a_ref_id, ?int $user_id = null)
158 {
159 $this->initAuth($sid);
160 $this->initIlias();
161
162 if (!$this->checkSession($sid)) {
163 return $this->raiseError($this->getMessage(), $this->getMessageCode());
164 }
165
166 if (!$tmp_obj = ilObjectFactory::getInstanceByRefId($a_ref_id, false)) {
167 return $this->raiseError('Cannot create object instance!', 'Server');
168 }
169 if (ilObject::_isInTrash($a_ref_id)) {
170 return $this->raiseError("Object with ID $a_ref_id has been deleted.", 'Client');
171 }
172
173 $xml_writer = new ilObjectXMLWriter();
174 $xml_writer->enablePermissionCheck(true);
175 if (is_int($user_id)) {
176 $xml_writer->setUserId($user_id);
177 $xml_writer->enableOperations(true);
178 }
179 $xml_writer->setObjects(array($tmp_obj));
180 if ($xml_writer->start()) {
181 return $xml_writer->getXML();
182 }
183 return $this->raiseError('Cannot create object xml !', 'Server');
184 }
185
189 public function getObjectsByTitle(string $sid, string $a_title, ?int $user_id = null)
190 {
191 $this->initAuth($sid);
192 $this->initIlias();
193
194 if (!$this->checkSession($sid)) {
195 return $this->raiseError($this->getMessage(), $this->getMessageCode());
196 }
197 if ($a_title === '') {
198 return $this->raiseError(
199 'No valid query string given.',
200 'Client'
201 );
202 }
203 $query_parser = new ilQueryParser($a_title);
204 $query_parser->setMinWordLength(0);
205 $query_parser->setCombination(ilQueryParser::QP_COMBINATION_AND);
206 $query_parser->parse();
207 if (!$query_parser->validate()) {
208 return $this->raiseError(
209 $query_parser->getMessage(),
210 'Client'
211 );
212 }
213
214 $object_search = new ilLikeObjectSearch($query_parser);
215 $object_search->setFields(array('title'));
216 $object_search->appendToFilter('role');
217 $object_search->appendToFilter('rolt');
218 $res = $object_search->performSearch();
219 if ($user_id) {
220 $res->setUserId($user_id);
221 }
222
223 $res->filter(ROOT_FOLDER_ID, true);
224
225 $objs = array();
226 foreach ($res->getUniqueResults() as $entry) {
227 if ($entry['type'] === 'role' || $entry['type'] === 'rolt') {
228 if ($tmp = ilObjectFactory::getInstanceByObjId($entry['obj_id'], false)) {
229 $objs[] = $tmp;
230 }
231 continue;
232 }
233 if ($tmp = ilObjectFactory::getInstanceByRefId($entry['ref_id'], false)) {
234 $objs[] = $tmp;
235 }
236 }
237 if (!count($objs)) {
238 return '';
239 }
240
241 $xml_writer = new ilObjectXMLWriter();
242 $xml_writer->enablePermissionCheck(true);
243 if (is_int($user_id)) {
244 $xml_writer->setUserId($user_id);
245 $xml_writer->enableOperations(true);
246 }
247 $xml_writer->setObjects($objs);
248 if ($xml_writer->start()) {
249 return $xml_writer->getXML();
250 }
251 return $this->raiseError('Cannot create object xml !', 'Server');
252 }
253
257 public function searchObjects(string $sid, ?array $types, string $key, string $combination, ?int $user_id = null)
258 {
259 $this->initAuth($sid);
260 $this->initIlias();
261
262 if (!$this->checkSession($sid)) {
263 return $this->raiseError($this->getMessage(), $this->getMessageCode());
264 }
265
266 if ($combination !== 'and' && $combination !== 'or') {
267 return $this->raiseError(
268 'No valid combination given. Must be "and" or "or".',
269 'Client'
270 );
271 }
272
273 $highlighter = null;
274 if (ilSearchSettings::getInstance()->enabledLucene()) {
275 ilSearchSettings::getInstance()->setMaxHits(25);
276
277 $typeFilterQuery = '';
278 if (is_array($types)) {
279 foreach ($types as $objectType) {
280 if ($typeFilterQuery === '') {
281 $typeFilterQuery .= '+( ';
282 } else {
283 $typeFilterQuery .= 'OR';
284 }
285 $typeFilterQuery .= (' type:' . $objectType . ' ');
286 }
287 $typeFilterQuery .= ') ';
288 }
289
290 $query_parser = new ilLuceneQueryParser($typeFilterQuery . $key);
291 $query_parser->parse();
292
293 $searcher = ilLuceneSearcher::getInstance($query_parser);
294 $searcher->search();
295
297 $filter->setCandidates($searcher->getResult());
298 $filter->filter();
299
300 $result_ids = $filter->getResults();
301 $objs = array();
303 foreach ($result_ids as $ref_id => $obj_id) {
305 if ($obj instanceof ilObject) {
306 $objs[] = $obj;
307 }
308 }
309 $highlighter = new ilLuceneHighlighterResultParser();
310 if ($filter->getResultObjIds()) {
311 $highlighter = $searcher->highlight($filter->getResultObjIds());
312 }
313 } else {
314
315 $query_parser = new ilQueryParser($key);
316 $query_parser->setCombination($combination === 'and' ? ilQueryParser::QP_COMBINATION_AND : ilQueryParser::QP_COMBINATION_OR);
317 $query_parser->parse();
318 if (!$query_parser->validate()) {
319 return $this->raiseError(
320 $query_parser->getMessage(),
321 'Client'
322 );
323 }
324
325 $object_search = new ilLikeObjectSearch($query_parser);
326 $object_search->setFilter($types);
327 $res = $object_search->performSearch();
328 if (is_int($user_id)) {
329 $res->setUserId($user_id);
330 }
331 $res->setMaxHits(100);
332 $res->filter(ROOT_FOLDER_ID, $combination === 'and');
333 $counter = 0;
334 $objs = array();
335 foreach ($res->getUniqueResults() as $entry) {
336 $obj = ilObjectFactory::getInstanceByRefId($entry['ref_id'], false);
337 if ($obj instanceof ilObject) {
338 $objs[] = $obj;
339 }
340 }
341 }
342
343 if (!count($objs)) {
344 return '';
345 }
346
347 $xml_writer = new ilObjectXMLWriter();
348 if (ilSearchSettings::getInstance()->enabledLucene()) {
349 $xml_writer->enableReferences(false);
350 $xml_writer->setMode(ilObjectXMLWriter::MODE_SEARCH_RESULT);
351 $xml_writer->setHighlighter($highlighter);
352 }
353
354 $xml_writer->enablePermissionCheck(true);
355
356 if ($user_id) {
357 $xml_writer->setUserId($user_id);
358 $xml_writer->enableOperations(true);
359 }
360
361 $xml_writer->setObjects($objs);
362 if ($xml_writer->start()) {
363 return $xml_writer->getXML();
364 }
365
366 return $this->raiseError('Cannot create object xml !', 'Server');
367 }
368
372 public function getTreeChilds(string $sid, int $ref_id, ?array $types = null, ?int $user_id = null)
373 {
374 $this->initAuth($sid);
375 $this->initIlias();
376
377 if (!$this->checkSession($sid)) {
378 return $this->raiseError($this->getMessage(), $this->getMessageCode());
379 }
380
381 $all = false;
382
383 global $DIC;
384
385 $tree = $DIC['tree'];
386
387 if (!$target_obj = ilObjectFactory::getInstanceByRefId($ref_id, false)) {
388 return $this->raiseError(
389 'No valid reference id given.',
390 'Client'
391 );
392 }
393 if ($ref_id === SYSTEM_FOLDER_ID) {
394 return $this->raiseError(
395 'No valid reference id given.',
396 'Client'
397 );
398 }
399
400 if (!is_array($types) || empty($types)) {
401 $all = true;
402 }
403
404 $objs = array();
405
406 foreach ($tree->getChilds($ref_id, 'title') as $child) {
407 if ($all || in_array($child['type'], $types, true)) {
408 if ($tmp = ilObjectFactory::getInstanceByRefId($child['ref_id'], false)) {
409 $objs[] = $tmp;
410 }
411 }
412 }
413
414 $xml_writer = new ilObjectXMLWriter();
415 $xml_writer->enablePermissionCheck(true);
416 $xml_writer->setObjects($objs);
417 $xml_writer->enableOperations(true);
418 if (is_int($user_id)) {
419 $xml_writer->setUserId($user_id);
420 }
421
422 if ($xml_writer->start()) {
423 return $xml_writer->getXML();
424 }
425 return $this->raiseError('Cannot create object xml !', 'Server');
426 }
427
431 public function getXMLTree(string $sid, int $ref_id, ?array $types = null, ?int $user_id = null)
432 {
433 $this->initAuth($sid);
434 $this->initIlias();
435
436 if (!$this->checkSession($sid)) {
437 return $this->raiseError($this->getMessage(), $this->getMessageCode());
438 }
439
440 global $DIC;
441
442 $tree = $DIC['tree'];
443 $access = $DIC['ilAccess'];
444
445 $nodedata = $tree->getNodeData($ref_id);
446 $nodearray = $tree->getSubTree($nodedata);
447
448 $all = false;
449 if (!is_array($types) || empty($types)) {
450 $all = true;
451 }
452
453 $filter = $types;
454
455 global $DIC;
456
457 $objDefinition = $DIC['objDefinition'];
458 $nodes = [];
459 foreach ($nodearray as $node) {
460 if (
461 !$objDefinition->isAdministrationObject($node['type']) &&
462 !$objDefinition->isSystemObject($node['type']) &&
463 ($all || !in_array($node['type'], $filter, true)) &&
464 $access->checkAccess("read", "", (int) $node['ref_id']) &&
465 ($tmp = ilObjectFactory::getInstanceByRefId($node['ref_id'], false))
466 ) {
467 $nodes[] = $tmp;
468 }
469 }
470
471 $xml_writer = new ilObjectXMLWriter();
472 $xml_writer->enablePermissionCheck(true);
473 $xml_writer->setObjects($nodes);
474 $xml_writer->enableOperations(false);
475
476 if (is_int($user_id)) {
477 $xml_writer->setUserId($user_id);
478 }
479
480 if ($xml_writer->start()) {
481 return $xml_writer->getXML();
482 }
483
484 return $this->raiseError('Cannot create object xml !', 'Server');
485 }
486
490 public function addObject(string $sid, int $a_target_id, string $a_xml)
491 {
492 $this->initAuth($sid);
493 $this->initIlias();
494
495 if (!$this->checkSession($sid)) {
496 return $this->raiseError($this->getMessage(), $this->getMessageCode());
497 }
498 if ($a_xml === '') {
499 return $this->raiseError(
500 'No valid xml string given.',
501 'Client'
502 );
503 }
504
505 global $DIC;
506
507 $rbacsystem = $DIC['rbacsystem'];
508 $objDefinition = $DIC['objDefinition'];
509 $ilUser = $DIC['ilUser'];
510 $lng = $DIC['lng'];
511 $ilObjDataCache = $DIC['ilObjDataCache'];
512
513 if (!$target_obj = ilObjectFactory::getInstanceByRefId($a_target_id, false)) {
514 return $this->raiseError(
515 'No valid target given.',
516 'Client'
517 );
518 }
519
520 if (ilObject::_isInTrash($a_target_id)) {
521 return $this->raiseError("Parent with ID $a_target_id has been deleted.", 'Client');
522 }
523
524 $allowed_types = array('root', 'cat', 'grp', 'crs', 'fold');
525 if (!in_array($target_obj->getType(), $allowed_types)) {
526 return $this->raiseError(
527 'No valid target type. Target must be reference id of "course, group, category or folder"',
528 'Client'
529 );
530 }
531
532 $allowed_subtypes = $target_obj->getPossibleSubObjects();
533 $allowed = [];
534 foreach ($allowed_subtypes as $row) {
535 if ($row['name'] !== 'rolf') {
536 $allowed[] = $row['name'];
537 }
538 }
539
540
541 $xml_parser = new ilObjectXMLParser($a_xml, true);
542 try {
543 $xml_parser->startParsing();
544 } catch (ilSaxParserException $se) {
545 return $this->raiseError($se->getMessage(), 'Client');
546 } catch (ilObjectXMLException $e) {
547 return $this->raiseError($e->getMessage(), 'Client');
548 }
549
550 $newObj = null;
551 foreach ($xml_parser->getObjectData() as $object_data) {
552 $res = $this->validateReferences('create', $object_data, $a_target_id);
553 if ($this->isFault($res)) {
554 return $res;
555 }
556
557 // Check possible subtype
558 if (!in_array($object_data['type'], $allowed, true)) {
559 return $this->raiseError(
560 'Objects of type: ' . $object_data['type'] . ' are not allowed to be subobjects of type ' .
561 $target_obj->getType() . '!',
562 'Client'
563 );
564 }
565 if (!$rbacsystem->checkAccess('create', $a_target_id, $object_data['type'])) {
566 return $this->raiseError(
567 'No permission to create objects of type ' . $object_data['type'] . '!',
568 'Client'
569 );
570 }
571
572 // It's not possible to add objects with non unique import ids
573 if ($object_data['import_id'] != '' && ilObject::_lookupObjIdByImportId($object_data['import_id'])) {
574 return $this->raiseError(
575 'An object with import id ' . $object_data['import_id'] . ' already exists!',
576 'Server'
577 );
578 }
579
580 // call gui object method
581 $class_name = $objDefinition->getClassName($object_data['type']);
582 $location = $objDefinition->getLocation($object_data['type']);
583
584 $class_constr = "ilObj" . $class_name;
585
586 $newObj = new $class_constr();
587 if (isset($object_data['owner']) && $object_data['owner'] != '') {
588 if ((int) $object_data['owner']) {
589 if (
590 ilObject::_exists((int) $object_data['owner']) &&
591 $ilObjDataCache->lookupType((int) $object_data['owner']) === 'usr'
592 ) {
593 $newObj->setOwner((int) $object_data['owner']);
594 }
595 } else {
596 $usr_id = ilObjUser::_lookupId(trim($object_data['owner']));
597 if ((int) $usr_id) {
598 $newObj->setOwner((int) $usr_id);
599 }
600 }
601 }
602
603 $newObj->setType($object_data['type']);
604 if ($object_data['import_id'] != '') {
605 $newObj->setImportId($object_data['import_id']);
606 }
607
608 $newObj->setTitle($object_data['title']);
609 $newObj->setDescription($object_data['description']);
610 $newObj->create(); // true for upload
611 if ($objDefinition->supportsOfflineHandling($newObj->getType()) && isset($object_data['offline'])) {
612 $newObj->setOfflineStatus((bool) $object_data['offline']);
613 $newObj->update();
614 }
615 $newObj->createReference();
616 $newObj->putInTree($a_target_id);
617 $newObj->setPermissions($a_target_id);
618
619 switch ($object_data['type']) {
620 case 'grp':
621 // Add member
622 $newObj->addMember(
623 $object_data['owner'] ?: $ilUser->getId(),
624 $newObj->getDefaultAdminRole()
625 );
626 break;
627
628 case 'crs':
629 $newObj->getMemberObject()->add($ilUser->getId(), ilParticipants::IL_CRS_ADMIN);
630 break;
631 case 'lm':
632 $newObj->createLMTree();
633 break;
634 case 'cat':
636 $newObj->addTranslation(
637 $object_data["title"],
638 $object_data["description"],
639 $lng->getLangKey(),
640 true
641 );
642 break;
643 }
644
645 $this->addReferences($newObj, $object_data);
646 }
647 if (!$newObj instanceof ilObject) {
648 return 0;
649 }
650 $ref_id = $newObj->getRefId();
651 return $ref_id ?: "0";
652 }
653
657 public function addReference(string $sid, int $a_source_id, int $a_target_id)
658 {
659 $this->initAuth($sid);
660 $this->initIlias();
661
662 if (!$this->checkSession($sid)) {
663 return $this->raiseError($this->getMessage(), $this->getMessageCode());
664 }
665
666 global $DIC;
667
668 $objDefinition = $DIC['objDefinition'];
669 $rbacsystem = $DIC['rbacsystem'];
670 $tree = $DIC['tree'];
671
672 if (!$source_obj = ilObjectFactory::getInstanceByRefId($a_source_id, false)) {
673 return $this->raiseError(
674 'No valid source id given.',
675 'Client'
676 );
677 }
678 if (!$target_obj = ilObjectFactory::getInstanceByRefId($a_target_id, false)) {
679 return $this->raiseError(
680 'No valid target id given.',
681 'Client'
682 );
683 }
684
685 if (
686 !$objDefinition->allowLink($source_obj->getType()) and
687 $source_obj->getType() !== 'cat' and
688 $source_obj->getType() !== 'crs'
689 ) {
690 return $this->raiseError(
691 'Linking of object type: ' . $source_obj->getType() . ' is not allowed',
692 'Client'
693 );
694 }
695
696 $allowed_subtypes = $target_obj->getPossibleSubObjects();
697 $allowed = [];
698 foreach ($allowed_subtypes as $row) {
699 if ($row['name'] !== 'rolf') {
700 $allowed[] = $row['name'];
701 }
702 }
703 if (!in_array($source_obj->getType(), $allowed, true)) {
704 return $this->raiseError(
705 'Objects of type: ' . $source_obj->getType() . ' are not allowed to be subobjects of type ' .
706 $target_obj->getType() . '!',
707 'Client'
708 );
709 }
710
711 // Permission checks
712 if (!$rbacsystem->checkAccess('create', $target_obj->getRefId(), $source_obj->getType())) {
713 return $this->raiseError(
714 'No permission to create objects of type ' . $source_obj->getType() . '!',
715 'Client'
716 );
717 }
718 if (!$rbacsystem->checkAccess('delete', $source_obj->getRefId())) {
719 return $this->raiseError(
720 'No permission to link object with id: ' . $source_obj->getRefId() . '!',
721 'Client'
722 );
723 }
724
725 if ($source_obj->getType() !== 'cat' and $source_obj->getType() !== 'crs') {
726 // check if object already linked to target
727 $possibleChilds = $tree->getChildsByType($target_obj->getRefId(), $source_obj->getType());
728 foreach ($possibleChilds as $child) {
729 if ((int) $child["obj_id"] === $source_obj->getId()) {
730 return $this->raiseError("Object already linked to target.", "Client");
731 }
732 }
733
734 // Finally link it to target position
735
736 $new_ref_id = $source_obj->createReference();
737 $source_obj->putInTree($target_obj->getRefId());
738 $source_obj->setPermissions($target_obj->getRefId());
739
740 return $new_ref_id ?: "0";
741 }
742
743 $new_ref = null;
744 switch ($source_obj->getType()) {
745 case 'cat':
746 $new_ref = new ilObjCategoryReference();
747 break;
748
749 case 'crs':
750 $new_ref = new ilObjCourseReference();
751 break;
752 case 'grp':
753 $new_ref = new ilObjGroupReference();
754 break;
755 }
756 $new_ref->create();
757 $new_ref_id = $new_ref->createReference();
758
759 $new_ref->putInTree($target_obj->getRefId());
760 $new_ref->setPermissions($target_obj->getRefId());
761
762 $new_ref->setTargetId($source_obj->getId());
763 $new_ref->update();
764
765 if (!$new_ref instanceof ilObject) {
766 return 0;
767 }
768
769 return $new_ref_id ?: 0;
770 }
771
775 public function deleteObject(string $sid, int $reference_id)
776 {
777 $this->initAuth($sid);
778 $this->initIlias();
779
780 if (!$this->checkSession($sid)) {
781 return $this->raiseError($this->getMessage(), $this->getMessageCode());
782 }
783
784 global $DIC;
785
786 $tree = $DIC->repositoryTree();
787 $rbacsystem = $DIC['rbacsystem'];
788 $rbacadmin = $DIC['rbacadmin'];
789 $user = $DIC->user();
790
791 if (!$del_obj = ilObjectFactory::getInstanceByRefId($reference_id, false)) {
792 return $this->raiseError(
793 'No valid reference id given.',
794 'Client'
795 );
796 }
797 if (!$rbacsystem->checkAccess('delete', $del_obj->getRefId())) {
798 return $this->raiseError(
799 'No permission to delete object with id: ' . $del_obj->getRefId() . '!',
800 'Client'
801 );
802 }
803
804 if ($tree->isDeleted($reference_id)) {
805 return $this->raiseError('Node already deleted', 'Server');
806 }
807
808 if ($del_obj->getType() === 'rolf') {
809 return $this->raiseError('Delete is not available for role folders.', 'Client');
810 }
811
812 $subnodes = $tree->getSubTree($tree->getNodeData($reference_id));
813 foreach ($subnodes as $subnode) {
814 $rbacadmin->revokePermission($subnode["child"]);
815 }
816 if (!$tree->moveToTrash($reference_id, true, $user->getId())) {
817 return $this->raiseError('Node already deleted', 'Client');
818 }
819 return true;
820 }
821
825 public function removeFromSystemByImportId(string $sid, string $import_id)
826 {
827 $this->initAuth($sid);
828 $this->initIlias();
829
830 if (!$this->checkSession($sid)) {
831 return $this->raiseError($this->getMessage(), $this->getMessageCode());
832 }
833 if ($import_id === '') {
834 return $this->raiseError(
835 'No import id given. Aborting!',
836 'Client'
837 );
838 }
839 global $DIC;
840
841 $rbacsystem = $DIC['rbacsystem'];
842 $tree = $DIC['tree'];
843 $ilLog = $DIC['ilLog'];
844
845 // get obj_id
846 if (!$obj_id = ilObject::_lookupObjIdByImportId($import_id)) {
847 return $this->raiseError(
848 'No object found with import id: ' . $import_id,
849 'Client'
850 );
851 }
852
853 // Check access
854 $permission_ok = false;
855 foreach ($ref_ids = ilObject::_getAllReferences($obj_id) as $ref_id) {
856 if ($rbacsystem->checkAccess('delete', $ref_id)) {
857 $permission_ok = true;
858 break;
859 }
860 }
861 if (!$permission_ok) {
862 return $this->raiseError(
863 'No permission to delete the object with import id: ' . $import_id,
864 'Server'
865 );
866 }
867
868 // Delete all references (delete permssions and entries in object_reference)
869 foreach ($ref_ids as $ref_id) {
870 // All subnodes
871 $node_data = $tree->getNodeData($ref_id);
872 $subtree_nodes = $tree->getSubtree($node_data);
873
874 foreach ($subtree_nodes as $node) {
875 $ilLog->write('Soap: removeFromSystemByImportId(). Deleting object with title id: ' . $node['title']);
876 $tmp_obj = ilObjectFactory::getInstanceByRefId($node['ref_id']);
877 if (!is_object($tmp_obj)) {
878 return $this->raiseError(
879 'Cannot create instance of reference id: ' . $node['ref_id'],
880 'Server'
881 );
882 }
883 $tmp_obj->delete();
884 }
885 // Finally delete tree
886 $tree->deleteTree($node_data);
887 }
888 return true;
889 }
890
894 public function updateObjects(string $sid, string $a_xml)
895 {
896 $this->initAuth($sid);
897 $this->initIlias();
898
899 if (!$this->checkSession($sid)) {
900 return $this->raiseError($this->getMessage(), $this->getMessageCode());
901 }
902 if ($a_xml === '') {
903 return $this->raiseError(
904 'No valid xml string given.',
905 'Client'
906 );
907 }
908
909 global $DIC;
910
911 $rbacreview = $DIC['rbacreview'];
912 $rbacsystem = $DIC['rbacsystem'];
913 $lng = $DIC['lng'];
914 $ilAccess = $DIC['ilAccess'];
915 $objDefinition = $DIC['objDefinition'];
916
917 $xml_parser = new ilObjectXMLParser($a_xml, true);
918 try {
919 $xml_parser->startParsing();
920 } catch (ilSaxParserException $se) {
921 return $this->raiseError($se->getMessage(), 'Client');
922 } catch (ilObjectXMLException $e) {
923 return $this->raiseError($e->getMessage(), 'Client');
924 }
925
926 // Validate incoming data
927 $object_datas = $xml_parser->getObjectData();
928 foreach ($object_datas as &$object_data) {
929 $res = $this->validateReferences('update', $object_data);
930 if ($this->isFault($res)) {
931 return $res;
932 }
933
934 if (!$object_data["obj_id"]) {
935 return $this->raiseError('No obj_id in xml found.', 'Client');
936 } elseif ((int) $object_data["obj_id"] === -1 && count($object_data["references"]) > 0) {
937 // object id might be unknown, resolve references instead to determine object id
938 // all references should point to the same object, so using the first one is ok.
939 foreach ($object_data["references"] as $refid) {
940 if (ilObject::_isInTrash($refid)) {
941 continue;
942 }
943 break;
944 }
945
946 $obj_id_from_refid = ilObject::_lookupObjectId($object_data["references"][0]);
947 if (!$obj_id_from_refid) {
948 return $this->raiseError(
949 'No obj_id found for reference id ' . $object_data["references"][0],
950 'CLIENT_OBJECT_NOT_FOUND'
951 );
952 }
953
954 $tmp_obj = ilObjectFactory::getInstanceByObjId($object_data['obj_id'], false);
955 $object_data["obj_id"] = $obj_id_from_refid;
956 }
957
958 $tmp_obj = ilObjectFactory::getInstanceByObjId($object_data['obj_id'], false);
959 if ($tmp_obj === null) {
960 return $this->raiseError(
961 'No object for id ' . $object_data['obj_id'] . '!',
962 'CLIENT_OBJECT_NOT_FOUND'
963 );
964 }
965
966 $object_data["instance"] = $tmp_obj;
967
968 if ($object_data['type'] === 'role') {
969 $rolf_ids = $rbacreview->getFoldersAssignedToRole($object_data['obj_id'], true);
970 $rolf_id = $rolf_ids[0];
971
972 if (!$rbacsystem->checkAccess('write', $rolf_id)) {
973 return $this->raiseError(
974 'No write permission for object with id ' . $object_data['obj_id'] . '!',
975 'Client'
976 );
977 }
978 } else {
979 $permission_ok = false;
980 foreach (ilObject::_getAllReferences($object_data['obj_id']) as $ref_id) {
981 if ($ilAccess->checkAccess('write', '', $ref_id)) {
982 $permission_ok = true;
983 break;
984 }
985 }
986 if (!$permission_ok) {
987 return $this->raiseError(
988 'No write permission for object with id ' . $object_data['obj_id'] . '!',
989 'Client'
990 );
991 }
992 }
993 }
994 unset($object_data);
995
996 // perform update
997 if (count($object_datas) > 0) {
998 foreach ($object_datas as $object_data) {
999 $this->updateReferences($object_data);
1003 $tmp_obj = $object_data["instance"];
1004 $tmp_obj->setTitle($object_data['title']);
1005 $tmp_obj->setDescription($object_data['description']);
1006
1007 if ($objDefinition->supportsOfflineHandling($tmp_obj->getType())) {
1008 $tmp_obj->setOfflineStatus($object_data['offline']);
1009 }
1010
1011 $tmp_obj->update();
1012 if ($object_data['owner'] != '' && is_numeric($object_data['owner'])) {
1013 $tmp_obj->setOwner($object_data['owner']);
1014 $tmp_obj->updateOwner();
1015 }
1016 }
1017 return true;
1018 }
1019 return false;
1020 }
1021
1025 public function moveObject(string $sid, int $ref_id, int $target_id)
1026 {
1027 $this->initAuth($sid);
1028 $this->initIlias();
1029
1030 if (!$this->checkSession($sid)) {
1031 return $this->raiseError($this->getMessage(), $this->getMessageCode());
1032 }
1033
1034 global $DIC;
1035
1036 $rbacreview = $DIC['rbacreview'];
1037 $rbacadmin = $DIC['rbacadmin'];
1038 $objDefinition = $DIC['objDefinition'];
1039 $rbacsystem = $DIC['rbacsystem'];
1040 $lng = $DIC['lng'];
1041 $ilUser = $DIC['ilUser'];
1042 $tree = $DIC['tree'];
1043
1044 // does source object exist
1045 if (!$source_object_type = ilObjectFactory::getTypeByRefId($ref_id, false)) {
1046 return $this->raiseError('No valid source given.', 'Client');
1047 }
1048
1049 // does target object exist
1050 if (!$target_object_type = ilObjectFactory::getTypeByRefId($target_id, false)) {
1051 return $this->raiseError('No valid target given.', 'Client');
1052 }
1053
1054 // check for trash
1055 if (ilObject::_isInTrash($ref_id)) {
1056 return $this->raiseError('Object is trashed.', 'Client');
1057 }
1058
1059 if (ilObject::_isInTrash($target_id)) {
1060 return $this->raiseError('Object is trashed.', 'Client');
1061 }
1062
1063 $canAddType = $this->canAddType($source_object_type, $target_object_type, $target_id);
1064 if ($this->isFault($canAddType)) {
1065 return $canAddType;
1066 }
1067
1068 // check if object already linked to target
1069 $possibleChilds = $tree->getChildsByType($target_id, $ref_id);
1070 foreach ($possibleChilds as $child) {
1071 if ((int) $child["obj_id"] === $ref_id) {
1072 return $this->raiseError("Object already exists in target.", "Client");
1073 }
1074 }
1075
1076 // CHECK IF PASTE OBJECT SHALL BE CHILD OF ITSELF
1077 if ($tree->isGrandChild($ref_id, $target_id)) {
1078 return $this->raiseError("Cannot move object into itself.", "Client");
1079 }
1080
1081 $old_parent = $tree->getParentId($ref_id);
1082 $tree->moveTree($ref_id, $target_id);
1083 $rbacadmin->adjustMovedObjectPermissions($ref_id, $old_parent);
1084
1086 return true;
1087 }
1088
1092 public function copyObject(string $sid, string $copy_settings_xml)
1093 {
1094 $this->initAuth($sid);
1095 $this->initIlias();
1096
1097 if (!$this->checkSession($sid)) {
1098 return $this->raiseError($this->getMessage(), $this->getMessageCode());
1099 }
1100
1101 global $DIC;
1102
1103 $rbacreview = $DIC['rbacreview'];
1104 $objDefinition = $DIC['objDefinition'];
1105 $rbacsystem = $DIC['rbacsystem'];
1106 $lng = $DIC['lng'];
1107 $ilUser = $DIC['ilUser'];
1108
1109 $xml_parser = new ilCopyWizardSettingsXMLParser($copy_settings_xml);
1110 try {
1111 $xml_parser->startParsing();
1112 } catch (ilSaxParserException $se) {
1113 return $this->raiseError($se->getMessage(), "Client");
1114 }
1115
1116 // checking copy permissions, objects and create permissions
1117 if (!$rbacsystem->checkAccess('copy', $xml_parser->getSourceId())) {
1118 return $this->raiseError(
1119 "Missing copy permissions for object with reference id " . $xml_parser->getSourceId(),
1120 'Client'
1121 );
1122 }
1123
1124 // checking copy permissions, objects and create permissions
1125 $source_id = $xml_parser->getSourceId();
1126 $target_id = $xml_parser->getTargetId();
1127
1128 // does source object exist
1129 if (!$source_object_type = ilObjectFactory::getTypeByRefId($source_id, false)) {
1130 return $this->raiseError('No valid source given.', 'Client');
1131 }
1132
1133 // does target object exist
1134 if (!$target_object_type = ilObjectFactory::getTypeByRefId($xml_parser->getTargetId(), false)) {
1135 return $this->raiseError('No valid target given.', 'Client');
1136 }
1137
1138 $canAddType = $this->canAddType($source_object_type, $target_object_type, $target_id);
1139 if ($this->isFault($canAddType)) {
1140 return $canAddType;
1141 }
1142
1143 // if is container object than clone with sub items
1144 $options = $xml_parser->getOptions();
1145 // print_r($options);
1146 $source_object = ilObjectFactory::getInstanceByRefId($source_id);
1147 if ($source_object instanceof ilContainer) {
1148 // get client id from sid
1149 $clientid = substr($sid, strpos($sid, "::") + 2);
1150 $sessionid = str_replace("::" . $clientid, "", $sid);
1151 // call container clone
1152 $ret = $source_object->cloneAllObject(
1153 $sessionid,
1154 $clientid,
1155 $source_object_type,
1156 $target_id,
1157 $source_id,
1158 $options,
1159 true
1160 );
1161
1162 return $ret['ref_id'];
1163 }
1164
1165 // create copy wizard settings
1167 $wizard_options = ilCopyWizardOptions::_getInstance($copy_id);
1168 $wizard_options->saveOwner($ilUser->getId());
1169 $wizard_options->saveRoot($source_id);
1170
1171 foreach ($options as $source_id => $option) {
1172 $wizard_options->addEntry($source_id, $option);
1173 }
1174 $wizard_options->read();
1175
1176 // call object clone
1177 $newObject = $source_object->cloneObject($xml_parser->getTargetId(), $copy_id);
1178 return is_object($newObject) ? $newObject->getRefId() : -1;
1179 }
1180
1184 public function getPathForRefId(string $sid, int $ref_id)
1185 {
1186 $this->initAuth($sid);
1187 $this->initIlias();
1188
1189 if (!$this->checkSession($sid)) {
1190 return $this->raiseError($this->getMessage(), $this->getMessageCode());
1191 }
1192
1193 global $DIC;
1194
1195 $ilAccess = $DIC['ilAccess'];
1196 $objDefinition = $DIC['objDefinition'];
1197 $rbacsystem = $DIC['rbacsystem'];
1198 $lng = $DIC['lng'];
1199 $ilUser = $DIC['ilUser'];
1200
1201 if (!$rbacsystem->checkAccess('read', $ref_id)) {
1202 return $this->raiseError("Missing read permissions for object with reference id " . $ref_id, 'Client');
1203 }
1204
1206 return $this->raiseError("Object is in Trash", 'Client');
1207 }
1208 global $DIC;
1209
1210 $tree = $DIC['tree'];
1211 $lng = $DIC['lng'];
1212 $items = $tree->getPathFull($ref_id);
1213
1214 $xmlResultSet = new ilXMLResultSet();
1215 $xmlResultSet->addColumn("ref_id");
1216 $xmlResultSet->addColumn("type");
1217 $xmlResultSet->addColumn("title");
1218
1219 $writer = new ilXMLResultSetWriter($xmlResultSet);
1220 foreach ($items as $item) {
1221 if ((int) $item["ref_id"] === $ref_id) {
1222 continue;
1223 }
1224 if ($item["title"] === "ILIAS" && $item["type"] === "root") {
1225 $item["title"] = $lng->txt("repository");
1226 }
1227
1228 $row = new ilXMLResultSetRow();
1229 $xmlResultSet->addRow($row);
1230 $row->setValue("ref_id", $item["ref_id"]);
1231 $row->setValue("type", $item["type"]);
1232 $row->setValue("title", $item["title"]);
1233 }
1234 $writer->start();
1235 return $writer->getXML();
1236 }
1237
1238 private function canAddType(string $type, string $target_type, int $target_id)
1239 {
1240 // checking for target subtypes. Can we add source to target
1241 global $DIC;
1242
1243 $objDefinition = $DIC['objDefinition'];
1244 $rbacsystem = $DIC['rbacsystem'];
1245
1246 $allowed_types = array('root', 'cat', 'grp', 'crs', 'fold');
1247 if (!in_array($target_type, $allowed_types, true)) {
1248 return $this->raiseError(
1249 'No valid target type. Target must be reference id of "course, group, category or folder"',
1250 'Client'
1251 );
1252 }
1253
1254 $allowed_subtypes = $objDefinition->getSubObjects($target_type);
1255 $allowed = array();
1256
1257 foreach ($allowed_subtypes as $row) {
1258 if ($row['name'] !== 'rolf') {
1259 $allowed[] = $row['name'];
1260 }
1261 }
1262
1263 if (!in_array($type, $allowed, true)) {
1264 return $this->raiseError(
1265 'Objects of type: ' . $type . ' are not allowed to be subobjects of type ' . $target_type . '!',
1266 'Client'
1267 );
1268 }
1269 if (!$rbacsystem->checkAccess('create', $target_id, $type)) {
1270 return $this->raiseError('No permission to create objects of type ' . $type . '!', 'Client');
1271 }
1272
1273 return true;
1274 }
1275
1276 private function validateReferences(string $a_action, array $a_object_data, int $a_target_id = 0)
1277 {
1278 global $DIC;
1279
1280 $ilAccess = $DIC['ilAccess'];
1281
1282 if (!isset($a_object_data['references']) || !count($a_object_data['references'])) {
1283 return true;
1284 }
1285 if ($a_action === 'create') {
1286 if (
1287 count($a_object_data['references']) > 1 && in_array(
1288 $a_object_data['type'],
1289 ['cat', 'crs', 'grp', 'fold'],
1290 true
1291 )
1292 ) {
1293 return $this->raiseError(
1294 "Cannot create references for type " . $a_object_data['type'],
1295 'Client'
1296 );
1297 }
1298 if (count($a_object_data['references']) === 1 && $a_target_id != $a_object_data['references'][0]['parent_id']) {
1299 return $this->raiseError(
1300 "Cannot create references for type " . $a_object_data['type'],
1301 'Client'
1302 );
1303 }
1304
1305 foreach ($a_object_data['references'] as $ref_data) {
1306 if (!$ref_data['parent_id']) {
1307 return $this->raiseError('Element References: No parent Id given!', 'Client');
1308 }
1309
1310 $target_type = ilObject::_lookupType(ilObject::_lookupObjId($ref_data['parent_id']));
1311 $can_add_type = $this->canAddType($a_object_data['type'], $target_type, $ref_data['parent_id']);
1312 if ($this->isFault($can_add_type)) {
1313 return $can_add_type;
1314 }
1315 }
1316 return true;
1317 }
1318
1319 if ($a_action === 'update') {
1320 foreach ($a_object_data['references'] as $ref_data) {
1321 if (!$ref_data['ref_id']) {
1322 return $this->raiseError('Element References: No reference id given!', 'Client');
1323 }
1324 // check permissions
1325 if (!$ilAccess->checkAccess('write', '', $ref_data['ref_id'])) {
1326 return $this->raiseError(
1327 'No write permission for object with reference id ' . $ref_data['ref_id'] . '!',
1328 'Client'
1329 );
1330 }
1331 // TODO: check if all references belong to the same object
1332 }
1333 return true;
1334 }
1335 return true;
1336 }
1337
1338 private function updateReferences(array $a_object_data): void
1339 {
1340 global $DIC;
1341
1342 $tree = $DIC['tree'];
1343 $ilLog = $DIC['ilLog'];
1344
1345 if (!isset($a_object_data['references']) || !count($a_object_data['references'])) {
1346 return;
1347 }
1348
1349 foreach ($a_object_data['references'] as $ref_data) {
1350 if (isset($ref_data['time_target'])) {
1351 $old = ilObjectActivation::getItem($ref_data['ref_id']);
1352
1353 $items = new ilObjectActivation();
1354 $items->toggleChangeable($ref_data['time_target']['changeable'] ?? $old['changeable']);
1355 $items->setTimingStart($ref_data['time_target']['starting_time'] ?? $old['timing_start']);
1356 $items->setTimingEnd($ref_data['time_target']['ending_time'] ?? $old['timing_end']);
1357 $items->toggleVisible($ref_data['time_target']['timing_visibility'] ?? $old['visible']);
1358 $items->setSuggestionStart($ref_data['time_target']['suggestion_start'] ?? $old['suggestion_start']);
1359 $items->setSuggestionEnd($ref_data['time_target']['suggestion_end'] ?? $old['suggestion_end']);
1360
1361 switch ($ref_data['time_target']['timing_type']) {
1363 $ilLog->write(__METHOD__ . ilObjectActivation::TIMINGS_DEACTIVATED . ' ' . $ref_data['time_target']['timing_type']);
1364 $items->setTimingType(ilObjectActivation::TIMINGS_DEACTIVATED);
1365 break;
1366
1368 $ilLog->write(__METHOD__ . ilObjectActivation::TIMINGS_ACTIVATION . ' ' . $ref_data['time_target']['timing_type']);
1369 $items->setTimingType(ilObjectActivation::TIMINGS_ACTIVATION);
1370 break;
1371
1373 $ilLog->write(__METHOD__ . ilObjectActivation::TIMINGS_PRESETTING . ' ' . $ref_data['time_target']['timing_type']);
1374 $items->setTimingType(ilObjectActivation::TIMINGS_PRESETTING);
1375 break;
1376 }
1377 $items->update($ref_data['ref_id']);
1378 }
1379 }
1380 }
1381
1382 private function addReferences(ilObject $source, array $a_object_data): void
1383 {
1384 global $DIC;
1385
1386 $tree = $DIC->repositoryTree();
1387 $ilLog = $DIC['ilLog'];
1388
1389 if (!isset($a_object_data['references']) || !count($a_object_data['references'])) {
1390 return;
1391 }
1392
1393 $original_id = $source->getRefId();
1394
1395 foreach ($a_object_data['references'] as $ref_data) {
1396 $new_ref_id = $original_id;
1397 if ($tree->getParentId($original_id) !== (int) $ref_data['parent_id']) {
1398 // New reference requested => create it
1399 $new_ref_id = $source->createReference();
1400 $source->putInTree($ref_data['parent_id']);
1401 $source->setPermissions($ref_data['parent_id']);
1402 }
1403 if (isset($ref_data['time_target']) /* and ($crs_ref_id = $tree->checkForParentType($new_ref_id,'crs')) */) {
1404 if (!isset($ref_data['time_target']['starting_time'])) {
1405 $ref_data['time_target']['starting_time'] = time();
1406 }
1407 if (!isset($ref_data['time_target']['ending_time'])) {
1408 $ref_data['time_target']['ending_time'] = time();
1409 }
1410
1411 $items = new ilObjectActivation();
1412 $items->toggleChangeable($ref_data['time_target']['changeable']);
1413 $items->setTimingStart($ref_data['time_target']['starting_time']);
1414 $items->setTimingEnd($ref_data['time_target']['ending_time']);
1415 $items->toggleVisible($ref_data['time_target']['timing_visibility']);
1416 $items->setSuggestionStart($ref_data['time_target']['suggestion_start']);
1417 $items->setSuggestionEnd($ref_data['time_target']['suggestion_end']);
1418
1419 switch ($ref_data['time_target']['timing_type']) {
1421 $ilLog->write(__METHOD__ . ilObjectActivation::TIMINGS_DEACTIVATED . ' ' . $ref_data['time_target']['timing_type']);
1422 $items->setTimingType(ilObjectActivation::TIMINGS_DEACTIVATED);
1423 break;
1424
1426 $ilLog->write(__METHOD__ . ilObjectActivation::TIMINGS_ACTIVATION . ' ' . $ref_data['time_target']['timing_type']);
1427 $items->setTimingType(ilObjectActivation::TIMINGS_ACTIVATION);
1428 break;
1429
1431 $ilLog->write(__METHOD__ . ilObjectActivation::TIMINGS_PRESETTING . ' ' . $ref_data['time_target']['timing_type']);
1432 $items->setTimingType(ilObjectActivation::TIMINGS_PRESETTING);
1433 break;
1434 }
1435 $items->update($new_ref_id);
1436 }
1437 }
1438 }
1439}
$location
Definition: buildRTE.php:22
static _adjustMovedObjectConditions(int $a_ref_id)
In the moment it is not allowed to create preconditions on objects that are located outside of a cour...
Class ilContainer.
static _allocateCopyId()
Allocate a copy for further entries.
static _getInstance(int $a_copy_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Parses result XML from lucene search highlight.
static getInstance(ilLuceneQueryParser $qp)
Get singleton instance.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupId(string|array $a_user_str)
Class ilObjectActivation.
static getItem(int $ref_id)
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
static getTypeByRefId(int $ref_id, bool $stop_on_error=true)
get object type by reference id
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObject Basic functions for all objects.
static _lookupObjectId(int $ref_id)
static _lookupType(int $id, bool $reference=false)
setPermissions(int $parent_ref_id)
createReference()
creates reference for object
putInTree(int $parent_ref_id)
maybe this method should be in tree object!?
static _hasUntrashedReference(int $obj_id)
checks whether an object has at least one reference that is not in trash
static _getAllReferences(int $id)
get all reference ids for object ID
static _isInTrash(int $ref_id)
static _lookupObjIdByImportId(string $import_id)
Get (latest) object id for an import id.
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
raiseError(string $a_message, $a_code)
addReferences(ilObject $source, array $a_object_data)
getObjectsByTitle(string $sid, string $a_title, ?int $user_id=null)
addReference(string $sid, int $a_source_id, int $a_target_id)
validateReferences(string $a_action, array $a_object_data, int $a_target_id=0)
copyObject(string $sid, string $copy_settings_xml)
removeFromSystemByImportId(string $sid, string $import_id)
getRefIdsByImportId(string $sid, string $import_id)
deleteObject(string $sid, int $reference_id)
moveObject(string $sid, int $ref_id, int $target_id)
canAddType(string $type, string $target_type, int $target_id)
getObjIdByImportId(string $sid, string $import_id)
searchObjects(string $sid, ?array $types, string $key, string $combination, ?int $user_id=null)
getTreeChilds(string $sid, int $ref_id, ?array $types=null, ?int $user_id=null)
getXMLTree(string $sid, int $ref_id, ?array $types=null, ?int $user_id=null)
getObjIdsByRefIds(string $sid, array $ref_ids)
getObjectByReference(string $sid, int $a_ref_id, ?int $user_id=null)
Row Class for XMLResultSet.
XML Writer for XMLResultSet.
const SYSTEM_FOLDER_ID
Definition: constants.php:35
const ROOT_FOLDER_ID
Definition: constants.php:32
$ref_id
Definition: ltiauth.php:66
$res
Definition: ltiservices.php:69
global $lng
Definition: privfeed.php:31
global $DIC
Definition: shib_login.php:26
$counter