ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilExcelWriterAdapter.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once 'Services/Excel/classes/class.ilExcelWriterWrapper.php';
5 
17 {
18  var $workbook = null;
19 
20  var $format_bold = null;
21  var $format_header = null;
22 
23  function ilExcelWriterAdapter($a_filename,$a_send = true)
24  {
25  global $ilias, $lng;
26 
27  if($a_send)
28  {
29  $this->workbook =& new ilExcelWriterWrapper();
30  $this->workbook->send($a_filename);
31  }
32  else
33  {
34  $this->workbook =& new ilExcelWriterWrapper($a_filename);
35  }
36 
37  if(strlen($tmp = ini_get('upload_tmp_dir')))
38  {
39  $this->workbook->setTempDir($tmp);
40  }
41 
42  // to make UTF8 input work
43  $this->workbook->setVersion(8);
44 
45  $this->__initFormatBold();
46  $this->__initFormatHeader();
47  $this->__initFormatTitle();
48  }
49 
50  function &getWorkbook()
51  {
52  return $this->workbook;
53  }
54 
55  function &getFormatBold()
56  {
57  return $this->format_bold;
58  }
59  function &getFormatHeader()
60  {
61  return $this->format_header;
62  }
63  function &getFormatTitle()
64  {
65  return $this->format_title;
66  }
67  function &getFormatDate()
68  {
69  return $this->format_date;
70  }
71  function &getFormatDayTime()
72  {
73  return $this->format_day_time;
74  }
75 
76  // PROTECTED
77  function __initFormatBold()
78  {
79  $this->format_bold =& $this->workbook->addFormat();
80  $this->format_bold->setBold();
81  }
82  function __initFormatHeader()
83  {
84  $this->format_header =& $this->workbook->addFormat();
85  $this->format_header->setBold();
86  $this->format_header->setTop(100);
87  $this->format_header->setColor('black');
88  $this->format_header->setPattern(1);
89  $this->format_header->setFgColor('silver');
90  }
91  function __initFormatTitle()
92  {
93  $this->format_title =& $this->workbook->addFormat();
94  $this->format_title->setBold();
95  $this->format_title->setColor('black');
96  $this->format_title->setPattern(1);
97  $this->format_title->setSize(16);
98  $this->format_title->setAlign('center');
99  }
100  function __initFormatDate()
101  {
102  $this->format_date =& $this->workbook->addFormat();
103  $this->format_date->setNumFormat("YYYY-MM-DD hh:mm:ss");
104  }
105 
107  {
108  $this->format_day_time =& $this->workbook->addFormat();
109  $this->format_day_time->setNumFormat("DD:hh:mm:ss");
110  }
111 
112 
113 }
114 ?>