ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
class.ilADTMultiEnumPresentationBridge.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
23  protected function isValidADT(ilADT $a_adt): bool
24  {
25  return ($a_adt instanceof ilADTMultiEnum);
26  }
27 
28  public function getHTML(): string
29  {
30  if (!$this->getADT()->isNull()) {
31  $res = array();
32 
33  $options = $this->getADT()->getCopyOfDefinition()->getOptions();
34  foreach ((array) $this->getADT()->getSelections() as $value) {
35  if (array_key_exists($value, $options)) {
36  $res[] = $this->decorate($options[$value]);
37  }
38  }
39 
40  return implode(", ", $res);
41  }
42  return '';
43  }
44 
45  public function getSortable()
46  {
47  if (!$this->getADT()->isNull()) {
48  return implode(";", (array) $this->getADT()->getSelections());
49  }
50  return '';
51  }
52 }
$res
Definition: ltiservices.php:66
decorate($a_value)
Decorate value.
ADT base class.
Definition: class.ilADT.php:25
ADT presentation bridge base class.