4 include_once
'./Services/Export/classes/class.ilExportOptions.php';
43 $this->sxml = simplexml_load_string($this->xml);
45 foreach($this->sxml->Item as $item)
47 $this->
initItem($item,$this->mapping->getTargetId());
57 protected function initItem($item, $a_parent_node)
59 $title = (string) $item[
'Title'];
60 $ref_id = (string) $item[
'RefId'];
61 $obj_id = (string) $item[
'Id'];
62 $type = (string) $item[
'Type'];
67 foreach($item->Timing as $timing)
69 $this->
parseTiming($new_ref,$a_parent_node,$timing);
72 foreach($item->Item as $subitem)
85 protected function parseTiming($a_ref_id,$a_parent_id,$timing)
87 $type = (string) $timing[
'Type'];
88 $visible = (string) $timing[
'Visible'];
89 $changeable = (string) $timing[
'Changeable'];
91 include_once
'./Services/Object/classes/class.ilObjectActivation.php';
93 $crs_item->setTimingType($type);
94 $crs_item->toggleVisible((
bool) $visible);
95 $crs_item->toggleChangeable((
bool) $changeable);
97 foreach($timing->children() as $sub)
99 switch((
string) $sub->getName())
111 case 'SuggestionStart':
113 $crs_item->setSuggestionStart($dt->get(
IL_CAL_UNIX));
116 case 'SuggestionEnd':
118 $crs_item->setSuggestionEnd($dt->get(
IL_CAL_UNIX));
121 case 'EarliestStart':
123 $crs_item->setEarliestStart($dt->get(
IL_CAL_UNIX));
134 if($crs_item->getTimingStart())
136 $crs_item->update($a_ref_id, $a_parent_id);
151 global $objDefinition;
154 $new_obj_id = $this->
getMapping()->getMapping(
'Services/Container',
'objs', $obj_id);
157 include_once
'./Services/Object/classes/class.ilObjectFactory.php';
161 $obj->createReference();
162 $obj->putInTree($parent_node);
163 $obj->setPermissions($parent_node);
164 $this->mapping->addMapping(
'Services/Container',
'refs',
$ref_id,$obj->getRefId());
165 return $obj->getRefId();
169 $class_name =
"ilObj".$objDefinition->getClassName($type);
170 $location = $objDefinition->getLocation($type);
172 include_once(
$location.
"/class.".$class_name.
".php");
173 $new =
new $class_name();
176 $new->createReference();
177 $new->putInTree($parent_node);
178 $new->setPermissions($parent_node);
180 $this->mapping->addMapping(
'Services/Container',
'objs', $obj_id, $new->getId());
181 $this->mapping->addMapping(
'Services/Container',
'refs',
$ref_id,$new->getRefId());
183 return $new->getRefId();