ILIAS  release_8 Revision v8.24
class.ilADTGroupPresentationBridge.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
6{
7 protected array $elements = [];
8
9 protected function isValidADT(ilADT $a_adt): bool
10 {
11 return ($a_adt instanceof ilADTGroup);
12 }
13
14 protected function prepareElements(): void
15 {
16 if (count($this->elements)) {
17 return;
18 }
19
20 $this->elements = array();
22
23 // convert ADTs to presentation bridges
24 foreach ($this->getADT()->getElements() as $name => $element) {
25 $this->elements[$name] = $factory->getPresentationBridgeForInstance($element);
26 }
27 }
28
29 public function getHTML($delimiter = "<br />"): string
30 {
31 $res = array();
32
33 $this->prepareElements();
34 foreach ($this->elements as $element) {
35 $res[] = $this->decorate($element->getHTML());
36 }
37
38 if (count($res)) {
39 return implode($delimiter, $res);
40 }
41 return '';
42 }
43
44 public function getSortable($delimiter = ";")
45 {
46 $res = array();
47
48 $this->prepareElements();
49 foreach ($this->elements as $element) {
50 $res[] = $element->getSortable();
51 }
52
53 if (count($res)) {
54 return implode($delimiter, $res);
55 }
56 return '';
57 }
58}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ADT base class.
Definition: class.ilADT.php:12
$res
Definition: ltiservices.php:69
$factory
Definition: metadata.php:75
if($format !==null) $name
Definition: metadata.php:247