4 include_once
'./Services/Export/classes/class.ilExportOptions.php';
48 $this->obj_definition = $DIC[
"objDefinition"];
64 public function parse($a_root_id)
66 $this->sxml = simplexml_load_string($this->xml);
67 $this->root_id = $a_root_id;
69 foreach ($this->sxml->Item as $item) {
70 $this->
initItem($item, $this->mapping->getTargetId());
80 protected function initItem($item, $a_parent_node)
85 $ref_id = (
string) $item[
'RefId'];
86 $obj_id = (
string) $item[
'Id'];
90 $new_ref = $this->
getMapping()->getMapping(
'Services/Container',
'refs', $ref_id);
94 ($obj_id == $this->root_id)
98 $new_ref = $this->mapping->getMapping(
'Services/Container',
'refs', 0);
109 foreach ($item->Timing as $timing) {
110 $this->
parseTiming($new_ref, $a_parent_node, $timing);
113 foreach ($item->Item as $subitem) {
114 $this->
initItem($subitem, $new_ref);
117 $new_obj_id = $this->mapping->getMapping(
'Services/Container',
'objs', $obj_id);
120 if ((
int) $item[
'Style']) {
121 self::$style_map[(int) $item[
'Style']][] = $new_obj_id;
125 if (
$ilSetting->get(
'enable_cat_page_edit',
false)) {
126 if ($item[
'Page'] ==
"1") {
127 $this->mapping->addMapping(
'Services/COPage',
'pg',
'cont:' . $obj_id,
'cont:' . $new_obj_id);
128 $this->cont_log->debug(
"add pg cont mapping, old: " . $obj_id .
", new: " . $new_obj_id .
", Page: -" . $item[
'Page'] .
"-");
131 if ($item[
'StartPage'] ==
"1") {
132 $this->mapping->addMapping(
'Services/COPage',
'pg',
'cstr:' . $obj_id,
'cstr:' . $new_obj_id);
147 $visible = (
string) $timing[
'Visible'];
148 $changeable = (
string) $timing[
'Changeable'];
150 include_once
'./Services/Object/classes/class.ilObjectActivation.php';
152 $crs_item->setTimingType(
$type);
153 $crs_item->toggleVisible((
bool) $visible);
154 $crs_item->toggleChangeable((
bool) $changeable);
156 foreach ($timing->children() as $sub) {
157 switch ((
string) $sub->getName()) {
168 case 'SuggestionStart':
170 $crs_item->setSuggestionStart($dt->get(
IL_CAL_UNIX));
173 case 'SuggestionEnd':
175 $crs_item->setSuggestionEnd($dt->get(
IL_CAL_UNIX));
178 case 'EarliestStart':
180 $crs_item->setEarliestStart($dt->get(
IL_CAL_UNIX));
191 if ($crs_item->getTimingStart()) {
192 $crs_item->update($a_ref_id, $a_parent_id);
210 $new_obj_id = $this->
getMapping()->getMapping(
'Services/Container',
'objs', $obj_id);
212 include_once
'./Services/Object/classes/class.ilObjectFactory.php';
215 $obj->createReference();
216 $obj->putInTree($parent_node);
217 $obj->setPermissions($parent_node);
218 $this->mapping->addMapping(
'Services/Container',
'refs', $ref_id, $obj->getRefId());
219 return $obj->getRefId();
223 $class_name =
"ilObj" . $objDefinition->getClassName(
$type);
226 include_once(
$location .
"/class." . $class_name .
".php");
227 $new =
new $class_name();
230 $new->createReference();
231 $new->putInTree($parent_node);
232 $new->setPermissions($parent_node);
234 $this->mapping->addMapping(
'Services/Container',
'objs', $obj_id,
$new->getId());
235 $this->mapping->addMapping(
'Services/Container',
'refs', $ref_id,
$new->getRefId());
237 return $new->getRefId();
initItem($item, $a_parent_node)
Init Item.
__construct(ilImportMapping $mapping, $xml='')
Constructor.
getMapping()
Get ilImportMapping object.
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.