ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilADTBooleanPresentationBridge.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 ilADTBoolean);
26  }
27 
28  public function getHTML(): string
29  {
30  if (!$this->getADT()->isNull()) {
31  // :TODO: force icon?
32 
33  $presentation_value = $this->getADT()->getStatus()
34  ? $this->lng->txt("yes")
35  : $this->lng->txt("no");
36  return $this->decorate($presentation_value);
37  }
38  return '';
39  }
40 
41  public function getSortable()
42  {
43  if (!$this->getADT()->isNull()) {
44  // :TODO: cast to int ?
45  return $this->getADT()->getStatus() ? 1 : 0;
46  }
47  return 0;
48  }
49 }
decorate($a_value)
Decorate value.
ADT base class.
Definition: class.ilADT.php:25
ADT presentation bridge base class.