ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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 495 of file class.ilGroupXMLParser.php.

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

Referenced by __save().

496  {
497  global $ilias,$ilUser;
498 
499  $this->participants = new ilGroupParticipants($this->group_obj->getId());
500  $this->participants->add($ilUser->getId(),IL_GRP_ADMIN);
501  $this->participants->updateNotification($ilUser->getId(),true);
502 
503  // attach ADMINs
504  if (count($this->group_data["admin"]["attach"]))
505  {
506  foreach($this->group_data["admin"]["attach"] as $user)
507  {
508  if($id_data = $this->__parseId($user))
509  {
510  if($id_data['local'] or $id_data['imported'])
511  {
512  $this->participants->add($id_data['usr_id'],IL_GRP_ADMIN);
513  if(in_array($user,(array) $this->group_data['notifications']))
514  {
515  $this->participants->updateNotification($id_data['usr_id'],true);
516  }
517  }
518  }
519  }
520  }
521  // detach ADMINs
522  if (count($this->group_data["admin"]["detach"]))
523  {
524  foreach($this->group_data["admin"]["detach"] as $user)
525  {
526  if($id_data = $this->__parseId($user))
527  {
528  if($id_data['local'] or $id_data['imported'])
529  {
530  if($this->participants->isAssigned($id_data['usr_id']))
531  {
532  $this->participants->delete($id_data['usr_id']);
533  }
534  }
535  }
536  }
537  }
538  // MEMBER
539  if (count($this->group_data["member"]["attach"]))
540  {
541  foreach($this->group_data["member"]["attach"] as $user)
542  {
543  if($id_data = $this->__parseId($user))
544  {
545  if($id_data['local'] or $id_data['imported'])
546  {
547  $this->participants->add($id_data['usr_id'],IL_GRP_MEMBER);
548  }
549  }
550  }
551  }
552 
553  if (count($this->group_data["member"]["detach"]))
554  {
555  foreach($this->group_data["member"]["detach"] as $user)
556  {
557  if($id_data = $this->__parseId($user))
558  {
559  if($id_data['local'] or $id_data['imported'])
560  {
561  if($this->participants->isAssigned($id_data['usr_id']))
562  {
563  $this->participants->delete($id_data['usr_id']);
564  }
565  }
566  }
567  }
568  }
569  return true;
570  }
const IL_GRP_ADMIN
const IL_GRP_MEMBER
add($a_usr_id, $a_role)
Add user to course.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __destroyFolderObject()

ilGroupXMLParser::__destroyFolderObject ( )

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

Referenced by __saveFolder().

614  {
615  unset($this->folder_obj);
616  }
+ 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 660 of file class.ilGroupXMLParser.php.

References ilContainerSortingSettings\_importContainerSortingSettings().

Referenced by __save(), and handlerBeginTag().

661  {
662  include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
664  }
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 604 of file class.ilGroupXMLParser.php.

Referenced by __saveFile().

605  {
606  include_once "./Modules/File/classes/class.ilObjFile.php";
607 
608  $this->file_obj =& new ilObjFile();
609 
610  return true;
611  }
Class ilObjFile.
+ Here is the caller graph for this function:

◆ __initFolderObject()

ilGroupXMLParser::__initFolderObject ( )

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

Referenced by __saveFolder().

587  {
588  include_once "./Modules/Folder/classes/class.ilObjFolder.php";
589 
590  $this->folder_obj =& new ilObjFolder();
591 
592  return true;
593  }
Class ilObjFolder.
+ Here is the caller graph for this function:

◆ __initGroupObject()

ilGroupXMLParser::__initGroupObject ( )

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

References $CREATE, $grp, and $UPDATE.

Referenced by __save(), and handlerEndTag().

573  {
574  include_once "./Modules/Group/classes/class.ilObjGroup.php";
575 
576  if ($this->mode == ilGroupXMLParser::$CREATE)
577  {
578  $this->group_obj =& new ilObjGroup();
579  } elseif ($this->mode == ilGroupXMLParser::$UPDATE) {
580  $this->group_obj = $this->grp;
581  }
582 
583  return true;
584  }
Class ilObjGroup.
+ Here is the caller graph for this function:

◆ __initImportFileObject()

ilGroupXMLParser::__initImportFileObject ( )

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

Referenced by __saveFile().

596  {
597  include_once "./Modules/Group/classes/class.ilFileDataImportGroup.php";
598 
599  $this->import_file_obj =& new ilFileDataImportGroup();
600 
601  return true;
602  }
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 618 of file class.ilGroupXMLParser.php.

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

Referenced by __assignMembers().

