ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilCourseXMLParser Class Reference

Course XML Parser. More...

+ Inheritance diagram for ilCourseXMLParser:
+ Collaboration diagram for ilCourseXMLParser:

Public Member Functions

 __construct ($a_course_obj, $a_xml_file='')
 Constructor. More...
 
 setHandlers ($a_xml_parser)
 set event handlers More...
 
 handlerBeginTag ($a_xml_parser, $a_name, $a_attribs)
 handler for begin of element More...
 
 handlerEndTag ($a_xml_parser, $a_name)
 handler for end of element More...
 
 handlerCharacterData ($a_xml_parser, $a_data)
 handler for character data More...
 
 __parseId ($a_id)
 
- Public Member Functions inherited from ilMDSaxParser
 __construct ($a_xml_file='')
 Constructor. More...
 
 enableMDParsing ($a_status)
 
 getMDParsingStatus ()
 
 setMDObject (&$md)
 
getMDObject ()
 
 inMetaData ()
 
 setHandlers ($a_xml_parser)
 set event handlers More...
 
 handlerBeginTag ($a_xml_parser, $a_name, $a_attribs)
 handler for begin of element More...
 
 handlerEndTag ($a_xml_parser, $a_name)
 handler for end of element More...
 
 handlerCharacterData ($a_xml_parser, $a_data)
 handler for character data More...
 
 __getCharacterData ()
 
 __pushParent (&$md_obj)
 
__popParent ()
 
__getParent ()
 
 __construct ($a_xml_file='')
 Constructor. More...
 
 setMDObject (&$md)
 
 inMetaData ()
 
 handlerBeginTag ($a_xml_parser, $a_name, $a_attribs)
 handler for begin of element More...
 
 handlerEndTag ($a_xml_parser, $a_name)
 handler for end of element More...
 
 handlerCharacterData ($a_xml_parser, $a_data)
 handler for character data More...
 
 __getCharacterData ()
 
 __pushParent (&$md_obj)
 
__popParent ()
 
__getParent ()
 
- Public Member Functions inherited from ilSaxParser
 __construct ($a_xml_file='', $throwException=false)
 Constructor setup ILIAS global object public. More...
 
 setXMLContent ($a_xml_content)
 
 getXMLContent ()
 
 getInputType ()
 
 startParsing ()
 stores xml data in array More...
 
 createParser ()
 create parser More...
 
 setOptions ($a_xml_parser)
 set parser options More...
 
 setHandlers ($a_xml_parser)
 set event handler should be overwritten by inherited class private More...
 
 openXMLFile ()
 open xml file More...
 
 parse ($a_xml_parser, $a_fp=null)
 parse xml file More...
 
 freeParser ($a_xml_parser)
 free xml parser handle More...
 
 setThrowException ($throwException)
 set error handling More...
 
- Public Member Functions inherited from PEAR
 __construct ($error_class=null)
 Constructor. More...
 
 _PEAR ()
 Destructor (the emulated type of...). More...
 
 registerShutdownFunc ($func, $args=array())
 Use this function to register a shutdown method for static classes. More...
 
 isError ($data, $code=null)
 Tell whether a value is a PEAR error. More...
 
 expectError ($code=' *')
 This method is used to tell which errors you expect to get. More...
 
 popExpect ()
 This method pops one element off the expected error codes stack. More...
 
 _checkDelExpect ($error_code)
 This method checks unsets an error code if available. More...
 
 delExpect ($error_code)
 This method deletes all occurences of the specified element from the expected error codes stack. More...
 
