commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-old / civicrm / vendor / dompdf / dompdf / src / FrameReflower / TableRowGroup.php
1 <?php
2 /**
3 * @package dompdf
4 * @link http://dompdf.github.com/
5 * @author Benj Carson <benjcarson@digitaljunkies.ca>
6 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
7 */
8 namespace Dompdf\FrameReflower;
9
10 use Dompdf\FrameDecorator\Block as BlockFrameDecorator;
11 use Dompdf\FrameDecorator\Table as TableFrameDecorator;
12
13 /**
14 * Reflows table row groups (e.g. tbody tags)
15 *
16 * @package dompdf
17 */
18 class TableRowGroup extends AbstractFrameReflower
19 {
20
21 function __construct($frame)
22 {
23 parent::__construct($frame);
24 }
25
26 function reflow(BlockFrameDecorator $block = null)
27 {
28 $page = $this->_frame->get_root();
29
30 $style = $this->_frame->get_style();
31
32 // Our width is equal to the width of our parent table
33 $table = TableFrameDecorator::find_parent_table($this->_frame);
34
35 $cb = $this->_frame->get_containing_block();
36
37 foreach ($this->_frame->get_children() as $child) {
38 // Bail if the page is full
39 if ($page->is_full())
40 return;
41
42 $child->set_containing_block($cb["x"], $cb["y"], $cb["w"], $cb["h"]);
43 $child->reflow();
44
45 // Check if a split has occured
46 $page->check_page_break($child);
47
48 }
49
50 if ($page->is_full())
51 return;
52
53 $cellmap = $table->get_cellmap();
54 $style->width = $cellmap->get_frame_width($this->_frame);
55 $style->height = $cellmap->get_frame_height($this->_frame);
56
57 $this->_frame->set_position($cellmap->get_frame_position($this->_frame));
58
59 if ($table->get_style()->border_collapse === "collapse")
60 // Unset our borders because our cells are now using them
61 $style->border_style = "none";
62
63 }
64
65 }