25 include_once
"./Services/Xml/classes/class.ilXmlWriter.php";
44 private $mode = self::MODE_SOAP;
65 parent::ilXmlWriter();
67 $this->EXPORT_VERSION =
"2";
75 $this->mode = $a_mode;
85 if($this->
getMode() == self::MODE_SOAP)
92 if ($this->attach_users)
105 elseif($this->
getMode() == self::MODE_EXPORT)
117 #var_dump("<pre>", htmlentities($this->xmlDumpMem()),"<pre>"); 124 if ($a_tag ==
"Identifier" && $a_param ==
"Entry")
126 $a_value =
"il_".$this->ilias->getSetting(
'inst_id').
"_crs_".$this->course_obj->getId();
135 $this->
xmlSetDtdDef(
"<!DOCTYPE Course PUBLIC \"-//ILIAS//DTD Course//EN\" \"".ILIAS_HTTP_PATH.
"/xml/ilias_course_3_10.dtd\">");
136 $this->
xmlSetGenCmt(
"Export of ILIAS course ". $this->course_obj->getId().
" of installation ".$this->
ilias->getSetting(
'inst_id').
".");
145 $attrs[
"exportVersion"] = $this->EXPORT_VERSION;
146 $attrs[
"id"] =
"il_".$this->ilias->getSetting(
'inst_id').
'_crs_'.$this->course_obj->getId();
147 $attrs[
'showMembers'] = ($this->course_obj->getShowMembers() ?
'Yes' :
'No');
153 include_once
'Services/MetaData/classes/class.ilMD2XML.php';
155 $md2xml =
new ilMD2XML($this->course_obj->getId(),$this->course_obj->getId(),
'crs');
170 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
176 foreach($this->course_obj->getMembersObject()->getAdmins() as $id)
178 $attr[
'id'] =
'il_'.$this->ilias->getSetting(
'inst_id').
'_usr_'.$id;
179 $attr[
'notification'] = ($this->course_obj->getMembersObject()->isNotificationEnabled($id)) ?
'Yes' :
'No';
180 $attr[
'passed'] = $this->course_obj->getMembersObject()->hasPassed($id) ?
'Yes' :
'No';
190 foreach($this->course_obj->getMembersObject()->getTutors() as $id)
192 $attr[
'id'] =
'il_'.$this->ilias->getSetting(
'inst_id').
'_usr_'.$id;
193 $attr[
'notification'] = ($this->course_obj->getMembersObject()->isNotificationEnabled($id)) ?
'Yes' :
'No';
194 $attr[
'passed'] = $this->course_obj->getMembersObject()->hasPassed($id) ?
'Yes' :
'No';
203 foreach($this->course_obj->getMembersObject()->getMembers() as $id)
205 $attr[
'id'] =
'il_'.$this->ilias->getSetting(
'inst_id').
'_usr_'.$id;
206 $attr[
'blocked'] = ($this->course_obj->getMembersObject()->isBlocked($id)) ?
'Yes' :
'No';
207 $attr[
'passed'] = $this->course_obj->getMembersObject()->hasPassed($id) ?
'Yes' :
'No';
217 foreach($this->course_obj->getMembersObject()->getSubscribers() as $id)
219 $data = $this->course_obj->getMembersObject()->getSubscriberData($id);
221 $attr[
'id'] =
'il_'.$this->ilias->getSetting(
'inst_id').
'_usr_'.$id;
222 $attr[
'subscriptionTime'] =
$data[
'time'];
232 include_once
'Modules/Course/classes/class.ilCourseWaitingList.php';
236 foreach($waiting_list->getAllUsers() as
$data)
238 $attr[
'id'] =
'il_'.$this->ilias->getSetting(
'inst_id').
'_usr_'.
$data[
'usr_id'];
239 $attr[
'position'] =
$data[
'position'];
240 $attr[
'subscriptionTime'] =
$data[
'time'];
255 if($this->course_obj->getOfflineStatus())
259 elseif($this->course_obj->getActivationUnlimitedStatus())
266 $this->
xmlElement(
'Start',null,$this->course_obj->getActivationStart());
267 $this->
xmlElement(
'End',null,$this->course_obj->getActivationEnd());
268 $this->
xmlEndTag(
'TemporarilyAvailable');
273 $this->
xmlElement(
'Syllabus',null,$this->course_obj->getSyllabus());
274 $this->
xmlElement(
'ImportantInformation',null,$this->course_obj->getImportantInformation());
279 $this->
xmlElement(
'Name',null,$this->course_obj->getContactName());
280 $this->
xmlElement(
'Responsibility',null,$this->course_obj->getContactResponsibility());
281 $this->
xmlElement(
'Phone',null,$this->course_obj->getContactPhone());
282 $this->
xmlElement(
'Email',null,$this->course_obj->getContactEmail());
283 $this->
xmlElement(
'Consultation',null,$this->course_obj->getContactConsultation());
291 $attr[
'registrationType'] =
'Confirmation';
295 $attr[
'registrationType'] =
'Direct';
299 $attr[
'registrationType'] =
'Password';
302 $attr[
'maxMembers'] = $this->course_obj->isSubscriptionMembershipLimited() ?
303 $this->course_obj->getSubscriptionMaxMembers() : 0;
304 $attr[
'notification'] = $this->course_obj->getSubscriptionNotify() ?
'Yes' :
'No';
305 $attr[
'waitingList'] = $this->course_obj->enabledWaitingList() ?
'Yes' :
'No';
320 $this->
xmlElement(
'Start',null,$this->course_obj->getSubscriptionStart());
321 $this->
xmlElement(
'End',null,$this->course_obj->getSubscriptionEnd());
322 $this->
xmlEndTag(
'TemporarilyAvailable');
324 if(strlen($pwd = $this->course_obj->getSubscriptionPassword()))
334 $attr[
'type'] =
'Manual';
338 $attr[
'type'] =
'Title';
342 $attr[
'type'] =
'Activation';
350 $attr[
'Access'] =
'Disabled';
354 $attr[
'Access'] =
'Read';
358 $attr[
'Access'] =
'Download';
362 $this->
xmlElement(
'Start',null,$this->course_obj->getArchiveStart());
363 $this->
xmlElement(
'End',null,$this->course_obj->getArchiveEnd());
383 $this->attach_users = $value ? true :
false;
setAttachUsers($value)
write access to attach user property, if set to false no users will be attached.
xmlSetGenCmt($genCmt)
Sets generated comment.
xmlSetDtdDef($dtdDef)
Sets dtd definition.
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
ilCourseXMLWriter(&$course_obj)
constructor
xmlElement($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
Writes a basic element (no children, just textual content)
const IL_CRS_SUBSCRIPTION_CONFIRMATION
xmlEndTag($tag)
Writes an endtag.
const IL_CRS_SUBSCRIPTION_UNLIMITED
const IL_CRS_VIEW_ARCHIVE
redirection script todo: (a better solution should control the processing via a xml file) ...
xmlHeader()
Writes xml header public.
static _appendXMLByObjId(ilXmlWriter $xml_writer, $a_obj_id)
Get xml of object values.
modifyExportIdentifier($a_tag, $a_param, $a_value)
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
const IL_CRS_ARCHIVE_DOWNLOAD
appendXML($a_str)
append xml string to document
const IL_CRS_SUBSCRIPTION_DIRECT
xmlDumpMem($format=TRUE)
Returns xml document from memory.
const IL_CRS_SUBSCRIPTION_DEACTIVATED
__buildAdvancedMetaData()
Build advanced meta data.