4 include_once
'./Services/Export/classes/class.ilExportOptions.php';
51 public function parse($a_root_id)
53 $this->sxml = simplexml_load_string($this->xml);
54 $this->root_id = $a_root_id;
56 foreach($this->sxml->Item as $item)
58 $this->
initItem($item,$this->mapping->getTargetId());
68 protected function initItem($item, $a_parent_node)
74 $obj_id = (
string) $item[
'Id'];
75 $type = (
string) $item[
'Type'];
78 $new_ref = $this->
getMapping()->getMapping(
'Services/Container',
'refs',
$ref_id);
82 ($obj_id == $this->root_id)
87 $new_ref = $this->mapping->getMapping(
'Services/Container',
'refs', 0);
99 foreach($item->Timing as $timing)
101 $this->
parseTiming($new_ref,$a_parent_node,$timing);
104 foreach($item->Item as $subitem)
106 $this->
initItem($subitem, $new_ref);
109 $new_obj_id = $this->mapping->getMapping(
'Services/Container',
'objs', $obj_id);
112 if((
int)$item[
'Style'])
114 self::$style_map[(int)$item[
'Style']][] = $new_obj_id;
118 if($ilSetting->get(
'enable_cat_page_edit',
false))
120 if($item[
'Page'] ==
"1")
122 $this->mapping->addMapping(
'Services/COPage',
'pg',
'cont:'.$obj_id,
'cont:'.$new_obj_id);
123 $this->cont_log->debug(
"add pg cont mapping, old: ".$obj_id.
", new: ".$new_obj_id.
", Page: -".$item[
'Page'].
"-");
126 if($item[
'StartPage'] ==
"1")
128 $this->mapping->addMapping(
'Services/COPage',
'pg',
'cstr:'.$obj_id,
'cstr:'.$new_obj_id);
142 $type = (
string) $timing[
'Type'];
143 $visible = (
string) $timing[
'Visible'];
144 $changeable = (
string) $timing[
'Changeable'];
146 include_once
'./Services/Object/classes/class.ilObjectActivation.php';
148 $crs_item->setTimingType($type);
149 $crs_item->toggleVisible((
bool) $visible);
150 $crs_item->toggleChangeable((
bool) $changeable);
152 foreach($timing->children() as $sub)
154 switch((
string) $sub->getName())
166 case 'SuggestionStart':
168 $crs_item->setSuggestionStart($dt->get(
IL_CAL_UNIX));
171 case 'SuggestionEnd':
173 $crs_item->setSuggestionEnd($dt->get(
IL_CAL_UNIX));
176 case 'EarliestStart':
178 $crs_item->setEarliestStart($dt->get(
IL_CAL_UNIX));
189 if($crs_item->getTimingStart())
191 $crs_item->update($a_ref_id, $a_parent_id);
206 global $objDefinition;
209 $new_obj_id = $this->
getMapping()->getMapping(
'Services/Container',
'objs', $obj_id);
212 include_once
'./Services/Object/classes/class.ilObjectFactory.php';
216 $obj->createReference();
217 $obj->putInTree($parent_node);
218 $obj->setPermissions($parent_node);
219 $this->mapping->addMapping(
'Services/Container',
'refs',
$ref_id,$obj->getRefId());
220 return $obj->getRefId();
224 $class_name =
"ilObj".$objDefinition->getClassName($type);
225 $location = $objDefinition->getLocation($type);
227 include_once(
$location.
"/class.".$class_name.
".php");
228 $new =
new $class_name();
231 $new->createReference();
232 $new->putInTree($parent_node);
233 $new->setPermissions($parent_node);
235 $this->mapping->addMapping(
'Services/Container',
'objs', $obj_id,
$new->getId());
236 $this->mapping->addMapping(
'Services/Container',
'refs',
$ref_id,
$new->getRefId());
238 return $new->getRefId();
initItem($item, $a_parent_node)
Init Item.
__construct(ilImportMapping $mapping, $xml='')
Constructor.
Class ilObject Basic functions for all objects.
getMapping()
Get ilImportMapping object.
Add rich text string
The name of the decorator.
static _lookupObjId($a_id)
createObject($ref_id, $obj_id, $type, $title, $parent_node)
Create the objects.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Create styles array
The data for the language used.
parseTiming($a_ref_id, $a_parent_id, $timing)
Parse timing info.
XML parser for container structure.
static getLogger($a_component_id)
Get component logger.
Class ilObjectActivation.