619  {
620  global $ilias;
621 
622  $fields = explode('_',$a_id);
623 
624  if(!is_array($fields) or
625  $fields[0] != 'il' or
626  !is_numeric($fields[1]) or
627  $fields[2] != 'usr' or
628  !is_numeric($fields[3]))
629  {
630  return false;
631  }
632  if($id = ilObjUser::_getImportedUserId($a_id))
633  {
634  return array('imported' => true,
635  'local' => false,
636  'usr_id' => $id);
637  }
638  if(($fields[1] == $ilias->getSetting('inst_id',0)) and ($user = ilObjUser::_lookupName($fields[3])))
639  {
640  if(strlen($user['login']))
641  {
642  return array('imported' => false,
643  'local' => true,
644  'usr_id' => $fields[3]);
645  }
646  }
647  $GLOBALS['ilLog']->write(__METHOD__.' Parsing id failed: '.$a_id);
648  return false;
649  }
static _lookupName($a_user_id)
lookup user name
_getImportedUserId($i2_id)
$GLOBALS['ct_recipient']
+ 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 322 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().

323  {
324  if($this->group_imported)
325  {
326  return true;
327  }
328 
329  $this->__initGroupObject();
330 
331  $this->group_obj->setImportId($this->group_data["id"]);
332  $this->group_obj->setTitle($this->group_data["title"]);
333  $this->group_obj->setDescription($this->group_data["description"]);
334 
335  $ownerChanged = false;
336  if (isset($this->group_data["owner"]))
337  {
338  $owner = $this->group_data["owner"];
339  if (!is_numeric($owner))
340  {
341  $owner = ilUtil::__extractId ($owner, IL_INST_ID);
342  }
343  if (is_numeric($owner) && $owner > 0)
344  {
345  $this->group_obj->setOwner($owner);
346  $ownerChanged = true;
347  }
348  }
349 
353  if ($this->mode == ilGroupXMLParser::$CREATE)
354  {
355  $this->group_obj->create();
356  $this->group_obj->createReference();
357  $this->group_obj->putInTree($this->__getParentId());
358  $this->group_obj->setPermissions($this->__getParentId());
359  $this->group_obj->initGroupStatus($this->group_data["type"] == "open" ? GRP_TYPE_PUBLIC : GRP_TYPE_CLOSED);
360  }
361  else
362  {
363  switch($this->group_data['type'])
364  {
365  case 'open':
366  $grp_status = GRP_TYPE_PUBLIC;
367  break;
368 
369  case 'closed':
370  $grp_status = GRP_TYPE_CLOSED;
371  break;
372 
373  }
374 
375  $this->group_obj->updateOwner();
376  if($this->group_obj->getGroupStatus() != $grp_status)
377  {
378  $this->group_obj->setGroupType($grp_status);
379  $this->group_obj->updateGroupType();
380  }
381  }
382 
383  // SET GROUP SPECIFIC DATA
384  switch($this->group_data['registration_type'])
385  {
386  case 'direct':
387  case 'enabled':
388  $flag = GRP_REGISTRATION_DIRECT;
389  break;
390 
391  case 'disabled':
393  break;
394 
395  case 'confirmation':
396  $flag = GRP_REGISTRATION_REQUEST;
397  break;
398 
399  case 'password':
401  break;
402 
403  default:
404  $flag = GRP_REGISTRATION_DIRECT;
405  }
406  $this->group_obj->setRegistrationType($flag);
407 
408  $end = new ilDateTime(time(),IL_CAL_UNIX);
409  if($this->group_data['expiration_end'])
410  {
411  $end = new ilDateTime($this->group_data['expiration_end'],IL_CAL_UNIX);
412  }
413 
414  $start = clone $end;
415  if($this->group_data['expiration_start'])
416  {
417  $start = new ilDateTime($this->group_data['expiration_start'],IL_CAL_UNIX);
418  }
419 
420  $this->group_obj->setRegistrationStart($start);
421  $this->group_obj->setRegistrationEnd($end);
422  $this->group_obj->setPassword($this->group_data['password']);
423  $this->group_obj->enableUnlimitedRegistration(!isset($this->group_data['expiration_end']));
424  $this->group_obj->enableMembershipLimitation($this->group_data['max_members_enabled']);
425  $this->group_obj->setMaxMembers($this->group_data['max_members'] ? $this->group_data['max_members'] : 0);
426  $this->group_obj->enableWaitingList($this->group_data['waiting_list_enabled']);
427 
428 
429  if ($this->mode == ilGroupXMLParser::$CREATE)
430  {
431  $this->group_obj->initGroupStatus($this->group_data["type"] == "open" ? 0 : 1);
432  }
433 
434  $this->group_obj->update();
435 
436  // ASSIGN ADMINS/MEMBERS
437  $this->__assignMembers();
438 
439  $this->__pushParentId($this->group_obj->getRefId());
440 
441  if($this->sort)
442  {
443  $this->__initContainerSorting($this->sort, $this->group_obj->getId());
444  }
445 
446  $this->group_imported = true;
447 
448  return true;
449  }
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 467 of file class.ilGroupXMLParser.php.

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

