ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilGroupXMLParser Class Reference

Group Import Parser. More...

+ Inheritance diagram for ilGroupXMLParser:
+ Collaboration diagram for ilGroupXMLParser:

Public Member Functions

 ilGroupXMLParser ($a_xml, $a_parent_id)
 Constructor. More...
 
 __pushParentId ($a_id)
 
 __popParentId ()
 
 __getParentId ()
 
 setHandlers ($a_xml_parser)
 set event handler should be overwritten by inherited class private More...
 
 startParsing ()
 start the parser More...
 
 handlerBeginTag ($a_xml_parser, $a_name, $a_attribs)
 handler for begin of element More...
 
 handlerEndTag ($a_xml_parser, $a_name)
 
 handlerCharacterData ($a_xml_parser, $a_data)
 handler for character data More...
 
 __save ()
 
 __saveFolder ()
 
 __saveFile ()
 
 __assignMembers ()
 
 __initGroupObject ()
 
 __initFolderObject ()
 
 __initImportFileObject ()
 
 __initFileObject ()
 
 __destroyFolderObject ()
 
 __parseId ($a_id)
 
 setMode ($mode)
 
 setGroup (& $grp)
 
 __initContainerSorting ($a_attribs, $a_group_id)
 
- Public Member Functions inherited from ilSaxParser
 ilSaxParser ($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
 PEAR ($error_class=null)
 Constructor. More...
 
 _PEAR ()
 Destructor (the emulated type of...). More...
 
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...
 
 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...
 
 setErrorHandling ($mode=null, $options=null)
 Sets how errors generated by this object should be handled. 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

 $group_data
 
 $group_obj
 
 $parent
 
 $counter
 
 $mode
 
 $grp
 
- 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()
 

Static Public Attributes

static $CREATE = 1
 
static $UPDATE = 2
 

Private Attributes

 $participants = null
 
 $current_container_setting
 
 $sort = null
 

Additional Inherited Members

- Protected Member Functions inherited from ilSaxParser
 handleError ($message, $code)
 use given error handler to handle error message or internal ilias error message handle More...
 

Detailed Description

Group Import Parser.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id
class.ilGroupXMLParser.php 15678 2008-01-06 20:40:55Z akill

Definition at line 39 of file class.ilGroupXMLParser.php.

Member Function Documentation

◆ __assignMembers()

ilGroupXMLParser::__assignMembers ( )

Definition at line 521 of file class.ilGroupXMLParser.php.

References ilSaxParser\$ilias, $ilSetting, $ilUser, __parseId(), ilParticipants\add(), IL_GRP_ADMIN, and IL_GRP_MEMBER.

Referenced by __save().

522  {
523  global $ilias,$ilUser, $ilSetting;
524 
525  $this->participants = new ilGroupParticipants($this->group_obj->getId());
526  $this->participants->add($ilUser->getId(),IL_GRP_ADMIN);
527  $this->participants->updateNotification($ilUser->getId(),$ilSetting->get('mail_grp_admin_notification', true));
528 
529  // attach ADMINs
530  if (count($this->group_data["admin"]["attach"]))
531  {
532  foreach($this->group_data["admin"]["attach"] as $user)
533  {
534  if($id_data = $this->__parseId($user))
535  {
536  if($id_data['local'] or $id_data['imported'])
537  {
538  $this->participants->add($id_data['usr_id'],IL_GRP_ADMIN);
539  if(in_array($user,(array) $this->group_data['notifications']))
540  {
541  $this->participants->updateNotification($id_data['usr_id'],true);
542  }
543  }
544  }
545  }
546  }
547  // detach ADMINs
548  if (count($this->group_data["admin"]["detach"]))
549  {
550  foreach($this->group_data["admin"]["detach"] as $user)
551  {
552  if($id_data = $this->__parseId($user))
553  {
554  if($id_data['local'] or $id_data['imported'])
555  {
556  if($this->participants->isAssigned($id_data['usr_id']))
557  {
558  $this->participants->delete($id_data['usr_id']);
559  }
560  }
561  }
562  }
563  }
564  // MEMBER
565  if (count($this->group_data["member"]["attach"]))
566  {
567  foreach($this->group_data["member"]["attach"] as $user)
568  {
569  if($id_data = $this->__parseId($user))
570  {
571  if($id_data['local'] or $id_data['imported'])
572  {
573  $this->participants->add($id_data['usr_id'],IL_GRP_MEMBER);
574  }
575  }
576  }
577  }
578 
579  if (count($this->group_data["member"]["detach"]))
580  {
581  foreach($this->group_data["member"]["detach"] as $user)
582  {
583  if($id_data = $this->__parseId($user))
584  {
585  if($id_data['local'] or $id_data['imported'])
586  {
587  if($this->participants->isAssigned($id_data['usr_id']))
588  {
589  $this->participants->delete($id_data['usr_id']);
590  }
591  }
592  }
593  }
594  }
595  return true;
596  }
const IL_GRP_ADMIN
const IL_GRP_MEMBER
add($a_usr_id, $a_role)
Add user to course.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __destroyFolderObject()

ilGroupXMLParser::__destroyFolderObject ( )

Definition at line 639 of file class.ilGroupXMLParser.php.

Referenced by __saveFolder().

640  {
641  unset($this->folder_obj);
642  }
+ Here is the caller graph for this function:

◆ __getParentId()

ilGroupXMLParser::__getParentId ( )

Definition at line 92 of file class.ilGroupXMLParser.php.

Referenced by __save(), __saveFile(), and __saveFolder().

93  {
94  return $this->parent[count($this->parent) - 1];
95  }
+ Here is the caller graph for this function:

◆ __initContainerSorting()

ilGroupXMLParser::__initContainerSorting (   $a_attribs,
  $a_group_id 
)

Definition at line 686 of file class.ilGroupXMLParser.php.

References ilContainerSortingSettings\_importContainerSortingSettings().

Referenced by __save(), and handlerBeginTag().

687  {
688  include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
690  }
static _importContainerSortingSettings($attibs, $obj_id)
sorting import for all container objects
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __initFileObject()

ilGroupXMLParser::__initFileObject ( )

Definition at line 630 of file class.ilGroupXMLParser.php.

Referenced by __saveFile().

631  {
632  include_once "./Modules/File/classes/class.ilObjFile.php";
633 
634  $this->file_obj =& new ilObjFile();
635 
636  return true;
637  }
Class ilObjFile.
+ Here is the caller graph for this function:

◆ __initFolderObject()

ilGroupXMLParser::__initFolderObject ( )

Definition at line 612 of file class.ilGroupXMLParser.php.

Referenced by __saveFolder().

613  {
614  include_once "./Modules/Folder/classes/class.ilObjFolder.php";
615 
616  $this->folder_obj =& new ilObjFolder();
617 
618  return true;
619  }
Class ilObjFolder.
+ Here is the caller graph for this function:

◆ __initGroupObject()

ilGroupXMLParser::__initGroupObject ( )

Definition at line 598 of file class.ilGroupXMLParser.php.

References $CREATE, $grp, and $UPDATE.

Referenced by __save(), and handlerEndTag().

599  {
600  include_once "./Modules/Group/classes/class.ilObjGroup.php";
601 
602  if ($this->mode == ilGroupXMLParser::$CREATE)
603  {
604  $this->group_obj =& new ilObjGroup();
605  } elseif ($this->mode == ilGroupXMLParser::$UPDATE) {
606  $this->group_obj = $this->grp;
607  }
608 
609  return true;
610  }
Class ilObjGroup.
+ Here is the caller graph for this function:

◆ __initImportFileObject()

ilGroupXMLParser::__initImportFileObject ( )

Definition at line 621 of file class.ilGroupXMLParser.php.

Referenced by __saveFile().

622  {
623  include_once "./Modules/Group/classes/class.ilFileDataImportGroup.php";
624 
625  $this->import_file_obj =& new ilFileDataImportGroup();
626 
627  return true;
628  }
This class handles all operations on files for the exercise object.
+ Here is the caller graph for this function:

◆ __parseId()

ilGroupXMLParser::__parseId (   $a_id)

Definition at line 644 of file class.ilGroupXMLParser.php.

References $GLOBALS, ilSaxParser\$ilias, ilObjUser\_getImportedUserId(), and ilObjUser\_lookupName().

Referenced by __assignMembers().

645  {
646  global $ilias;
647 
648  $fields = explode('_',$a_id);
649 
650  if(!is_array($fields) or
651  $fields[0] != 'il' or
652  !is_numeric($fields[1]) or
653  $fields[2] != 'usr' or
654  !is_numeric($fields[3]))
655  {
656  return false;
657  }
658  if($id = ilObjUser::_getImportedUserId($a_id))
659  {
660  return array('imported' => true,
661  'local' => false,
662  'usr_id' => $id);
663  }
664  if(($fields[1] == $ilias->getSetting('inst_id',0)) and ($user = ilObjUser::_lookupName($fields[3])))
665  {
666  if(strlen($user['login']))
667  {
668  return array('imported' => false,
669  'local' => true,
670  'usr_id' => $fields[3]);
671  }
672  }
673  $GLOBALS['ilLog']->write(__METHOD__.' Parsing id failed: '.$a_id);
674  return false;
675  }
static _lookupName($a_user_id)
lookup user name
_getImportedUserId($i2_id)
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __popParentId()

ilGroupXMLParser::__popParentId ( )

Definition at line 86 of file class.ilGroupXMLParser.php.

Referenced by handlerEndTag().

87  {
88  array_pop($this->parent);
89 
90  return true;
91  }
+ Here is the caller graph for this function:

◆ __pushParentId()

ilGroupXMLParser::__pushParentId (   $a_id)

Definition at line 82 of file class.ilGroupXMLParser.php.

Referenced by __save(), __saveFolder(), and ilGroupXMLParser().

83  {
84  $this->parent[] = $a_id;
85  }
+ Here is the caller graph for this function:

◆ __save()

ilGroupXMLParser::__save ( )

mode can be create or update

Definition at line 345 of file class.ilGroupXMLParser.php.

References $CREATE, __assignMembers(), ilUtil\__extractId(), __getParentId(), __initContainerSorting(), __initGroupObject(), __pushParentId(), GRP_REGISTRATION_DEACTIVATED, GRP_REGISTRATION_DIRECT, GRP_REGISTRATION_PASSWORD, GRP_REGISTRATION_REQUEST, GRP_TYPE_CLOSED, GRP_TYPE_PUBLIC, and IL_CAL_UNIX.

Referenced by handlerBeginTag(), and handlerEndTag().

346  {
347  if($this->group_imported)
348  {
349  return true;
350  }
351 
352  $this->__initGroupObject();
353 
354  $this->group_obj->setImportId($this->group_data["id"]);
355  $this->group_obj->setTitle($this->group_data["title"]);
356  $this->group_obj->setDescription($this->group_data["description"]);
357 
358  $ownerChanged = false;
359  if (isset($this->group_data["owner"]))
360  {
361  $owner = $this->group_data["owner"];
362  if (!is_numeric($owner))
363  {
364  $owner = ilUtil::__extractId ($owner, IL_INST_ID);
365  }
366  if (is_numeric($owner) && $owner > 0)
367  {
368  $this->group_obj->setOwner($owner);
369  $ownerChanged = true;
370  }
371  }
372 
376  if ($this->mode == ilGroupXMLParser::$CREATE)
377  {
378  $this->group_obj->create();
379  $this->group_obj->createReference();
380  $this->group_obj->putInTree($this->__getParentId());
381  $this->group_obj->setPermissions($this->__getParentId());
382  $this->group_obj->initGroupStatus($this->group_data["type"] == "open" ? GRP_TYPE_PUBLIC : GRP_TYPE_CLOSED);
383  }
384  else
385  {
386  switch($this->group_data['type'])
387  {
388  case 'open':
389  $grp_status = GRP_TYPE_PUBLIC;
390  break;
391 
392  case 'closed':
393  $grp_status = GRP_TYPE_CLOSED;
394  break;
395 
396  }
397 
398  $this->group_obj->updateOwner();
399  if($this->group_obj->getGroupStatus() != $grp_status)
400  {
401  $this->group_obj->setGroupType($grp_status);
402  $this->group_obj->updateGroupType();
403  }
404  }
405 
406  // SET GROUP SPECIFIC DATA
407  switch($this->group_data['registration_type'])
408  {
409  case 'direct':
410  case 'enabled':
411  $flag = GRP_REGISTRATION_DIRECT;
412  break;
413 
414  case 'disabled':
416  break;
417 
418  case 'confirmation':
419  $flag = GRP_REGISTRATION_REQUEST;
420  break;
421 
422  case 'password':
424  break;
425 
426  default:
427  $flag = GRP_REGISTRATION_DIRECT;
428  }
429  $this->group_obj->setRegistrationType($flag);
430 
431  $end = new ilDateTime(time(),IL_CAL_UNIX);
432  if($this->group_data['expiration_end'])
433  {
434  $end = new ilDateTime($this->group_data['expiration_end'],IL_CAL_UNIX);
435  }
436 
437  $start = clone $end;
438  if($this->group_data['expiration_start'])
439  {
440  $start = new ilDateTime($this->group_data['expiration_start'],IL_CAL_UNIX);
441  }
442 
443  $this->group_obj->setRegistrationStart($start);
444  $this->group_obj->setRegistrationEnd($end);
445  $this->group_obj->setPassword($this->group_data['password']);
446  $this->group_obj->enableUnlimitedRegistration(!isset($this->group_data['expiration_end']));
447  $this->group_obj->enableMembershipLimitation($this->group_data['max_members_enabled']);
448  $this->group_obj->setMaxMembers($this->group_data['max_members'] ? $this->group_data['max_members'] : 0);
449  $this->group_obj->enableWaitingList($this->group_data['waiting_list_enabled']);
450 
451  $this->group_obj->setWaitingListAutoFill($this->group_data['auto_wait']);
452  $this->group_obj->setCancellationEnd($this->group_data['cancel_end']);
453  $this->group_obj->setMinMembers($this->group_data['min_members']);
454 
455  if ($this->mode == ilGroupXMLParser::$CREATE)
456  {
457  $this->group_obj->initGroupStatus($this->group_data["type"] == "open" ? 0 : 1);
458  }
459 
460  $this->group_obj->update();
461 
462  // ASSIGN ADMINS/MEMBERS
463  $this->__assignMembers();
464 
465  $this->__pushParentId($this->group_obj->getRefId());
466 
467  if($this->sort)
468  {
469  $this->__initContainerSorting($this->sort, $this->group_obj->getId());
470  }
471 
472  $this->group_imported = true;
473 
474  return true;
475  }
const GRP_REGISTRATION_DEACTIVATED
const IL_CAL_UNIX
const GRP_REGISTRATION_PASSWORD
const GRP_REGISTRATION_REQUEST
const GRP_TYPE_PUBLIC
const GRP_TYPE_CLOSED
Date and time handling
__initContainerSorting($a_attribs, $a_group_id)
const GRP_REGISTRATION_DIRECT
static __extractId($ilias_id, $inst_id)
extract ref id from role title, e.g.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __saveFile()

ilGroupXMLParser::__saveFile ( )

Definition at line 493 of file class.ilGroupXMLParser.php.

References __getParentId(), __initFileObject(), and __initImportFileObject().

Referenced by handlerBeginTag().

494  {
495  $this->__initFileObject();
496 
497  $this->file_obj->setType("file");
498  $this->file_obj->setTitle($this->file["fileName"]);
499  $this->file_obj->setFileName($this->file["fileName"]);
500  $this->file_obj->create();
501  $this->file_obj->createReference();
502  $this->file_obj->putInTree($this->__getParentId());
503  $this->file_obj->setPermissions($this->__getParentId());
504 
505  // COPY FILE
506  $this->file_obj->createDirectory();
507 
508  $this->__initImportFileObject();
509 
510  if($this->import_file_obj->findObjectFile($this->file["id"]))
511  {
512  $this->file_obj->copy($this->import_file_obj->getObjectFile(),$this->file["fileName"]);
513  }
514 
515  unset($this->file_obj);
516  unset($this->import_file_obj);
517 
518  return true;
519  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __saveFolder()

ilGroupXMLParser::__saveFolder ( )

Definition at line 477 of file class.ilGroupXMLParser.php.

References __destroyFolderObject(), __getParentId(), __initFolderObject(), and __pushParentId().

Referenced by handlerEndTag().

478  {
479  $this->__initFolderObject();
480 
481  $this->folder_obj->setTitle($this->folder);
482  $this->folder_obj->create();
483  $this->folder_obj->createReference();
484  $this->folder_obj->putInTree($this->__getParentId());
485 
486  $this->__pushParentId($this->folder_obj->getRefId());
487 
488  $this->__destroyFolderObject();
489 
490  return true;
491  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handlerBeginTag()

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

handler for begin of element

Definition at line 130 of file class.ilGroupXMLParser.php.

References $GLOBALS, $ilErr, __initContainerSorting(), __save(), and __saveFile().

131  {
132  global $ilErr;
133 
134  switch($a_name)
135  {
136  // GROUP DATA
137  case "group":
138  #if($a_attribs["exportVersion"] < EXPORT_VERSION)
139  #{
140  # $ilErr->raiseError("!!! This export Version isn't supported, update your ILIAS 2 installation"
141  # ,$ilErr->WARNING);
142  #}
143  // DEFAULT
144  $this->group_data["admin"] = array();
145  $this->group_data["member"] = array();
146 
147  $this->group_data["type"] = $a_attribs["type"];
148  $this->group_data["id"] = $a_attribs["id"];
149 
150  break;
151 
152  case 'title':
153  break;
154 
155  case "owner":
156  $this->group_data["owner"] = $a_attribs["id"];
157  break;
158 
159  case 'registration':
160  $this->group_data['registration_type'] = $a_attribs['type'];
161  $this->group_data['waiting_list_enabled'] = $a_attribs['waitingList'] == 'Yes' ? true : false;
162  break;
163 
164  case 'maxMembers':
165  $this->group_data['max_members_enabled'] = $a_attribs['enabled'] == 'Yes' ? true : false;
166  break;
167 
168  case "admin":
169  if (!isset($a_attribs['action']) || $a_attribs['action'] == "Attach")
170  {
171  $this->group_data["admin"]["attach"][] = $a_attribs["id"];
172  }
173  elseif (isset($a_attribs['action']) || $a_attribs['action'] == "Detach")
174  {
175  $this->group_data["admin"]["detach"][] = $a_attribs["id"];
176  }
177 
178  if(isset($a_attribs['notification']) and $a_attribs['notification'] == 'Yes')
179  {
180  $this->group_data['notifications'][] = $a_attribs['id'];
181  }
182 
183  break;
184 
185  case "member":
186  if (!isset($a_attribs['action']) || $a_attribs['action'] == "Attach")
187  {
188  $GLOBALS['ilLog']->write(__METHOD__.': new member with id '.$a_attribs['id']);
189  $this->group_data["member"]["attach"][] = $a_attribs["id"];
190  } elseif (isset($a_attribs['action']) || $a_attribs['action'] == "Detach")
191  {
192  $GLOBALS['ilLog']->write(__METHOD__.': deprecated member with id '.$a_attribs['id']);
193  $this->group_data["member"]["detach"][] = $a_attribs["id"];
194  }
195 
196  break;
197 
198  case "folder":
199  // NOW SAVE THE NEW OBJECT (if it hasn't been imported)
200  $this->__save();
201  break;
202 
203  case "file":
204  // NOW SAVE THE NEW OBJECT (if it hasn't been imported)
205  $this->__save();
206 
207  $this->file["fileName"] = $a_attribs["fileName"];
208  $this->file["id"] = $a_attribs["id"];
209 
210  // SAVE IT
211  $this->__saveFile();
212  break;
213 
214  case 'ContainerSetting':
215  $this->current_container_setting = $a_attribs['id'];
216  break;
217 
218  case 'Sort':
219 
220  if($this->group_imported)
221  {
222  $this->__initContainerSorting($a_attribs, $this->group_obj->getId());
223  }
224  else
225  {
226  $this->sort = $a_attribs;
227  }
228 
229  break;
230 
231  case 'WaitingListAutoFill':
232  case 'CancellationEnd':
233  case 'MinMembers':
234  break;
235  }
236  }
__initContainerSorting($a_attribs, $a_group_id)
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
+ Here is the call graph for this function:

◆ handlerCharacterData()

ilGroupXMLParser::handlerCharacterData (   $a_xml_parser,
  $a_data 
)

handler for character data

Definition at line 329 of file class.ilGroupXMLParser.php.

330  {
331  // i don't know why this is necessary, but
332  // the parser seems to convert "&gt;" to ">" and "&lt;" to "<"
333  // in character data, but we don't want that, because it's the
334  // way we mask user html in our content, so we convert back...
335  $a_data = str_replace("<","&lt;",$a_data);
336  $a_data = str_replace(">","&gt;",$a_data);
337 
338  if(!empty($a_data))
339  {
340  $this->cdata .= $a_data;
341  }
342  }

◆ handlerEndTag()

ilGroupXMLParser::handlerEndTag (   $a_xml_parser,
  $a_name 
)

Definition at line 239 of file class.ilGroupXMLParser.php.

References $current_container_setting, __initGroupObject(), __popParentId(), __save(), __saveFolder(), ilContainer\_writeContainerSetting(), and IL_CAL_UNIX.

240  {
241  switch($a_name)
242  {
243  case "title":
244  $this->group_data["title"] = trim($this->cdata);
245  break;
246 
247  case "description":
248  $this->group_data["description"] = trim($this->cdata);
249  break;
250 
251  case 'information':
252  $this->group_data['information'] = trim($this->cdata);
253  break;
254 
255  case 'password':
256  $this->group_data['password'] = trim($this->cdata);
257  break;
258 
259  case 'maxMembers':
260  $this->group_data['max_members'] = trim($this->cdata);
261  break;
262 
263  case 'expiration':
264  $this->group_data['expiration_end'] = trim($this->cdata);
265  break;
266 
267  case 'start':
268  $this->group_data['expiration_start'] = trim($this->cdata);
269  break;
270 
271  case 'end':
272  $this->group_data['expiration_end'] = trim($this->cdata);
273  break;
274 
275  case "folder":
276  $this->__popParentId();
277  break;
278 
279  case "folderTitle":
280  $this->folder = trim($this->cdata);
281  $this->__saveFolder();
282  break;
283 
284  case "group":
285  // NOW SAVE THE NEW OBJECT (if it hasn't been imported)
286  $this->__save();
287  break;
288 
289  case 'ContainerSetting':
290  if($this->current_container_setting)
291  {
292  // #17357
293  if(!($this->group_obj instanceof ilObjGroup))
294  {
295  $this->__initGroupObject();
296  }
298  $this->group_obj->getId(),
300  $this->cdata);
301  }
302  break;
303 
304  case 'WaitingListAutoFill':
305  $this->group_data['auto_wait'] = trim($this->cdata);
306  break;
307 
308  case 'CancellationEnd':
309  if((int)$this->cdata)
310  {
311  $this->group_data['cancel_end'] = new ilDate((int)$this->cdata, IL_CAL_UNIX);
312  }
313  break;
314 
315  case 'MinMembers':
316  if((int)$this->cdata)
317  {
318  $this->group_data['min_members'] = (int)$this->cdata;
319  }
320  break;
321  }
322  $this->cdata = '';
323  }
_writeContainerSetting($a_id, $a_keyword, $a_value)
const IL_CAL_UNIX
Class for single dates.
Class ilObjGroup.
+ Here is the call graph for this function:

◆ ilGroupXMLParser()

ilGroupXMLParser::ilGroupXMLParser (   $a_xml,
  $a_parent_id 
)

Constructor.

Parameters
string$a_xml_filexml file

public

Definition at line 65 of file class.ilGroupXMLParser.php.

References $CREATE, __pushParentId(), and ilSaxParser\setXMLContent().

66  {
67  define('EXPORT_VERSION',2);
68 
69  parent::ilSaxParser(null);
70 
71  $this->mode = ilGroupXMLParser::$CREATE;
72  $this->grp = null;
73 
74  $this->setXMLContent($a_xml);
75 
76  // SET MEMBER VARIABLES
77  $this->__pushParentId($a_parent_id);
78 
79 
80  }
setXMLContent($a_xml_content)
+ Here is the call graph for this function:

◆ setGroup()

ilGroupXMLParser::setGroup ( $grp)

Definition at line 682 of file class.ilGroupXMLParser.php.

References $grp.

682  {
683  $this->grp = $grp;
684  }

◆ setHandlers()

ilGroupXMLParser::setHandlers (   $a_xml_parser)

set event handler should be overwritten by inherited class private

Definition at line 102 of file class.ilGroupXMLParser.php.

103  {
104  xml_set_object($a_xml_parser,$this);
105  xml_set_element_handler($a_xml_parser,'handlerBeginTag','handlerEndTag');
106  xml_set_character_data_handler($a_xml_parser,'handlerCharacterData');
107  }

◆ setMode()

ilGroupXMLParser::setMode (   $mode)

Definition at line 678 of file class.ilGroupXMLParser.php.

References $mode.

678  {
679  $this->mode = $mode;
680  }

◆ startParsing()

ilGroupXMLParser::startParsing ( )

start the parser

Definition at line 112 of file class.ilGroupXMLParser.php.

References $CREATE.

113  {
114  parent::startParsing();
115 
116  if ($this->mode == ilGroupXMLParser::$CREATE)
117  {
118  return is_object($this->group_obj) ? $this->group_obj->getRefId() : false;
119  }
120  else
121  {
122  return is_object($this->group_obj) ? $this->group_obj->update() : false;
123  }
124  }

Field Documentation

◆ $counter

ilGroupXMLParser::$counter

Definition at line 52 of file class.ilGroupXMLParser.php.

◆ $CREATE

ilGroupXMLParser::$CREATE = 1
static

◆ $current_container_setting

ilGroupXMLParser::$current_container_setting
private

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

Referenced by handlerEndTag().

◆ $group_data

ilGroupXMLParser::$group_data

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

◆ $group_obj

ilGroupXMLParser::$group_obj

Definition at line 49 of file class.ilGroupXMLParser.php.

◆ $grp

ilGroupXMLParser::$grp

Definition at line 55 of file class.ilGroupXMLParser.php.

Referenced by __initGroupObject(), and setGroup().

◆ $mode

ilGroupXMLParser::$mode

Definition at line 54 of file class.ilGroupXMLParser.php.

Referenced by setMode().

◆ $parent

ilGroupXMLParser::$parent

Definition at line 51 of file class.ilGroupXMLParser.php.

◆ $participants

ilGroupXMLParser::$participants = null
private

Definition at line 44 of file class.ilGroupXMLParser.php.

◆ $sort

ilGroupXMLParser::$sort = null
private

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

◆ $UPDATE

ilGroupXMLParser::$UPDATE = 2
static

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