25 include_once
"./Services/Xml/classes/class.ilXmlWriter.php";
67 $this->EXPORT_VERSION =
"2";
75 $this->mode = $a_mode;
85 if($this->
getMode() == self::MODE_SOAP)
92 if ($this->attach_users)
103 #$this->__buildObject($this->course_obj->getRefId());
107 elseif($this->
getMode() == self::MODE_EXPORT)
119 #var_dump("<pre>", htmlentities($this->xmlDumpMem()),"<pre>");
126 if ($a_tag ==
"Identifier" && $a_param ==
"Entry")
128 $a_value =
"il_".$this->ilias->getSetting(
'inst_id').
"_crs_".$this->course_obj->getId();
137 $this->
xmlSetDtdDef(
"<!DOCTYPE Course PUBLIC \"-//ILIAS//DTD Course//EN\" \"".ILIAS_HTTP_PATH.
"/xml/ilias_course_3_10.dtd\">");
138 $this->
xmlSetGenCmt(
"Export of ILIAS course ". $this->course_obj->getId().
" of installation ".$this->ilias->getSetting(
'inst_id').
".");
147 $attrs[
"exportVersion"] = $this->EXPORT_VERSION;
148 $attrs[
"id"] =
"il_".$this->ilias->getSetting(
'inst_id').
'_crs_'.$this->course_obj->getId();
149 $attrs[
'showMembers'] = ($this->course_obj->getShowMembers() ?
'Yes' :
'No');
155 include_once
'Services/MetaData/classes/class.ilMD2XML.php';
157 $md2xml =
new ilMD2XML($this->course_obj->getId(),$this->course_obj->getId(),
'crs');
172 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
178 foreach($this->course_obj->getMembersObject()->getAdmins() as $id)
180 $attr[
'id'] =
'il_'.$this->ilias->getSetting(
'inst_id').
'_usr_'.$id;
181 $attr[
'notification'] = ($this->course_obj->getMembersObject()->isNotificationEnabled($id)) ?
'Yes' :
'No';
182 $attr[
'passed'] = $this->course_obj->getMembersObject()->hasPassed($id) ?
'Yes' :
'No';
192 foreach($this->course_obj->getMembersObject()->getTutors() as $id)
194 $attr[
'id'] =
'il_'.$this->ilias->getSetting(
'inst_id').
'_usr_'.$id;
195 $attr[
'notification'] = ($this->course_obj->getMembersObject()->isNotificationEnabled($id)) ?
'Yes' :
'No';
196 $attr[
'passed'] = $this->course_obj->getMembersObject()->hasPassed($id) ?
'Yes' :
'No';
205 foreach($this->course_obj->getMembersObject()->getMembers() as $id)
207 $attr[
'id'] =
'il_'.$this->ilias->getSetting(
'inst_id').
'_usr_'.$id;
208 $attr[
'blocked'] = ($this->course_obj->getMembersObject()->isBlocked($id)) ?
'Yes' :
'No';
209 $attr[
'passed'] = $this->course_obj->getMembersObject()->hasPassed($id) ?
'Yes' :
'No';
219 foreach($this->course_obj->getMembersObject()->getSubscribers() as $id)
221 $data = $this->course_obj->getMembersObject()->getSubscriberData($id);
223 $attr[
'id'] =
'il_'.$this->ilias->getSetting(
'inst_id').
'_usr_'.$id;
224 $attr[
'subscriptionTime'] =
$data[
'time'];
234 include_once
'Modules/Course/classes/class.ilCourseWaitingList.php';
238 foreach($waiting_list->getAllUsers() as
$data)
240 $attr[
'id'] =
'il_'.$this->ilias->getSetting(
'inst_id').
'_usr_'.
$data[
'usr_id'];
241 $attr[
'position'] =
$data[
'position'];
242 $attr[
'subscriptionTime'] =
$data[
'time'];
257 if($this->course_obj->getOfflineStatus())
261 elseif($this->course_obj->getActivationUnlimitedStatus())
268 $this->
xmlElement(
'Start',null,$this->course_obj->getActivationStart());
269 $this->
xmlElement(
'End',null,$this->course_obj->getActivationEnd());
270 $this->
xmlEndTag(
'TemporarilyAvailable');
275 $this->
xmlElement(
'Syllabus',null,$this->course_obj->getSyllabus());
276 $this->
xmlElement(
'ImportantInformation',null,$this->course_obj->getImportantInformation());
281 $this->
xmlElement(
'Name',null,$this->course_obj->getContactName());
282 $this->
xmlElement(
'Responsibility',null,$this->course_obj->getContactResponsibility());
283 $this->
xmlElement(
'Phone',null,$this->course_obj->getContactPhone());
284 $this->
xmlElement(
'Email',null,$this->course_obj->getContactEmail());
285 $this->
xmlElement(
'Consultation',null,$this->course_obj->getContactConsultation());
293 $attr[
'registrationType'] =
'Confirmation';
297 $attr[
'registrationType'] =
'Direct';
301 $attr[
'registrationType'] =
'Password';
304 $attr[
'maxMembers'] = $this->course_obj->getSubscriptionMaxMembers();
305 $attr[
'notification'] = $this->course_obj->getSubscriptionNotify() ?
'Yes' :
'No';
306 $attr[
'waitingList'] = $this->course_obj->enabledWaitingList() ?
'Yes' :
'No';
321 $this->
xmlElement(
'Start',null,$this->course_obj->getSubscriptionStart());
322 $this->
xmlElement(
'End',null,$this->course_obj->getSubscriptionEnd());
323 $this->
xmlEndTag(
'TemporarilyAvailable');
325 if(strlen($pwd = $this->course_obj->getSubscriptionPassword()))
335 $attr[
'type'] =
'Manual';
339 $attr[
'type'] =
'Title';
343 $attr[
'type'] =
'Activation';
351 $attr[
'Access'] =
'Disabled';
355 $attr[
'Access'] =
'Read';
359 $attr[
'Access'] =
'Download';
363 $this->
xmlElement(
'Start',null,$this->course_obj->getArchiveStart());
364 $this->
xmlElement(
'End',null,$this->course_obj->getArchiveEnd());
377 $this->course_obj->initCourseItemObject();
378 $this->course_obj->items_obj->setParentId($a_parent_id);
380 foreach($this->course_obj->items_obj->getAllItems() as $item)
389 $attr[
'id'] =
'il_'.$this->ilias->getSetting(
'inst_id').
'_'.$tmp_obj->getType().
'_'.$item[
'child'];
390 $attr[
'type'] = $tmp_obj->getType();
391 $attr[
'Unlimited'] = $item[
'activation_unlimited'] ? 1 : 0;
392 $attr[
'Position'] = $item[
'position'];
395 $this->
xmlElement(
'Title',null,$item[
'title']);
396 $this->
xmlElement(
'Description',null,$item[
'description']);
397 $this->
xmlElement(
'Start',null,$item[
'activation_start']);
398 $this->
xmlElement(
'End',null,$item[
'activation_end']);
400 if($item[
'type'] ==
'file')
402 $this->
xmlElement(
'FileType',null,$tmp_obj->getFileType());
424 $this->attach_users = $value ?
true :
false;