Referenced by handlerBeginTag().

468  {
469  $this->__initFileObject();
470 
471  $this->file_obj->setType("file");
472  $this->file_obj->setTitle($this->file["fileName"]);
473  $this->file_obj->setFileName($this->file["fileName"]);
474  $this->file_obj->create();
475  $this->file_obj->createReference();
476  $this->file_obj->putInTree($this->__getParentId());
477  $this->file_obj->setPermissions($this->__getParentId());
478 
479  // COPY FILE
480  $this->file_obj->createDirectory();
481 
482  $this->__initImportFileObject();
483 
484  if($this->import_file_obj->findObjectFile($this->file["id"]))
485  {
486  $this->file_obj->copy($this->import_file_obj->getObjectFile(),$this->file["fileName"]);
487  }
488 
489  unset($this->file_obj);
490  unset($this->import_file_obj);
491 
492  return true;
493  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __saveFolder()

ilGroupXMLParser::__saveFolder ( )

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

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

Referenced by handlerEndTag().

452  {
453  $this->__initFolderObject();
454 
455  $this->folder_obj->setTitle($this->folder);
456  $this->folder_obj->create();
457  $this->folder_obj->createReference();
458  $this->folder_obj->putInTree($this->__getParentId());
459 
460  $this->__pushParentId($this->folder_obj->getRefId());
461 
462  $this->__destroyFolderObject();
463 
464  return true;
465  }
+ 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  }
$GLOBALS['ct_recipient']
__initContainerSorting($a_attribs, $a_group_id)
+ Here is the call graph for this function:

◆ handlerCharacterData()

ilGroupXMLParser::handlerCharacterData (   $a_xml_parser,
  $a_data 
)

handler for character data

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

307  {
308  // i don't know why this is necessary, but
309  // the parser seems to convert "&gt;" to ">" and "&lt;" to "<"
310  // in character data, but we don't want that, because it's the
311  // way we mask user html in our content, so we convert back...
312  $a_data = str_replace("<","&lt;",$a_data);
313  $a_data = str_replace(">","&gt;",$a_data);
314 
315  if(!empty($a_data))
316  {
317  $this->cdata .= $a_data;
318  }
319  }

◆ handlerEndTag()

ilGroupXMLParser::handlerEndTag (   $a_xml_parser,
  $a_name 
)

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

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

235  {
236  switch($a_name)
237  {
238  case "title":
239  $this->group_data["title"] = trim($this->cdata);
240  break;
241 
242  case "description":
243  $this->group_data["description"] = trim($this->cdata);
244  break;
245 
246  case 'information':
247  $this->group_data['information'] = trim($this->cdata);
248  break;
249 
250  case 'password':
251  $this->group_data['password'] = trim($this->cdata);
252  break;
253 
254  case 'maxMembers':
255  $this->group_data['max_members'] = trim($this->cdata);
256  break;
257 
258  case 'expiration':
259  $this->group_data['expiration_end'] = trim($this->cdata);
260  break;
261 
262  case 'start':
263  $this->group_data['expiration_start'] = trim($this->cdata);
264  break;
265 
266  case 'end':
267  $this->group_data['expiration_end'] = trim($this->cdata);
268  break;
269 
270  case "folder":
271  $this->__popParentId();
272  break;
273 
274  case "folderTitle":
275  $this->folder = trim($this->cdata);
276  $this->__saveFolder();
277  break;
278 
279  case "group":
280  // NOW SAVE THE NEW OBJECT (if it hasn't been imported)
281  $this->__save();
282  break;
283 
284  case 'ContainerSetting':
285  if($this->current_container_setting)
286  {
287  // #17357
288  if(!($this->group_obj instanceof ilObjGroup))
289  {
290  $this->__initGroupObject();
291  }
293  $this->group_obj->getId(),
295  $this->cdata);
296  }
297  break;
298  }
299  $this->cdata = '';
300  }
_writeContainerSetting($a_id, $a_keyword, $a_value)
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 656 of file class.ilGroupXMLParser.php.

References $grp.

656  {
657  $this->grp = $grp;
658  }

◆ 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 652 of file class.ilGroupXMLParser.php.

References $mode.

652  {
653  $this->mode = $mode;
654  }

◆ 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: