1 | <?php |
---|
2 | |
---|
3 | /*- |
---|
4 | * Copyright (c) 2009 Laurent VUIBERT |
---|
5 | * License : GNU Lesser General Public License v3 |
---|
6 | */ |
---|
7 | |
---|
8 | class odsTableColumn { |
---|
9 | //private $styleName; |
---|
10 | private $repeated; |
---|
11 | private $odsStyleTableColumn; |
---|
12 | |
---|
13 | public function __construct(odsStyleTableColumn $odsStyleTableColumn) { |
---|
14 | $this->odsStyleTableColumn = $odsStyleTableColumn; |
---|
15 | $this->repeated = null; |
---|
16 | } |
---|
17 | |
---|
18 | public function getContent(ods $ods,DOMDocument $dom) { |
---|
19 | if(!$ods->getStyleByName($this->odsStyleTableColumn->getName())) |
---|
20 | $ods->addTmpStyles($this->odsStyleTableColumn); |
---|
21 | |
---|
22 | $table_table_column = $dom->createElement('table:table-column'); |
---|
23 | $table_table_column->setAttribute("table:style-name", $this->odsStyleTableColumn->getName()); |
---|
24 | if($this->repeated) |
---|
25 | $table_table_column->setAttribute("table:number-columns-repeated", $this->repeated); |
---|
26 | $table_table_column->setAttribute("table:default-cell-style-name", "Default"); |
---|
27 | return $table_table_column; |
---|
28 | } |
---|
29 | |
---|
30 | public function setRepeated($repeated) { |
---|
31 | $this->repeated = $repeated; |
---|
32 | } |
---|
33 | |
---|
34 | function getOdsStyleTableColumn() { |
---|
35 | return $this->odsStyleTableColumn; |
---|
36 | } |
---|
37 | } |
---|
38 | |
---|
39 | class odsTableColumnWithWidth extends odsTableColumn { |
---|
40 | public function __construct($width) { |
---|
41 | $styleColumn = new odsStyleTableColumn(); |
---|
42 | $styleColumn->setColumnWidth($width); |
---|
43 | parent::__construct($styleColumn); |
---|
44 | } |
---|
45 | } |
---|
46 | |
---|
47 | ?> |
---|