ILIAS  release_4-4 Revision
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)
 
- 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
 

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

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

Referenced by __save().

458  {
459  global $ilias,$ilUser;
460 
461  $this->participants = new ilGroupParticipants($this->group_obj->getId());
462  $this->participants->add($ilUser->getId(),IL_GRP_ADMIN);
463  $this->participants->updateNotification($ilUser->getId(),true);
464 
465  // attach ADMINs
466  if (count($this->group_data["admin"]["attach"]))
467  {
468  foreach($this->group_data["admin"]["attach"] as $user)
469  {
470  if($id_data = $this->__parseId($user))
471  {
472  if($id_data['local'] or $id_data['imported'])
473  {
474  $this->participants->add($id_data['usr_id'],IL_GRP_ADMIN);
475  if(in_array($user,(array) $this->group_data['notifications']))
476  {
477  $this->participants->updateNotification($id_data['usr_id'],true);
478  }
479  }
480  }
481  }
482  }
483  // detach ADMINs
484  if (count($this->group_data["admin"]["detach"]))
485  {
486  foreach($this->group_data["admin"]["detach"] as $user)
487  {
488  if($id_data = $this->__parseId($user))
489  {
490  if($id_data['local'] or $id_data['imported'])
491  {
492  if($this->participants->isAssigned($id_data['usr_id']))
493  {
494  $this->participants->delete($id_data['usr_id']);
495  }
496  }
497  }
498  }
499  }
500  // MEMBER
501  if (count($this->group_data["member"]["attach"]))
502  {
503  foreach($this->group_data["member"]["attach"] as $user)
504  {
505  if($id_data = $this->__parseId($user))
506  {
507  if($id_data['local'] or $id_data['imported'])
508  {
509  $this->participants->add($id_data['usr_id'],IL_GRP_MEMBER);
510  }
511  }
512  }
513  }
514 
515  if (count($this->group_data["member"]["detach"]))
516  {
517  foreach($this->group_data["member"]["detach"] as $user)
518  {
519  if($id_data = $this->__parseId($user))
520  {
521  if($id_data['local'] or $id_data['imported'])
522  {
523  if($this->participants->isAssigned($id_data['usr_id']))
524  {
525  $this->participants->delete($id_data['usr_id']);
526  }
527  }
528  }
529  }
530  }
531  return true;
532  }
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 575 of file class.ilGroupXMLParser.php.

Referenced by __saveFolder().

576  {
577  unset($this->folder_obj);
578  }
+ Here is the caller graph for this function:

◆ __getParentId()

ilGroupXMLParser::__getParentId ( )

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

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

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

◆ __initFileObject()

ilGroupXMLParser::__initFileObject ( )

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

Referenced by __saveFile().

567  {
568  include_once "./Modules/File/classes/class.ilObjFile.php";
569 
570  $this->file_obj =& new ilObjFile();
571 
572  return true;
573  }
Class ilObjFile.
+ Here is the caller graph for this function:

◆ __initFolderObject()

ilGroupXMLParser::__initFolderObject ( )

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

Referenced by __saveFolder().

549  {
550  include_once "./Modules/Folder/classes/class.ilObjFolder.php";
551 
552  $this->folder_obj =& new ilObjFolder();
553 
554  return true;
555  }
Class ilObjFolder.
+ Here is the caller graph for this function:

◆ __initGroupObject()

ilGroupXMLParser::__initGroupObject ( )

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

References $CREATE, $grp, and $UPDATE.

Referenced by __save().

535  {
536  include_once "./Modules/Group/classes/class.ilObjGroup.php";
537 
538  if ($this->mode == ilGroupXMLParser::$CREATE)
539  {
540  $this->group_obj =& new ilObjGroup();
541  } elseif ($this->mode == ilGroupXMLParser::$UPDATE) {
542  $this->group_obj = $this->grp;
543  }
544 
545  return true;
546  }
Class ilObjGroup.
+ Here is the caller graph for this function:

◆ __initImportFileObject()

ilGroupXMLParser::__initImportFileObject ( )

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

Referenced by __saveFile().

558  {
559  include_once "./Modules/Group/classes/class.ilFileDataImportGroup.php";
560 
561  $this->import_file_obj =& new ilFileDataImportGroup();
562 
563  return true;
564  }
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 580 of file class.ilGroupXMLParser.php.

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

Referenced by __assignMembers().

581  {
582  global $ilias;
583 
584  $fields = explode('_',$a_id);
585 
586  if(!is_array($fields) or
587  $fields[0] != 'il' or
588  !is_numeric($fields[1]) or
589  $fields[2] != 'usr' or
590  !is_numeric($fields[3]))
591  {
592  return false;
593  }
594  if($id = ilObjUser::_getImportedUserId($a_id))
595  {
596  return array('imported' => true,
597  'local' => false,
598  'usr_id' => $id);
599  }
600  if(($fields[1] == $ilias->getSetting('inst_id',0)) and ($user = ilObjUser::_lookupName($fields[3])))
601  {
602  if(strlen($user['login']))
603  {
604  return array('imported' => false,
605  'local' => true,
606  'usr_id' => $fields[3]);
607  }
608  }
609  $GLOBALS['ilLog']->write(__METHOD__.' Parsing id failed: '.$a_id);
610  return false;
611  }
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 84 of file class.ilGroupXMLParser.php.

Referenced by handlerEndTag().

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

◆ __pushParentId()

ilGroupXMLParser::__pushParentId (   $a_id)

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

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

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

◆ __save()

ilGroupXMLParser::__save ( )

mode can be create or update

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

References $CREATE, __assignMembers(), ilUtil\__extractId(), __getParentId(), __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().

289  {
290  if($this->group_imported)
291  {
292  return true;
293  }
294 
295  $this->__initGroupObject();
296 
297  $this->group_obj->setImportId($this->group_data["id"]);
298  $this->group_obj->setTitle($this->group_data["title"]);
299  $this->group_obj->setDescription($this->group_data["description"]);
300 
301  $ownerChanged = false;
302  if (isset($this->group_data["owner"]))
303  {
304  $owner = $this->group_data["owner"];
305  if (!is_numeric($owner))
306  {
307  $owner = ilUtil::__extractId ($owner, IL_INST_ID);
308  }
309  if (is_numeric($owner) && $owner > 0)
310  {
311  $this->group_obj->setOwner($owner);
312  $ownerChanged = true;
313  }
314  }
315 
319  if ($this->mode == ilGroupXMLParser::$CREATE)
320  {
321  $this->group_obj->create();
322  $this->group_obj->createReference();
323  $this->group_obj->putInTree($this->__getParentId());
324  $this->group_obj->setPermissions($this->__getParentId());
325  $this->group_obj->initGroupStatus($this->group_data["type"] == "open" ? GRP_TYPE_PUBLIC : GRP_TYPE_CLOSED);
326  }
327  else
328  {
329  switch($this->group_data['type'])
330  {
331  case 'open':
332  $grp_status = GRP_TYPE_PUBLIC;
333  break;
334 
335  case 'closed':
336  $grp_status = GRP_TYPE_CLOSED;
337  break;
338 
339  }
340 
341  $this->group_obj->updateOwner();
342  if($this->group_obj->getGroupStatus() != $grp_status)
343  {
344  $this->group_obj->setGroupType($grp_status);
345  $this->group_obj->updateGroupType();
346  }
347  }
348 
349  // SET GROUP SPECIFIC DATA
350  switch($this->group_data['registration_type'])
351  {
352  case 'direct':
353  case 'enabled':
354  $flag = GRP_REGISTRATION_DIRECT;
355  break;
356 
357  case 'disabled':
359  break;
360 
361  case 'confirmation':
362  $flag = GRP_REGISTRATION_REQUEST;
363  break;
364 
365  case 'password':
367  break;
368 
369  default:
370  $flag = GRP_REGISTRATION_DIRECT;
371  }
372  $this->group_obj->setRegistrationType($flag);
373 
374  $end = new ilDateTime(time(),IL_CAL_UNIX);
375  if($this->group_data['expiration_end'])
376  {
377  $end = new ilDateTime($this->group_data['expiration_end'],IL_CAL_UNIX);
378  }
379 
380  $start = clone $end;
381  if($this->group_data['expiration_start'])
382  {
383  $start = new ilDateTime($this->group_data['expiration_start'],IL_CAL_UNIX);
384  }
385 
386  $this->group_obj->setRegistrationStart($start);
387  $this->group_obj->setRegistrationEnd($end);
388  $this->group_obj->setPassword($this->group_data['password']);
389  $this->group_obj->enableUnlimitedRegistration(!isset($this->group_data['expiration_end']));
390  $this->group_obj->enableMembershipLimitation($this->group_data['max_members_enabled']);
391  $this->group_obj->setMaxMembers($this->group_data['max_members'] ? $this->group_data['max_members'] : 0);
392  $this->group_obj->enableWaitingList($this->group_data['waiting_list_enabled']);
393 
394 
395  if ($this->mode == ilGroupXMLParser::$CREATE)
396  {
397  $this->group_obj->initGroupStatus($this->group_data["type"] == "open" ? 0 : 1);
398  }
399 
400  $this->group_obj->update();
401 
402  // ASSIGN ADMINS/MEMBERS
403  $this->__assignMembers();
404 
405  $this->__pushParentId($this->group_obj->getRefId());
406 
407 
408  $this->group_imported = true;
409 
410  return true;
411  }
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
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 429 of file class.ilGroupXMLParser.php.

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

Referenced by handlerBeginTag().

430  {
431  $this->__initFileObject();
432 
433  $this->file_obj->setType("file");
434  $this->file_obj->setTitle($this->file["fileName"]);
435  $this->file_obj->setFileName($this->file["fileName"]);
436  $this->file_obj->create();
437  $this->file_obj->createReference();
438  $this->file_obj->putInTree($this->__getParentId());
439  $this->file_obj->setPermissions($this->__getParentId());
440 
441  // COPY FILE
442  $this->file_obj->createDirectory();
443 
444  $this->__initImportFileObject();
445 
446  if($this->import_file_obj->findObjectFile($this->file["id"]))
447  {
448  $this->file_obj->copy($this->import_file_obj->getObjectFile(),$this->file["fileName"]);
449  }
450 
451  unset($this->file_obj);
452  unset($this->import_file_obj);
453 
454  return true;
455  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __saveFolder()

ilGroupXMLParser::__saveFolder ( )

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

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

Referenced by handlerEndTag().

414  {
415  $this->__initFolderObject();
416 
417  $this->folder_obj->setTitle($this->folder);
418  $this->folder_obj->create();
419  $this->folder_obj->createReference();
420  $this->folder_obj->putInTree($this->__getParentId());
421 
422  $this->__pushParentId($this->folder_obj->getRefId());
423 
424  $this->__destroyFolderObject();
425 
426  return true;
427  }
+ 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 128 of file class.ilGroupXMLParser.php.

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

129  {
130  global $ilErr;
131 
132  switch($a_name)
133  {
134  // GROUP DATA
135  case "group":
136  #if($a_attribs["exportVersion"] < EXPORT_VERSION)
137  #{
138  # $ilErr->raiseError("!!! This export Version isn't supported, update your ILIAS 2 installation"
139  # ,$ilErr->WARNING);
140  #}
141  // DEFAULT
142  $this->group_data["admin"] = array();
143  $this->group_data["member"] = array();
144 
145  $this->group_data["type"] = $a_attribs["type"];
146  $this->group_data["id"] = $a_attribs["id"];
147 
148  break;
149 
150  case 'title':
151  break;
152 
153  case "owner":
154  $this->group_data["owner"] = $a_attribs["id"];
155  break;
156 
157  case 'registration':
158  $this->group_data['registration_type'] = $a_attribs['type'];
159  $this->group_data['waiting_list_enabled'] = $a_attribs['waitingList'] == 'Yes' ? true : false;
160  break;
161 
162  case 'maxMembers':
163  $this->group_data['max_members_enabled'] = $a_attribs['enabled'] == 'Yes' ? true : false;
164  break;
165 
166  case "admin":
167  if (!isset($a_attribs['action']) || $a_attribs['action'] == "Attach")
168  {
169  $this->group_data["admin"]["attach"][] = $a_attribs["id"];
170  }
171  elseif (isset($a_attribs['action']) || $a_attribs['action'] == "Detach")
172  {
173  $this->group_data["admin"]["detach"][] = $a_attribs["id"];
174  }
175 
176  if(isset($a_attribs['notification']) and $a_attribs['notification'] == 'Yes')
177  {
178  $this->group_data['notifications'][] = $a_attribs['id'];
179  }
180 
181  break;
182 
183  case "member":
184  if (!isset($a_attribs['action']) || $a_attribs['action'] == "Attach")
185  {
186  $GLOBALS['ilLog']->write(__METHOD__.': new member with id '.$a_attribs['id']);
187  $this->group_data["member"]["attach"][] = $a_attribs["id"];
188  } elseif (isset($a_attribs['action']) || $a_attribs['action'] == "Detach")
189  {
190  $GLOBALS['ilLog']->write(__METHOD__.': deprecated member with id '.$a_attribs['id']);
191  $this->group_data["member"]["detach"][] = $a_attribs["id"];
192  }
193 
194  break;
195 
196  case "folder":
197  // NOW SAVE THE NEW OBJECT (if it hasn't been imported)
198  $this->__save();
199  break;
200 
201  case "file":
202  // NOW SAVE THE NEW OBJECT (if it hasn't been imported)
203  $this->__save();
204 
205  $this->file["fileName"] = $a_attribs["fileName"];
206  $this->file["id"] = $a_attribs["id"];
207 
208  // SAVE IT
209  $this->__saveFile();
210  break;
211  }
212  }
$GLOBALS['ct_recipient']
+ Here is the call graph for this function:

◆ handlerCharacterData()

ilGroupXMLParser::handlerCharacterData (   $a_xml_parser,
  $a_data 
)

handler for character data

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

273  {
274  // i don't know why this is necessary, but
275  // the parser seems to convert "&gt;" to ">" and "&lt;" to "<"
276  // in character data, but we don't want that, because it's the
277  // way we mask user html in our content, so we convert back...
278  $a_data = str_replace("<","&lt;",$a_data);
279  $a_data = str_replace(">","&gt;",$a_data);
280 
281  if(!empty($a_data))
282  {
283  $this->cdata .= $a_data;
284  }
285  }

◆ handlerEndTag()

ilGroupXMLParser::handlerEndTag (   $a_xml_parser,
  $a_name 
)

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

References __popParentId(), __save(), and __saveFolder().

216  {
217  switch($a_name)
218  {
219  case "title":
220  $this->group_data["title"] = trim($this->cdata);
221  break;
222 
223  case "description":
224  $this->group_data["description"] = trim($this->cdata);
225  break;
226 
227  case 'information':
228  $this->group_data['information'] = trim($this->cdata);
229  break;
230 
231  case 'password':
232  $this->group_data['password'] = trim($this->cdata);
233  break;
234 
235  case 'maxMembers':
236  $this->group_data['max_members'] = trim($this->cdata);
237  break;
238 
239  case 'expiration':
240  $this->group_data['expiration_end'] = trim($this->cdata);
241  break;
242 
243  case 'start':
244  $this->group_data['expiration_start'] = trim($this->cdata);
245  break;
246 
247  case 'end':
248  $this->group_data['expiration_end'] = trim($this->cdata);
249  break;
250 
251  case "folder":
252  $this->__popParentId();
253  break;
254 
255  case "folderTitle":
256  $this->folder = trim($this->cdata);
257  $this->__saveFolder();
258  break;
259 
260  case "group":
261  // NOW SAVE THE NEW OBJECT (if it hasn't been imported)
262  $this->__save();
263  break;
264  }
265  $this->cdata = '';
266  }
+ 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 63 of file class.ilGroupXMLParser.php.

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

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

◆ setGroup()

ilGroupXMLParser::setGroup ( $grp)

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

References $grp.

618  {
619  $this->grp = $grp;
620  }

◆ setHandlers()

ilGroupXMLParser::setHandlers (   $a_xml_parser)

set event handler should be overwritten by inherited class private

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

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

◆ setMode()

ilGroupXMLParser::setMode (   $mode)

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

References $mode.

614  {
615  $this->mode = $mode;
616  }

◆ startParsing()

ilGroupXMLParser::startParsing ( )

start the parser

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

References $CREATE.

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

Field Documentation

◆ $counter

ilGroupXMLParser::$counter

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

◆ $CREATE

ilGroupXMLParser::$CREATE = 1
static

◆ $group_data

ilGroupXMLParser::$group_data

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

◆ $group_obj

ilGroupXMLParser::$group_obj

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

◆ $grp

ilGroupXMLParser::$grp

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

Referenced by __initGroupObject(), and setGroup().

◆ $mode

ilGroupXMLParser::$mode

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

Referenced by setMode().

◆ $parent

ilGroupXMLParser::$parent

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

◆ $participants

ilGroupXMLParser::$participants = null
private

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

◆ $UPDATE

ilGroupXMLParser::$UPDATE = 2
static

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