source: extensions/GrumPluginClasses/classes/External/odsPhpGenerator/class/odsTableColumn.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/*-
4 * Copyright (c) 2009 Laurent VUIBERT
5 * License : GNU Lesser General Public License v3
6 */
7
8class 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
39class odsTableColumnWithWidth extends odsTableColumn {
40        public function __construct($width) {
41                $styleColumn = new odsStyleTableColumn();
42                $styleColumn->setColumnWidth($width);
43                parent::__construct($styleColumn);
44        }
45}
46
47?>
Note: See TracBrowser for help on using the repository browser.