raiseError ($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
 This method is a wrapper that returns an instance of the configured error class with this object's default error handling applied. More...
 
throwError ($message=null, $code=null, $userinfo=null)
 Simpler form of raiseError with fewer options. More...
 
 staticPushErrorHandling ($mode, $options=null)
 
 staticPopErrorHandling ()
 
 pushErrorHandling ($mode, $options=null)
 Push a new error handler on top of the error handler options stack. More...
 
 popErrorHandling ()
 Pop the last error handler used. More...
 
 loadExtension ($ext)
 OS independant PHP extension load. More...
 

Data Fields

 $lng
 
 $md_obj = null
 
- Data Fields inherited from ilMDSaxParser
 $md_in_md = false
 
 $md_chr_data = ''
 
 $md_cur_el = null
 
 $md_parsing_enabled = null
 
 $md = null
 
 $md_gen
 
- Data Fields inherited from ilSaxParser
 $input_type = null
 
 $xml_content = ''
 
 $ilias
 
 $lng
 
 $xml_file
 
 $throwException = false
 
- Data Fields inherited from PEAR
 $_debug = false
 
 $_default_error_mode = null
 
 $_default_error_options = null
 
 $_default_error_handler = ''
 
 $_error_class = 'PEAR_Error'
 
 $_expected_errors = array()
 

Private Member Functions

 handleMember ($a_attribs, $id_data)
 attach or detach user/member/admin from course member More...
 
 handleAdmin ($a_attribs, $id_data)
 attach or detach admin from course member More...
 
 handleTutor ($a_attribs, $id_data)
 attach or detach admin from course member More...
 
 handleSubscriber ($a_attribs, $id_data)
 attach or detach members from subscribers More...
 
 handleWaitingList ($a_attribs, $id_data)
 attach or detach members from waitinglist More...
 

Private Attributes

 $current_container_setting
 

Additional Inherited Members

- Static Public Member Functions inherited from PEAR
static & getStaticProperty ($class, $var)
 If you have a class that's mostly/entirely static, and you need static properties, you can use this method to simulate them. More...
 
static setErrorHandling ($mode=null, $options=null)
 Sets how errors generated by this object should be handled. More...
 
- Protected Member Functions inherited from ilSaxParser
 handleError ($message, $code)
 use given error handler to handle error message or internal ilias error message handle More...
 
- Protected Attributes inherited from ilMDSaxParser
 $meta_log
 

Detailed Description

Course XML Parser.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 43 of file class.ilCourseXMLParser.php.

Constructor & Destructor Documentation

◆ __construct()

ilCourseXMLParser::__construct (   $a_course_obj,
  $a_xml_file = '' 
)

Constructor.

Parameters
ilObject$a_content_objectmust be of type ilObjContentObject ilObjTest or ilObjQuestionPool
string$a_xml_filexml file
string$a_subdirsubdirectory in import directory public

Definition at line 59 of file class.ilCourseXMLParser.php.

References $ilLog, $lng, ilCourseParticipants\_getInstanceByObjId(), and ilMDSaxParser\setMDObject().

60  {
61  global $lng,$ilLog;
62 
63  parent::__construct($a_xml_file);
64 
65  $this->sax_controller = new ilSaxController();
66 
67  $this->log = $ilLog;
68 
69  $this->course_obj = $a_course_obj;
70  $this->course_members = ilCourseParticipants::_getInstanceByObjId($this->course_obj->getId());
71  $this->course_waiting_list = new ilCourseWaitingList($this->course_obj->getId());
72  // flip the array so we can use array_key_exists
73  $this->course_members_array = array_flip($this->course_members->getParticipants());
74 
75  $this->md_obj = new ilMD($this->course_obj->getId(), 0, 'crs');
76  $this->setMDObject($this->md_obj);
77 
78  $this->lng = $lng;
79  }
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
Controller class for sax element handlers.
+ Here is the call graph for this function:

Member Function Documentation

◆ __parseId()

ilCourseXMLParser::__parseId (   $a_id)

Definition at line 610 of file class.ilCourseXMLParser.php.

References $id, ilSaxParser\$ilias, ilObjUser\_getImportedUserId(), ilObjUser\_lookupLogin(), and array.

Referenced by handlerBeginTag().

611  {
612  global $ilias;
613 
614  $fields = explode('_', $a_id);
615 
616  if (!is_array($fields) or
617  $fields[0] != 'il' or
618  !is_numeric($fields[1]) or
619  $fields[2] != 'usr' or
620  !is_numeric($fields[3])) {
621  return false;
622  }
623  if ($id = ilObjUser::_getImportedUserId($a_id)) {
624  return array('imported' => true,
625  'local' => false,
626  'usr_id' => $id);
627  }
628  if (($fields[1] == $ilias->getSetting('inst_id', 0)) and strlen(ilObjUser::_lookupLogin($fields[3]))) {
629  return array('imported' => false,
630  'local' => true,
631  'usr_id' => $fields[3]);
632  }
633  return false;
634  }
static _lookupLogin($a_user_id)
lookup login
if(!array_key_exists('StateId', $_REQUEST)) $id
static _getImportedUserId($i2_id)
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleAdmin()

ilCourseXMLParser::handleAdmin (   $a_attribs,
  $id_data 
)
private

attach or detach admin from course member

Parameters
string$a_attribsattribute of a node
array$id_data

Definition at line 336 of file class.ilCourseXMLParser.php.

References IL_CRS_ADMIN.

Referenced by handlerBeginTag().

337  {
338  global $rbacadmin;
339 
340  if (!isset($a_attribs['action']) || $a_attribs['action'] == 'Attach') {
341  // if action not set, or attach
342  if (!array_key_exists($id_data['usr_id'], $this->course_members_array)) {
343  // add only if member is not assigned yet
344  $this->course_members->add($id_data['usr_id'], IL_CRS_ADMIN);
345  if ($a_attribs['notification'] == 'Yes') {
346  $this->course_members->updateNotification($id_data['usr_id'], true);
347  }
348  if ($a_attribs['passed'] == 'Yes') {
349  $this->course_members->updatePassed($id_data['usr_id'], true);
350  }
351  $this->course_members_array[$id_data['usr_id']] = "added";
352  } else {
353  // update
354  if ($a_attribs['notification'] == 'Yes') {
355  $this->course_members->updateNotification($id_data['usr_id'], true);
356  }
357  if ($a_attribs['passed'] == 'Yes') {
358  $this->course_members->updatePassed($id_data['usr_id'], true);
359  }
360  $this->course_members->updateBlocked($id_data['usr_id'], false);
361  }
362  } elseif (isset($a_attribs['action']) && $a_attribs['action'] == 'Detach' && $this->course_members->isAdmin($id_data['usr_id'])) {
363  // if action set and detach and is admin of course
364  $this->course_members->delete($id_data['usr_id']);
365  }
366  }
const IL_CRS_ADMIN
Base class for course and group participants.
+ Here is the caller graph for this function:

◆ handleMember()

ilCourseXMLParser::handleMember (   $a_attribs,
  $id_data 
)
private

attach or detach user/member/admin from course member

Parameters
array$a_attribsattributes of nod
array$id_data
int$roletypetype of role, which is courseMember->

Definition at line 299 of file class.ilCourseXMLParser.php.

References IL_CRS_MEMBER.

Referenced by handlerBeginTag().

300  {
301  if (!isset($a_attribs['action']) || $a_attribs['action'] == 'Attach') {
302  // if action not set, or set and attach
303  if (!array_key_exists($id_data['usr_id'], $this->course_members_array)) {
304  // add only if member is not yet assigned as tutor or admin
305  $this->course_members->add($id_data['usr_id'], IL_CRS_MEMBER);
306  if ($a_attribs['blocked'] == 'Yes') {
307  $this->course_members->updateBlocked($id_data['usr_id'], true);
308  }
309  if ($a_attribs['passed'] == 'Yes') {
310  $this->course_members->updatePassed($id_data['usr_id'], true);
311  }
312  $this->course_members_array[$id_data['usr_id']] = "added";
313  } else {
314  // the member does exist. Now update status etc. only
315  if ($a_attribs['blocked'] == 'Yes') {
316  $this->course_members->updateBlocked($id_data['usr_id'], true);
317  }
318  if ($a_attribs['passed'] == 'Yes') {
319  $this->course_members->updatePassed($id_data['usr_id'], true);
320  }
321  }
322  } elseif (isset($a_attribs['action']) && $a_attribs['action'] == 'Detach' && $this->course_members->isMember($id_data['usr_id'])) {
323  // if action set and detach and is member of course
324  $this->course_members->delete($id_data['usr_id']);
325  }
326  }
const IL_CRS_MEMBER
+ Here is the caller graph for this function:

◆ handlerBeginTag()

ilCourseXMLParser::handlerBeginTag (   $a_xml_parser,
  $a_name,
  $a_attribs 
)

handler for begin of element

Parameters
resource$a_xml_parserxml parser
string$a_nameelement name
array$a_attribselement attributes array

Implements ilSaxSubsetParser.

Definition at line 109 of file class.ilCourseXMLParser.php.

References __parseId(), ilContainerSortingSettings\_importContainerSortingSettings(), ilObject\_writeImportId(), ilContainerSortingSettings\getInstanceByObjId(), handleAdmin(), handleMember(), handleSubscriber(), handleTutor(), handleWaitingList(), IL_CRS_ACTIVATION_LIMITED, IL_CRS_ACTIVATION_OFFLINE, IL_CRS_ACTIVATION_UNLIMITED, IL_CRS_SUBSCRIPTION_CONFIRMATION, IL_CRS_SUBSCRIPTION_DEACTIVATED, IL_CRS_SUBSCRIPTION_DIRECT, IL_CRS_SUBSCRIPTION_LIMITED, IL_CRS_SUBSCRIPTION_PASSWORD, and IL_CRS_SUBSCRIPTION_UNLIMITED.

110  {
111  if ($this->in_meta_data) {
112  parent::handlerBeginTag($a_xml_parser, $a_name, $a_attribs);
113  return;
114  }
115 
116  switch ($a_name) {
117  case 'Course':
118 
119  if (strlen($a_attribs['importId'])) {
120  $this->log->write("CourseXMLParser: importId = " . $a_attribs['importId']);
121  $this->course_obj->setImportId($a_attribs['importId']);
122  ilObject::_writeImportId($this->course_obj->getId(), $a_attribs['importId']);
123  }
124  if (strlen($a_attribs['showMembers'])) {
125  $this->course_obj->setShowMembers(
126  $a_attribs['showMembers'] == 'Yes' ? true : false
127  );
128  }
129  break;
130 
131  case 'Admin':
132  if ($id_data = $this->__parseId($a_attribs['id'])) {
133  if ($id_data['local'] or $id_data['imported']) {
134  $this->handleAdmin($a_attribs, $id_data);
135  }
136  }
137  break;
138 
139  case 'Tutor':
140  if ($id_data = $this->__parseId($a_attribs['id'])) {
141  if ($id_data['local'] or $id_data['imported']) {
142  $this->handleTutor($a_attribs, $id_data);
143  }
144  }
145  break;
146 
147  case 'Member':
148  if ($id_data = $this->__parseId($a_attribs['id'])) {
149  if ($id_data['local'] or $id_data['imported']) {
150  $this->handleMember($a_attribs, $id_data);
151  }
152  }
153  break;
154 
155  case 'Subscriber':
156  if ($id_data = $this->__parseId($a_attribs['id'])) {
157  if ($id_data['local'] or $id_data['imported']) {
158  $this->handleSubscriber($a_attribs, $id_data);
159  }
160  }
161  break;
162 
163  case 'WaitingList':
164  if ($id_data = $this->__parseId($a_attribs['id'])) {
165  if ($id_data['local'] or $id_data['imported']) {
166  $this->handleWaitingList($a_attribs, $id_data);
167  }
168  }
169  break;
170 
171  case 'Owner':
172  if ($id_data = $this->__parseId($a_attribs['id'])) {
173  if ($id_data['local'] or $id_data['imported']) {
174  $this->course_obj->setOwner($id_data['usr_id']);
175  $this->course_obj->updateOwner();
176  }
177  }
178  break;
179 
180 
181  case 'Settings':
182  $this->in_settings = true;
183  break;
184  case 'Availability':
185  $this->in_availability = true;
186  break;
187 
188  case 'NotAvailable':
189  if ($this->in_availability) {
190  $this->course_obj->setActivationType(IL_CRS_ACTIVATION_OFFLINE);
191  } elseif ($this->in_registration) {
192  $this->course_obj->setSubscriptionLimitationType(IL_CRS_SUBSCRIPTION_DEACTIVATED);
193  }
194 
195  break;
196 
197  case 'Unlimited':
198  if ($this->in_availability) {
199  $this->course_obj->setOfflineStatus(false);
200  $this->course_obj->setActivationType(IL_CRS_ACTIVATION_UNLIMITED);
201  } elseif ($this->in_registration) {
202  $this->course_obj->setSubscriptionLimitationType(IL_CRS_SUBSCRIPTION_UNLIMITED);
203  }
204 
205  break;
206  case 'TemporarilyAvailable':
207  if ($this->in_availability) {
208  $this->course_obj->setOfflineStatus(false);
209  $this->course_obj->setActivationType(IL_CRS_ACTIVATION_LIMITED);
210  } elseif ($this->in_registration) {
211  $this->course_obj->setSubscriptionLimitationType(IL_CRS_SUBSCRIPTION_LIMITED);
212  }
213  break;
214 
215  case 'Start':
216  break;
217 
218  case 'End':
219  break;
220 
221  case 'Syllabus':
222  break;
223 
224  case 'Contact':
225  break;
226 
227  case 'Name':
228  case 'Responsibility':
229  case 'Phone':
230  case 'Email':
231  case 'Consultation':
232  break;
233 
234  case 'Registration':
235  $this->in_registration = true;
236 
237  switch ($a_attribs['registrationType']) {
238  case 'Confirmation':
239  $this->course_obj->setSubscriptionType(IL_CRS_SUBSCRIPTION_CONFIRMATION);
240  break;
241 
242  case 'Direct':
243  $this->course_obj->setSubscriptionType(IL_CRS_SUBSCRIPTION_DIRECT);
244  break;
245 
246  case 'Password':
247  $this->course_obj->setSubscriptionType(IL_CRS_SUBSCRIPTION_PASSWORD);
248  break;
249  }
250 
251  $this->course_obj->setSubscriptionMaxMembers((int) $a_attribs['maxMembers']);
252  $this->course_obj->enableSubscriptionMembershipLimitation($this->course_obj->getSubscriptionMaxMembers() > 0);
253  $this->course_obj->setSubscriptionNotify($a_attribs['notification'] == 'Yes' ? true : false);
254  $this->course_obj->enableWaitingList($a_attribs['waitingList'] == 'Yes' ? true : false);
255  break;
256 
257  case 'Sort':
258  include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
259  ilContainerSortingSettings::_importContainerSortingSettings($a_attribs, $this->course_obj->getId());
260 
261  //#17837
262  $this->course_obj->setOrderType(
263  ilContainerSortingSettings::getInstanceByObjId($this->course_obj->getId())->getSortMode()
264  );
265  break;
266 
267  case 'Disabled':
268  $this->course_obj->getSubscriptionLimitationType(IL_CRS_SUBSCRIPTION_DEACTIVATED);
269  break;
270 
271  case "MetaData":
272  $this->in_meta_data = true;
273  parent::handlerBeginTag($a_xml_parser, $a_name, $a_attribs);
274  break;
275 
276  case 'ContainerSetting':
277  $this->current_container_setting = $a_attribs['id'];
278  break;
279 
280  case 'Period':
281  $this->in_period = true;
282  break;
283 
284  case 'WaitingListAutoFill':
285  case 'CancellationEnd':
286  case 'MinMembers':
287  break;
288  }
289  }
const IL_CRS_ACTIVATION_LIMITED
const IL_CRS_SUBSCRIPTION_LIMITED
static _importContainerSortingSettings($attibs, $obj_id)
sorting import for all container objects
handleMember($a_attribs, $id_data)
attach or detach user/member/admin from course member
handleAdmin($a_attribs, $id_data)
attach or detach admin from course member
const IL_CRS_SUBSCRIPTION_CONFIRMATION
handleWaitingList($a_attribs, $id_data)
attach or detach members from waitinglist
const IL_CRS_SUBSCRIPTION_PASSWORD
const IL_CRS_ACTIVATION_OFFLINE
const IL_CRS_SUBSCRIPTION_UNLIMITED
handleTutor($a_attribs, $id_data)
attach or detach admin from course member
static _writeImportId($a_obj_id, $a_import_id)
write import id to db (static)
const IL_CRS_SUBSCRIPTION_DIRECT
static getInstanceByObjId($a_obj_id)
Get singleton instance.
handleSubscriber($a_attribs, $id_data)
attach or detach members from subscribers
const IL_CRS_SUBSCRIPTION_DEACTIVATED
const IL_CRS_ACTIVATION_UNLIMITED
+ Here is the call graph for this function:

◆ handlerCharacterData()

ilCourseXMLParser::handlerCharacterData (   $a_xml_parser,
  $a_data 
)

handler for character data

Parameters
resource$a_xml_parserxml parser
string$a_datacharacter data

Implements ilSaxSubsetParser.

Definition at line 595 of file class.ilCourseXMLParser.php.

596  {
597  // call meta data handler
598  if ($this->in_meta_data) {
599  parent::handlerCharacterData($a_xml_parser, $a_data);
600  }
601  if ($a_data != "\n") {
602  // Replace multiple tabs with one space
603  $a_data = preg_replace("/\t+/", " ", $a_data);
604 
605  $this->cdata .= $a_data;
606  }
607  }

◆ handlerEndTag()

ilCourseXMLParser::handlerEndTag (   $a_xml_parser,
  $a_name 
)

handler for end of element

Parameters
resource$a_xml_parserxml parser
string$a_nameelement name

Implements ilSaxSubsetParser.

Definition at line 456 of file class.ilCourseXMLParser.php.

References $current_container_setting, ilContainer\_writeContainerSetting(), and IL_CAL_UNIX.

457  {
458  if ($this->in_meta_data) {
459  parent::handlerEndTag($a_xml_parser, $a_name);
460  }
461 
462  switch ($a_name) {
463  case 'Course':
464 
465  $this->log->write('CourseXMLParser: import_id = ' . $this->course_obj->getImportId());
466  $this->course_obj->MDUpdateListener('General');
467  $this->course_obj->update();
468  $this->adv_md_handler->save();
469  break;
470 
471  case 'Settings':
472  $this->in_settings = false;
473  break;
474 
475  case 'Availability':
476  $this->in_availability = false;
477  break;
478 
479  case 'Registration':
480  $this->in_registration = false;
481  break;
482 
483 
484  case 'Start':
485  if ($this->in_availability) {
486  $this->course_obj->setActivationStart(trim($this->cdata));
487  }
488  if ($this->in_registration) {
489  $this->course_obj->setSubscriptionStart(trim($this->cdata));
490  }
491  if ($this->in_period) {
492  if ((int) $this->cdata) {
493  $this->course_obj->setCourseStart(new ilDate((int) $this->cdata, IL_CAL_UNIX));
494  }
495  }
496  break;
497 
498  case 'End':
499  if ($this->in_availability) {
500  $this->course_obj->setActivationEnd(trim($this->cdata));
501  }
502  if ($this->in_registration) {
503  $this->course_obj->setSubscriptionEnd(trim($this->cdata));
504  }
505  if ($this->in_period) {
506  if ((int) $this->cdata) {
507  $this->course_obj->setCourseEnd(new ilDate((int) $this->cdata, IL_CAL_UNIX));
508  }
509  }
510  break;
511 
512  case 'Syllabus':
513  $this->course_obj->setSyllabus(trim($this->cdata));
514  break;
515 
516 
517  case 'ImportantInformation':
518  $this->course_obj->setImportantInformation(trim($this->cdata));
519  break;
520 
521  case 'ViewMode':
522  $this->course_obj->setViewMode(trim($this->cdata));
523  break;
524 
525  case 'Name':
526  $this->course_obj->setContactName(trim($this->cdata));
527  break;
528 
529  case 'Responsibility':
530  $this->course_obj->setContactResponsibility(trim($this->cdata));
531  break;
532 
533  case 'Phone':
534  $this->course_obj->setContactPhone(trim($this->cdata));
535  break;
536 
537  case 'Email':
538  $this->course_obj->setContactEmail(trim($this->cdata));
539  break;
540 
541  case 'Consultation':
542  $this->course_obj->setContactConsultation(trim($this->cdata));
543  break;
544 
545  case 'Password':
546  $this->course_obj->setSubscriptionPassword(trim($this->cdata));
547  break;
548 
549  case 'MetaData':
550  $this->in_meta_data = false;
551  parent::handlerEndTag($a_xml_parser, $a_name);
552  break;
553 
554  case 'ContainerSetting':
555  if ($this->current_container_setting) {
557  $this->course_obj->getId(),
559  $this->cdata
560  );
561  }
562  break;
563 
564  case 'Period':
565  $this->in_period = false;
566  break;
567 
568  case 'WaitingListAutoFill':
569  $this->course_obj->setWaitingListAutoFill($this->cdata);
570  break;
571 
572  case 'CancellationEnd':
573  if ((int) $this->cdata) {
574  $this->course_obj->setCancellationEnd(new ilDate((int) $this->cdata, IL_CAL_UNIX));
575  }
576  break;
577 
578  case 'MinMembers':
579  if ((int) $this->cdata) {
580  $this->course_obj->setSubscriptionMinMembers((int) $this->cdata);
581  }
582  break;
583  }
584  $this->cdata = '';
585 
586  return;
587  }
const IL_CAL_UNIX
Class for single dates.
static _writeContainerSetting($a_id, $a_keyword, $a_value)
+ Here is the call graph for this function:

◆ handleSubscriber()

ilCourseXMLParser::handleSubscriber (   $a_attribs,
  $id_data 
)
private

attach or detach members from subscribers

Parameters
string$a_attribsattribute of a node
array$id_data

Definition at line 413 of file class.ilCourseXMLParser.php.

Referenced by handlerBeginTag().

414  {
415  if (!isset($a_attribs['action']) || $a_attribs['action'] == 'Attach') {
416  // if action not set, or attach
417  if (!$this->course_members->isSubscriber($id_data['usr_id'])) {
418  // add only if not exist
419  $this->course_members->addSubscriber($id_data['usr_id']);
420  }
421  $this->course_members->updateSubscriptionTime($id_data['usr_id'], $a_attribs['subscriptionTime']);
422  } elseif (isset($a_attribs['action']) && $a_attribs['action'] == 'Detach' && $this->course_members->isSubscriber($id_data['usr_id'])) {
423  // if action set and detach and is subscriber
424  $this->course_members->deleteSubscriber($id_data["usr_id"]);
425  }
426  }
+ Here is the caller graph for this function:

◆ handleTutor()

ilCourseXMLParser::handleTutor (   $a_attribs,
  $id_data 
)
private

attach or detach admin from course member

Parameters
string$a_attribsattribute of a node
array$id_data

Definition at line 376 of file class.ilCourseXMLParser.php.

References IL_CRS_TUTOR.

Referenced by handlerBeginTag().

377  {
378  if (!isset($a_attribs['action']) || $a_attribs['action'] == 'Attach') {
379  // if action not set, or attach
380  if (!array_key_exists($id_data['usr_id'], $this->course_members_array)) {
381  // add only if member is not assigned yet
382  $this->course_members->add($id_data['usr_id'], IL_CRS_TUTOR);
383  if ($a_attribs['notification'] == 'Yes') {
384  $this->course_members->updateNotification($id_data['usr_id'], true);
385  }
386  if ($a_attribs['passed'] == 'Yes') {
387  $this->course_members->updatePassed($id_data['usr_id'], true);
388  }
389  $this->course_members_array[$id_data['usr_id']] = "added";
390  } else {
391  if ($a_attribs['notification'] == 'Yes') {
392  $this->course_members->updateNotification($id_data['usr_id'], true);
393  }
394  if ($a_attribs['passed'] == 'Yes') {
395  $this->course_members->updatePassed($id_data['usr_id'], true);
396  }
397  $this->course_members->updateBlocked($id_data['usr_id'], false);
398  }
399  } elseif (isset($a_attribs['action']) && $a_attribs['action'] == 'Detach' && $this->course_members->isTutor($id_data['usr_id'])) {
400  // if action set and detach and is tutor of course
401  $this->course_members->delete($id_data['usr_id']);
402  }
403  }
const IL_CRS_TUTOR
+ Here is the caller graph for this function:

◆ handleWaitingList()

ilCourseXMLParser::handleWaitingList (   $a_attribs,
  $id_data 
)
private

attach or detach members from waitinglist

Parameters
string$a_attribsattribute of a node
array$id_data

Definition at line 434 of file class.ilCourseXMLParser.php.

Referenced by handlerBeginTag().

435  {
436  if (!isset($a_attribs['action']) || $a_attribs['action'] == 'Attach') {
437  // if action not set, or attach
438  if (!$this->course_waiting_list->isOnList($id_data['usr_id'])) {
439  // add only if not exists
440  $this->course_waiting_list->addToList($id_data['usr_id']);
441  }
442  $this->course_waiting_list->updateSubscriptionTime($id_data['usr_id'], $a_attribs['subscriptionTime']);
443  } elseif (isset($a_attribs['action']) && $a_attribs['action'] == 'Detach' && $this->course_waiting_list->isOnList($id_data['usr_id'])) {
444  // if action set and detach and is on list
445  $this->course_waiting_list->removeFromList($id_data['usr_id']);
446  }
447  }
+ Here is the caller graph for this function:

◆ setHandlers()

ilCourseXMLParser::setHandlers (   $a_xml_parser)

set event handlers

Parameters
resourcereference to the xml parser public

Definition at line 87 of file class.ilCourseXMLParser.php.

88  {
89  $this->sax_controller->setHandlers($a_xml_parser);
90  $this->sax_controller->setDefaultElementHandler($this);
91 
92  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDValueParser.php');
93  $this->sax_controller->setElementHandler(
94  $this->adv_md_handler = new ilAdvancedMDValueParser($this->course_obj->getId()),
95  'AdvancedMetaData'
96  );
97  }

Field Documentation

◆ $current_container_setting

ilCourseXMLParser::$current_container_setting
private

Definition at line 48 of file class.ilCourseXMLParser.php.

Referenced by handlerEndTag().

◆ $lng

ilCourseXMLParser::$lng

Definition at line 45 of file class.ilCourseXMLParser.php.

Referenced by __construct().

◆ $md_obj

ilCourseXMLParser::$md_obj = null

Definition at line 46 of file class.ilCourseXMLParser.php.


The documentation for this class was generated from the following file: