/** * @param TableCell $cell * * @return $this */ public function addCell(TableCell $cell) { $this->cells[] = $cell; if (!$cell->getRow()) { $cell->setRow($this); } return $this; }
/** * @access public * @param integer $x * @param integer $y * @return object */ public function getCell($x, $y) { if (is_object($x) || is_object($y)) { return false; } if (isset($this->cells[$y])) { if (isset($this->cells[$y][$x])) { return $this->cells[$y][$x]; } } $cell = new TableCell($this, $this->core, $this->xpath); $cell->setPos($x, $y); $this->cells[$y][$x] = $cell; return $cell; }
protected static function consumeTableCells(&$text) { $tableCells = array(); while (!is_null($tableCell = TableCell::consume($text))) { $tableCells[] = $tableCell; } return $tableCells; }
/** * @param string $value * @param array $options */ public function __construct(array $options = array()) { parent::__construct('', $options); }
public function __construct($id = '', $class = '', $lang = '', $label = '') { parent::__construct($id, $class, $lang, $label); }
/** * @access protected * @param TableCell $cell * @param array $styles * @return array */ protected function _getUsedCellStyles($cell, &$styles) { // Styles relatifs aux cellules (+2 parce qu'on commence au style ce2) $strdecimal = ''; $str = ''; $str .= $cell->getBackgroundColor() ? $cell->getBackgroundColor() : ''; $str .= $cell->getBorderBottom() ? $cell->getBorderBottom() : ''; $str .= $cell->getBorderLeft() ? $cell->getBorderLeft() : ''; $str .= $cell->getBorderRight() ? $cell->getBorderRight() : ''; $str .= $cell->getBorderTop() ? $cell->getBorderTop() : ''; $str .= $cell->getFontStyle() ? $cell->getFontStyle() : ''; $str .= $cell->getFontSize() ? $cell->getFontSize() : ''; $str .= $cell->getFontFamily() ? $cell->getFontFamily() : ''; $str .= $cell->getFontWeight() ? $cell->getFontWeight() : ''; $str .= $cell->getTextAlign() ? $cell->getTextAlign() : ''; $str .= $cell->getVerticalAlign() ? $cell->getVerticalAlign() : ''; $str .= $cell->getColor() ? $cell->getColor() : ''; $str .= $cell->getDecimal() ? $cell->getDecimal() : ''; if ($cell->getDecimal() && !in_array($cell->getDecimal(), $styles['numused'])) { $styles['numused'][] = $cell->getDecimal(); $strdecimal = array('val' => $cell->getDecimal(), 'pos' => 'N' . count($styles['numused'])); } if (!in_array($str, $styles['celused']) && $str != '') { $used['cel'] = 'ce' . (count($styles['cel']) + 2); $styles['celused'][] = $str; $styles['cel'][] = array('name' => $used['cel'], 'backgroundColor' => $cell->getBackgroundColor(), 'borderBottom' => $cell->getBorderBottom(), 'borderLeft' => $cell->getBorderLeft(), 'borderRight' => $cell->getBorderRight(), 'borderTop' => $cell->getBorderTop(), 'color' => $cell->getColor(), 'fontStyle' => $cell->getFontStyle(), 'fontSize' => $cell->getFontSize(), 'fontFamily' => $cell->getFontFamily(), 'fontWeight' => $cell->getFontWeight(), 'textAlign' => $cell->getTextAlign(), 'verticalAlign' => $cell->getVerticalAlign(), 'decimal' => $strdecimal); } else { $used['cel'] = $str != '' ? 'ce' . (array_search($str, $styles['celused']) + 2) : 'ce1'; } // Styles relatifs aux lignes (+2 parce qu'on commence au style ro2) $str = ''; $str .= $cell->getHeight() ? $cell->getHeight() : ''; if (!in_array($str, $styles['rowused']) && $str != '') { $used['row'] = 'ro' . (count($styles['row']) + 2); $styles['rowused'][] = $str; $styles['row'][] = array('name' => $used['row'], 'height' => $cell->getHeight()); } else { $used['row'] = $str != '' ? 'ro' . (array_search($str, $styles['rowused']) + 2) : 'ro1'; } // Styles relatifs aux colonnes (+2 parce qu'on commence au style co2) $str = ''; $str .= $cell->getWidth() ? $cell->getWidth() : ''; if (!in_array($str, $styles['colused']) && $str != '') { $used['col'] = 'co' . (count($styles['col']) + 2); $styles['colused'][] = $str; $styles['col'][] = array('name' => $used['col'], 'width' => $cell->getWidth()); } else { $used['col'] = $str != '' ? 'co' . (array_search($str, $styles['colused']) + 2) : 'co1'; } return $used; }
public function cell() { $cell = new TableCell($this->cell_tag); if (isset($this->default_cell_attributes)) { $cell->setAttributes($this->default_cell_attributes); } return $this->cells[] = $cell; }