ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilADTPresentationBridge.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
12 {
13  protected $adt; // [ilADT]
14  protected $decorator; // [String|Array]
15 
22  public function __construct(ilADT $a_adt)
23  {
24  $this->setADT($a_adt);
25  }
26 
27 
28  //
29  // properties
30  //
31 
40  abstract protected function isValidADT(ilADT $a_adt);
41 
48  protected function setADT(ilADT $a_adt)
49  {
50  if(!$this->isValidADT($a_adt))
51  {
52  throw new Exception('ADTPresentationBridge Type mismatch.');
53  }
54 
55  $this->adt = $a_adt;
56  }
57 
63  public function getADT()
64  {
65  return $this->adt;
66  }
67 
73  public function getList()
74  {
75  return $this->getHTML();
76  }
77 
83  abstract public function getHTML();
84 
90  abstract public function getSortable();
91 
97  public function setDecoratorCallBack($a_callback)
98  {
99  $this->decorator = $a_callback;
100  }
101 
108  protected function decorate($a_value)
109  {
110  if(is_callable($this->decorator))
111  {
112  $a_value = call_user_func($this->decorator, $a_value);
113  }
114  return $a_value;
115  }
116 }
117 
118 ?>
__construct(ilADT $a_adt)
Constructor.
decorate($a_value)
Decorate value.
ADT base class.
Definition: class.ilADT.php:11
getSortable()
Get sortable value presentation.
isValidADT(ilADT $a_adt)
Check if given ADT is valid.
getHTML()
Get HTML presentation.
setDecoratorCallBack($a_callback)
Set decorator callback.
ADT presentation bridge base class.