ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilADTGroupPresentationBridge.php
Go to the documentation of this file.
1 <?php
2 
3 require_once "Services/ADT/classes/Bridges/class.ilADTPresentationBridge.php";
4 
6 {
7  protected $elements; // [array]
8 
9  protected function isValidADT(ilADT $a_adt)
10  {
11  return ($a_adt instanceof ilADTGroup);
12  }
13 
14  protected function prepareElements()
15  {
16  if(sizeof($this->elements))
17  {
18  return;
19  }
20 
21  $this->elements = array();
22  $factory = ilADTFactory::getInstance();
23 
24  // convert ADTs to presentation bridges
25 
26  foreach($this->getADT()->getElements() as $name => $element)
27  {
28  $this->elements[$name] = $factory->getPresentationBridgeForInstance($element);
29  }
30  }
31 
32  public function getHTML($delimiter = "<br />")
33  {
34  $res = array();
35 
36  $this->prepareElements();
37  foreach($this->elements as $element)
38  {
39  $res[] = $this->decorate($element->getHTML());
40  }
41 
42  if(sizeof($res))
43  {
44  return implode($delimiter, $res);
45  }
46  }
47 
48  public function getSortable($delimiter = ";")
49  {
50  $res = array();
51 
52  $this->prepareElements();
53  foreach($this->elements as $element)
54  {
55  $res[] = $element->getSortable();
56  }
57 
58  if(sizeof($res))
59  {
60  return implode($delimiter, $res);
61  }
62  }
63 }
64 
65 ?>
decorate($a_value)
Decorate value.
static getInstance()
Get singleton.
ADT base class.
Definition: class.ilADT.php:11
Create styles array
The data for the language used.
ADT presentation bridge base class.