ILIAS  release_8 Revision v8.23
class.ilADTGroupPresentationBridge.php
Go to the documentation of this file.
1 <?php
2 
3 declare(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 }
$res
Definition: ltiservices.php:69
decorate($a_value)
Decorate value.
ADT base class.
Definition: class.ilADT.php:11
if($format !==null) $name
Definition: metadata.php:247
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$factory
Definition: metadata.php:75