ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilADTGroupPresentationBridge.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
23 protected array $elements = [];
24
25 protected function isValidADT(ilADT $a_adt): bool
26 {
27 return ($a_adt instanceof ilADTGroup);
28 }
29
30 protected function prepareElements(): void
31 {
32 if (count($this->elements)) {
33 return;
34 }
35
36 $this->elements = array();
37 $factory = ilADTFactory::getInstance();
38
39 // convert ADTs to presentation bridges
40 foreach ($this->getADT()->getElements() as $name => $element) {
41 $this->elements[$name] = $factory->getPresentationBridgeForInstance($element);
42 }
43 }
44
45 public function getHTML($delimiter = "<br />"): string
46 {
47 $res = array();
48
49 $this->prepareElements();
50 foreach ($this->elements as $element) {
51 $res[] = $this->decorate($element->getHTML());
52 }
53
54 if (count($res)) {
55 return implode($delimiter, $res);
56 }
57 return '';
58 }
59
60 public function getSortable($delimiter = ";")
61 {
62 $res = array();
63
64 $this->prepareElements();
65 foreach ($this->elements as $element) {
66 $res[] = $element->getSortable();
67 }
68
69 if (count($res)) {
70 return implode($delimiter, $res);
71 }
72 return '';
73 }
74}
ADT presentation bridge base class.
ADT base class.
Definition: class.ilADT.php:26
$res
Definition: ltiservices.php:69