Car Price Volvo $50000 SAAB $48000 */ ?> processChildNodes($node, self::$CHILDNODES); } } class FO_Table extends FO_LayoutObject { var $colCount = 0; static $CHILDNODES = array( 'FO_TableColumn', 'FO_TableHeader', 'FO_TableFooter', 'FO_TableBody' ); function getChildNodes() { return self::$CHILDNODES; } function initFOObject(FO_Object $col) { if (!$col instanceof FO_TableColumn) { return; } $col->setContext("column", $this->colCount++); } function postParse(FO_Object $obj) { global $max_line_height_for_that_row; if ($obj instanceof FO_TableHeader) { $this->setLocalContext("width", $obj->getContext("width")); $this->setLocalContext("height", $this->getContext("height")+ $obj->getContext("height")); $this->setContext("y", $this->getContext("y") + $obj->getContext("height")); } else if($obj instanceof FO_TableBody) { $this->setLocalContext("width", $obj->getContext("width")); $this->setLocalContext("height", $this->getContext("height")+ $obj->getContext("height")); $this->setContext("y", $this->getContext("y") + $obj->getContext("height")); $max_line_height_for_that_row=1; } else if($obj instanceof FO_TableColumn) { $col = $obj->getContext("column"); $this->setContext("column-$col-width", $obj->getContext("width")); } } } class FO_TableCaption extends FO_Object { static $CHILDNODES = array( 'FO_Block', 'FO_BlockContainer', 'FO_ListBlock' ); function parse(DOMNode $node) { $this->processChildNodes($node, self::$CHILDNODES); } } class FO_TableColumn extends FO_Object { static $CHILDNODES = array(); function parse(DOMNode $node) { $width = $this->getSizeAttribute($node, "column-width"); //calc internal width $this->setContext("width", $width); $this->processChildNodes($node, self::$CHILDNODES); } } class FO_TableRow extends FO_LayoutObject { var $colIndex = 0; static $CHILDNODES = array( 'FO_TableCell' ); function getChildNodes() { return self::$CHILDNODES; } function initFOObject(FO_Object $col) { if (!$col instanceof FO_TableCell) { return; } $col->setContext("column", $this->colIndex++); } function postParse(FO_Object $obj) { if ($obj instanceof FO_TableCell) { $this->setContext("x", $this->getContext("x")+ $obj->getContext("width")); $this->setLocalContext("width", $this->getContext("width")+ $obj->getContext("width")); if ($this->getContext("height") < $obj->getContext("height")) { $this->setLocalContext("height", $obj->getContext("height")); } } else if ($obj instanceof FO_TableRow) { $this->setLocalContext("width", $obj->getContext("width")); $this->setLocalContext("height", $this->getContext("height")+ $obj->getContext("height")); $this->setContext("y", $this->getContext("y") + $obj->getContext("height")); } } } class FO_TableHeader extends FO_TableRow { //oesi - set to _1 to work with php4 static $CHILDNODES_1 = array( 'FO_TableCell', 'FO_TableRow' ); function getChildNodes() { return self::$CHILDNODES_1; } } class FO_TableFooter extends FO_LayoutObject { static $CHILDNODES = array( 'FO_TableCell', 'FO_TableRow' ); function getChildNodes() { return self::$CHILDNODES; } } class FO_TableBody extends FO_LayoutObject { static $CHILDNODES = array( 'FO_TableCell', 'FO_TableRow' ); function getChildNodes() { return self::$CHILDNODES; } function postParse(FO_Object $obj) { if ($obj instanceof FO_TableRow) { $this->setLocalContext("width", $obj->getContext("width")); $this->setLocalContext("height", $this->getContext("height")+ $obj->getContext("height")); $this->setContext("y", $this->getContext("y") + $obj->getContext("height")); } } } class FO_TableCell extends FO_LayoutObject { static $CHILDNODES = array( 'FO_Block', 'FO_BlockContainer', 'FO_ListBlock', 'FO_Table', 'FO_TableAndCaption' ); function getChildNodes() { return self::$CHILDNODES; } function parse(DOMNode $node) { $col = $this->getContext("column"); $width = $this->getContext("column-$col-width"); $this->setLocalContext("width", $width); parent::parse($node); } /** * Overlap borders that the total width isn't larger than the * specified */ function drawBordersAndBackground($pos) { list($x1, $y1, $width1, $height1) = $pos[0]; list($x2, $y2, $width2, $height2) = $pos[1]; $xd = ($x1-$x2)/2; $yd = ($y1-$y2)/2; $wd = ($width2-$width1)/2; $hd = ($height2-$height1)/2; $this->drawBackground($x2, $y2, $width2+$wd, $height2+$hd); $this->drawBorders($x2, $y2, $width2+$wd, $height2+$hd); } function postParse(FO_Object $obj) { $this->setLocalContext("height", $this->getContext("height")+ $obj->getContext("height")+0.5); // oesi - add +0.5 for tablespace } } ?>