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