ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilExcelUtils.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 /*
5 * Utilities for Microsoft Excel Import/Export
6 *
7 * @author Helmut Schottmüller <ilias@aurealis.de>
8 * @version $Id: class.ilExcelUtils.php 32740 2012-01-24 07:23:37Z hschottm $
9 *
10 */
11 
13 {
14  function _convert_text($a_text, $a_target = "has been removed")
15  {
16  return $a_text;
17 
18  /* utf-8 is supported
19  $a_text = preg_replace("/<[^>]*?>/", "", $a_text);
20  return utf8_decode($a_text);
21  */
22  }
23 
24  public static function ExcelAdapter()
25  {
26  $excelSetting = new ilSetting("excel");
27  $isXLS = (strcmp($excelSetting->get('creator'), 'xls') == 0 || strlen($excelSetting->get('creator')) == 0);
28  if ($isXLS)
29  {
30  // xls
31  include_once "./Services/Excel/classes/class.ilExcelXLSAdapter.php";
32  $adapter = new ilExcelXLSAdapter();
33  }
34  else
35  {
36  // xlsx
37  include_once "./Services/Excel/classes/class.ilExcelXMLAdapter.php";
38  $adapter = new ilExcelXMLAdapter();
39  }
40  return $adapter;
41  }
42 
43 } // END class.ilExcelUtils.php
44 ?>