source: extensions/GrumPluginClasses/classes/External/odsPhpGenerator/class/odsTableRow.php @ 17735

Last change on this file since 17735 was 17735, checked in by grum, 12 years ago

version 3.5.4 - fix minor bug & add new functions to framework

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1<?php
2/*-
3 * Copyright (c) 2009 Laurent VUIBERT
4 * License : GNU Lesser General Public License v3
5 */
6
7class odsTableRow {
8        private $styleName;
9        private $cells;
10       
11        public function __construct(odsStyleTableRow $odsStyleTableRow = null) {
12                if($odsStyleTableRow) $this->styleName = $odsStyleTableRow->getName;
13                else                  $this->styleName = "ro1";
14                $this->cells                           = array();
15        }
16       
17        public function addCell(odsTableCell $odsTableCell) {
18                array_push($this->cells,$odsTableCell);
19        }
20       
21        public function getContent(ods $ods, DOMDocument $dom) {
22                $table_table_row = $dom->createElement('table:table-row');
23                        $table_table_row->setAttribute("table:style-name", $this->styleName);
24               
25                        if(count($this->cells)) {
26                                foreach($this->cells as $cell) {
27                                        $table_table_row->appendChild($cell->getContent($ods, $dom));
28                                        if($cell->getNumberColumnsSpanned() > 1) {
29                                                $odsCoveredTableCell = new odsCoveredTableCell();
30                                                $odsCoveredTableCell->setNumberColumnsRepeated($cell->getNumberColumnsSpanned()-1);
31                                                $table_table_row->appendChild($odsCoveredTableCell->getContent($ods, $dom));
32                                        }
33                                }
34                                       
35                        } else {
36                                $cell = new odsTableCellEmpty();
37                                $table_table_row->appendChild($cell->getContent($ods, $dom));
38                        }
39               
40                return $table_table_row;
41        }
42       
43}
44
45
46
47
48
49
50?>
Note: See TracBrowser for help on using the repository browser.