14 public static function getExporterClass(
$a_type)
19 global $objDefinition;
21 if ($objDefinition->isPlugin(
$a_type)) {
22 $classname =
'il' . $objDefinition->getClassName(
$a_type) .
'Exporter';
24 if (include_once
$location .
'/class.' . $classname .
'.php') {
28 $comp = $objDefinition->getComponentForType(
$a_type);
29 $class = array_pop(explode(
"/", $comp));
30 $class =
"il" . $class .
"Exporter";
34 if (class_exists($class)) {
42 if (include_once
"./" . $comp .
"/classes/class." . $class .
".php") {
50 public static function getComponentForExport(
$a_type)
55 global $objDefinition;
57 if ($objDefinition->isPlugin(
$a_type)) {
58 return self::PLUGINS_DIR .
"/" .
$a_type;
60 return $objDefinition->getComponentForType(
$a_type);
71 public static function getImporterClass($a_component)
76 global $objDefinition;
78 $parts = explode(
'/', $a_component);
79 $component_type = $parts[0];
80 $component = $parts[1];
82 if ($component_type == self::PLUGINS_DIR &&
83 $objDefinition->isPlugin($component)) {
84 $classname =
'il' . $objDefinition->getClassName($component) .
'Importer';
85 $location = $objDefinition->getLocation($component);
86 if (include_once
$location .
'/class.' . $classname .
'.php') {
90 $class =
"il" . $component .
"Importer";
97 if (class_exists($class)) {
103 elseif ($component_type == self::PLUGINS_DIR) {
106 $a_component = str_replace(
"..",
"", $a_component);
107 if (is_file(
"./" . $a_component .
"/classes/class." . $class .
".php")) {
108 if (include_once
"./" . $a_component .
"/classes/class." . $class .
".php") {
114 throw new InvalidArgumentException(
'Invalid importer type given: ' .
"./" . $a_component .
"/classes/class." . $class .
".php");
Factory for importer/exporter implementers.