コード例 #1
0
ファイル: ElementTable.php プロジェクト: bobah/acbdb
 /**
  * Returns Html for the group
  * 
  * @access      public
  * @return      string
  */
 function toHtml()
 {
     include_once 'HTML/Table.php';
     $tripleLinkTable = new HTML_Table();
     $tripleLinkTable->setAutoGrow(true);
     $tripleLinkTable->setAutoFill('');
     $tripleLinkTable->updateAttributes($this->getAttributes());
     $row = 0;
     $col = 0;
     if ($this->_columnNames) {
         foreach ($this->_columnNames as $key => $value) {
             ++$col;
             $tripleLinkTable->setCellContents($row, $col, $value);
             $tripleLinkTable->setCellAttributes($row, $col, array('style' => 'text-align: center'));
         }
         ++$row;
     }
     foreach (array_keys($this->_rows) as $key) {
         $col = 0;
         $tripleLinkTable->setCellContents($row, $col, $this->_rowNames[$key]);
         foreach (array_keys($this->_rows[$key]) as $key2) {
             ++$col;
             $tripleLinkTable->setCellContents($row, $col, $this->_rows[$key][$key2]->toHTML());
             $tripleLinkTable->setCellAttributes($row, $col, array('style' => 'text-align: center'));
         }
         ++$row;
     }
     if ($this->_columnNames) {
         $tripleLinkTable->setRowAttributes(0, array('class' => 'elementTableColumnLabel'), true);
     }
     $tripleLinkTable->setColAttributes(0, array('class' => 'elementTableRowLabel'));
     return $tripleLinkTable->toHTML();
     /*include_once('HTML/QuickForm/Renderer/Default.php');
       $renderer =& new HTML_QuickForm_Renderer_Default();
       $renderer->setElementTemplate('{element}');
       $this->accept($renderer);
       return $renderer->toHtml();*/
 }