/** * tests setBorders */ public function testSetBorders() { $borderFormat = new PHPRtfLite_Border_Format(1.5, '#ff0', PHPRtfLite_Border_Format::TYPE_SINGLE); $this->_border->setBorders($borderFormat); $this->assertType('PHPRtfLite_Border_Format', $this->_border->getBorderTop()); $this->assertType('PHPRtfLite_Border_Format', $this->_border->getBorderBottom()); $this->assertType('PHPRtfLite_Border_Format', $this->_border->getBorderRight()); $this->assertType('PHPRtfLite_Border_Format', $this->_border->getBorderLeft()); }
/** * sets borders to rtf document. * * @param PHPRtfLite_Border_Format $borderFormat * @param boolean $left * @param boolean $top * @param boolean $right * @param boolean $bottom */ public function setBorders(PHPRtfLite_Border_Format $borderFormat, $left = true, $top = true, $right = true, $bottom = true) { if ($this->_border === null) { $this->_border = new PHPRtfLite_Border($this->_rtf); } $this->_border->setBorders($borderFormat, $left, $top, $right, $bottom); }
/** * tests setBorder on cell 2x2 * @depends testSetBorderForCellWithRow2Column1 * * @param PHPRtfLite_Table $table */ public function testSetBorderForCellWithRow2Column2(PHPRtfLite_Table $table) { $border = new PHPRtfLite_Border($table->getRtf()); $border->setBorders(new PHPRtfLite_Border_Format(1, '#888')); $cell2x2 = $table->getCell(2, 2); $cell1x2 = $table->getCell(1, 2); $cell2x1 = $table->getCell(2, 1); $cell2x2->setBorder($border); $this->assertEquals('#3F3', $cell1x2->getBorder()->getBorderTop()->getColor()); $this->assertEquals('#888', $cell1x2->getBorder()->getBorderBottom()->getColor()); $this->assertEquals('#888', $cell2x1->getBorder()->getBorderRight()->getColor()); }
/** * @deprecated use setBorder() instead * @see PHPRtfLite/PHPRtfLite_Cell#setBorder() * * Sets border to cell * * @param PHPRtfLite_BorderFormat $borderFormat * @param boolean $left if false, left border is not set (default true) * @param boolean $top if false, top border is not set (default true) * @param boolean $right if false, right border is not set (default true) * @param boolean $bottom if false, bottom border is not set (default true) */ public function setBorders(PHPRtfLite_Border_Format $borderFormat, $left = true, $top = true, $right = true, $bottom = true) { $border = new PHPRtfLite_Border(); $border->setBorders($borderFormat, $left, $top, $right, $bottom); $this->setBorder($border); }
/** * @deprecated use setBorderForCellRange() instead * @see PHPRtfLite/PHPRtfLite_Table#setBorderForCellRange() * * Sets borders of cells. * * @param PHPRtfLite_Border_Format $borderFormat border format * @param integer $startRow start row * @param integer $startColumn start column * @param integer $endRow end row, if null, then border is set only to the row range. * @param integer $endColumn end column, if null, then border is set just to the column range. * @param boolean $left if false, left border is not set (default true) * @param boolean $top if false, top border is not set (default true) * @param boolean $right if false, right border is not set (default true) * @param boolean $bottom if false, bottom border is not set (default true) */ public function setBordersForCellRange(PHPRtfLite_Border_Format $borderFormat, $startRow, $startColumn, $endRow = null, $endColumn = null, $left = true, $top = true, $right = true, $bottom = true) { $border = new PHPRtfLite_Border($this->getRtf()); $border->setBorders($borderFormat, $left, $top, $right, $bottom); $this->setBorderForCellRange($border, $startRow, $startColumn, $endRow, $endColumn); }