00001 <?php
00002
00003 class TKInfoBox extends TKTable {
00004 public function __construct($title = '', $data = array()) {
00005 parent::__construct(false);
00006
00007 $this->addProperty('title', self::PROP_STRING);
00008 $this->addProperty('data', self::PROP_ARRAY);
00009
00010 $this->title = $title;
00011 $this->data = $data;
00012 }
00013
00014 protected function renderContainer($a, $b, $c, $d) {
00015 $this->addTextTo('header', $this->title, array('colspan' => 2));
00016
00017 foreach($this->data as $label => $content) {
00018 $this->addRow();
00019 $this->addText($label, array('class' => array('tkLeftInfoLabel')));
00020 if(is_object($content) && $content instanceof TKComponent)
00021 $this->add($content);
00022 else
00023 $this->addText($content);
00024 }
00025
00026 return parent::renderContainer($a, $b, $c, $d);
00027 }
00028 }
00029
00030 ?>