ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilImportExportFactory.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
11 {
12 
13  public static function getExporterClass($a_type)
14  {
18  global $objDefinition;
19 
20  if($objDefinition->isPlugin($a_type))
21  {
22  $classname = 'il'.$objDefinition->getClassName($a_type).'Exporter';
23  $location = $objDefinition->getLocation($a_type);
24  if(include_once $location.'/class.'.$classname.'.php')
25  {
26  return $classname;
27  }
28  }
29  else
30  {
31  $comp = $objDefinition->getComponentForType($a_type);
32  $c = explode("/", $comp);
33  $class = "il".$c[1]."Exporter";
34 
35  // the next line had a "@" in front of the include_once
36  // I removed this because it tages ages to track down errors
37  // if the include class contains parse errors.
38  // Alex, 20 Jul 2012
39  if(include_once "./".$comp."/classes/class.".$class.".php")
40  {
41  return $class;
42  }
43  }
44 
45  throw InvalidArgumentException('Invalid exporter type given');
46  }
47 }
48 ?>