ILIAS  eassessment Revision 61809
 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  var $log;
24 
25  function ilExcelWriterAdapter($a_filename,$a_send = true)
26  {
27  global $ilias, $lng, $log;
28 
29  if($a_send)
30  {
31  $this->workbook =& new ilExcelWriterWrapper();
32  $this->workbook->send($a_filename);
33  }
34  else
35  {
36  $this->workbook =& new ilExcelWriterWrapper($a_filename);
37  }
38 
39  if(strlen($tmp = ini_get('upload_tmp_dir')))
40  {
41  $this->workbook->setTempDir($tmp);
42  }
43 
44  // to make UTF8 input work
45  $this->workbook->setVersion(8);
46 
47  $this->__initFormatBold();
48  $this->__initFormatHeader();
49  $this->__initFormatTitle();
50  }
51 
52  function &getWorkbook()
53  {
54  return $this->workbook;
55  }
56 
57  function &getFormatBold()
58  {
59  return $this->format_bold;
60  }
61  function &getFormatHeader()
62  {
63  return $this->format_header;
64  }
65  function &getFormatTitle()
66  {
67  return $this->format_title;
68  }
69  function &getFormatDate()
70  {
71  return $this->format_date;
72  }
73  function &getFormatDayTime()
74  {
75  return $this->format_day_time;
76  }
77 
78  // PROTECTED
79  function __initFormatBold()
80  {
81  $this->format_bold =& $this->workbook->addFormat();
82  $this->format_bold->setBold();
83  }
84  function __initFormatHeader()
85  {
86  $this->format_header =& $this->workbook->addFormat();
87  $this->format_header->setBold();
88  $this->format_header->setTop(100);
89  $this->format_header->setColor('black');
90  $this->format_header->setPattern(1);
91  $this->format_header->setFgColor('silver');
92  }
93  function __initFormatTitle()
94  {
95  $this->format_title =& $this->workbook->addFormat();
96  $this->format_title->setBold();
97  $this->format_title->setColor('black');
98  $this->format_title->setPattern(1);
99  $this->format_title->setSize(16);
100  $this->format_title->setAlign('center');
101  }
102  function __initFormatDate()
103  {
104  $this->format_date =& $this->workbook->addFormat();
105  $this->format_date->setNumFormat("YYYY-MM-DD hh:mm:ss");
106  }
107 
109  {
110  $this->format_day_time =& $this->workbook->addFormat();
111  $this->format_day_time->setNumFormat("DD:hh:mm:ss");
112  }
113 
114 
115 }
116 ?>