public function toString($destroy = true) { $tableId = $this->getId(); if (!$tableId) { $tableId = uniqid('t'); $this->setId($tableId); } $string = parent::toString($destroy); if ($this->addMakeVerticalRotationJs) { $string .= get_js('var makeVerticalRotationForTable = function() {' . "\n" . ' jQuery("#' . $tableId . '").makeVerticalRotation();' . "\n" . '}' . "\n" . "\n" . 'if (!jQuery.isReady) {' . "\n" . ' jQuery(document).ready(makeVerticalRotationForTable);' . "\n" . '}' . "\n" . 'else {' . "\n" . ' makeVerticalRotationForTable();' . "\n" . '}', true); } return $string; }
public function toString($destroy = true) { $tableId = $this->getAttribute('id'); if (!$tableId) { $tableId = uniqid('t'); $this->setAttribute('id', $tableId); } $string = parent::toString($destroy); if ($this->addMakeVerticalRotationJs) { $string .= get_js('var makeVerticalRotationForTable = function() { var table = jQuery("#' . $tableId . '"); table.makeVerticalRotation(); if (IE8) { jQuery(".vertical_rotation_inner", table).css({ filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)" }); } else if (IE9) { jQuery(".vertical_rotation_inner", table).css({ "-ms-transform": "rotate(270deg)" }); } if (!IE9) { jQuery(".vertical_rotation_inner", table).css({ "writing-mode": "tb-rl" }); } } if(!jQuery.isReady) { jQuery(document).ready(makeVerticalRotationForTable); } else { makeVerticalRotationForTable(); }', true); } return $string; }
public function bodyToString() { $res = parent::bodyToString(); $tbl = new CTable(null, $this->tableclass); $tbl->setCellSpacing(0); $tbl->setCellPadding(1); $tbl->setAlign($this->align); // add first row if (!is_null($this->title)) { $col = new CCol(null, 'form_row_first'); $col->setColSpan(2); if (isset($this->help)) { $col->addItem($this->help); } if (isset($this->title)) { $col->addItem($this->title); } $tbl->setHeader($col); } // add last row $tbl->setFooter($this->bottom_items); // add center rows foreach ($this->center_items as $item) { $tbl->addRow($item); } return $res . $tbl->toString(); }
public function bodyToString() { parent::bodyToString(); $tbl = new CTable(NULL, $this->tableclass); $tbl->setOddRowClass('form_odd_row'); $tbl->setEvenRowClass('form_even_row'); $tbl->setCellSpacing(0); $tbl->setCellPadding(1); $tbl->setAlign($this->align); // add first row $col = new CCol(NULL, 'form_row_first'); $col->setColSpan(2); if (isset($this->help)) { $col->addItem($this->help); } if (isset($this->title)) { $col->addItem($this->title); } foreach ($this->top_items as $item) { $col->addItem($item); } $tbl->setHeader($col); // add last row $tbl->setFooter($this->bottom_items); // add center rows foreach ($this->center_items as $item) { $tbl->addRow($item); } return $tbl->toString(); }