ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilGroupXMLParser Class Reference

Group Import Parser. More...

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

Public Member Functions

 __construct (ilObjGroup $group, $a_xml, $a_parent_id)
 Constructor. More...
 
 __pushParentId ($a_id)
 
 __popParentId ()
 
 __getParentId ()
 
 setHandlers ($a_xml_parser)
 set event handlers 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)
 End element handler. More...
 
 handlerCharacterData ($a_xml_parser, $a_data)
 handler for character data More...
 
 __save ()
 
 __assignMembers ()
 
 __parseId ($a_id)
 
 setMode ($mode)
 
 __initContainerSorting ($a_attribs, $a_group_id)
 
- 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...
 
- 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 ()
 
 __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 ()
 

Data Fields

 $group_data
 
 $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()
 
- Data Fields inherited from ilMDSaxParser
 $md_in_md = false
 
 $md_chr_data = ''
 
 $md_cur_el = null
 
 $md_parsing_enabled = null
 
 $md = null
 
 $md_gen
 

Static Public Attributes

static $CREATE = 1
 
static $UPDATE = 2
 

Protected Attributes

 $log
 
 $sax_controller = null
 
 $advanced_md_value_parser = null
 
- Protected Attributes inherited from ilMDSaxParser
 $meta_log
 

Private Attributes

 $group_obj
 
 $lom_parsing_active = false
 
 $participants = null
 
 $current_container_setting
 
 $sort = null
 

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...
 

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.

Constructor & Destructor Documentation

◆ __construct()

ilGroupXMLParser::__construct ( ilObjGroup  $group,
  $a_xml,
  $a_parent_id 
)

Constructor.

Parameters
string$a_xml_filexml file

public ilGroupXMLParser constructor.

Parameters
ilObjGroup$group
string$a_xml
int$a_parent_id

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

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

101  {
102  define('EXPORT_VERSION', 2);
103 
104  parent::__construct(null);
105 
106  $this->sax_controller = new ilSaxController();
107 
108  $this->mode = ilGroupXMLParser::$CREATE;
109  $this->group_obj = $group;
110  $this->log = $GLOBALS['DIC']->logger()->grp();
111 
112  $this->setXMLContent($a_xml);
113 
114  // init md parsing
115  $this->setMDObject(
116  new ilMD(
117  $this->group_obj->getId(),
118  $this->group_obj->getId(),
119  $this->group_obj->getType()
120  )
121  );
122 
123  // SET MEMBER VARIABLES
124  $this->__pushParentId($a_parent_id);
125  }
Controller class for sax element handlers.
setXMLContent($a_xml_content)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

Member Function Documentation

◆ __assignMembers()

ilGroupXMLParser::__assignMembers ( )

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

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

Referenced by __save().

519  {
520  global $DIC;
521 
522  $ilias = $DIC['ilias'];
523  $ilUser = $DIC['ilUser'];
524  $ilSetting = $DIC['ilSetting'];
525 
526  $this->participants = new ilGroupParticipants($this->group_obj->getId());
527  $this->participants->add($ilUser->getId(), IL_GRP_ADMIN);
528  $this->participants->updateNotification($ilUser->getId(), $ilSetting->get('mail_grp_admin_notification', true));
529 
530  // attach ADMINs
531  if (isset($this->group_data["admin"]["attach"]) && count($this->group_data["admin"]["attach"])) {
532  foreach ($this->group_data["admin"]["attach"] as $user) {
533  if ($id_data = $this->__parseId($user)) {
534  if ($id_data['local'] or $id_data['imported']) {
535  $this->participants->add($id_data['usr_id'], IL_GRP_ADMIN);
536  if (in_array($user, (array) $this->group_data['notifications'])) {
537  $this->participants->updateNotification($id_data['usr_id'], true);
538  }
539  }
540  }
541  }
542  }
543  // detach ADMINs
544  if (isset($this->group_data["admin"]["detach"]) && count($this->group_data["admin"]["detach"])) {
545  foreach ($this->group_data["admin"]["detach"] as $user) {
546  if ($id_data = $this->__parseId($user)) {
547  if ($id_data['local'] or $id_data['imported']) {
548  if ($this->participants->isAssigned($id_data['usr_id'])) {
549  $this->participants->delete($id_data['usr_id']);
550  }
551  }
552  }
553  }
554  }
555  // MEMBER
556  if (isset($this->group_data["member"]["attach"]) && count($this->group_data["member"]["attach"])) {
557  foreach ($this->group_data["member"]["attach"] as $user) {
558  if ($id_data = $this->__parseId($user)) {
559  if ($id_data['local'] or $id_data['imported']) {
560  $this->participants->add($id_data['usr_id'], IL_GRP_MEMBER);
561  }
562  }
563  }
564  }
565 
566  if (isset($this->group_data["member"]["detach"]) && count($this->group_data["member"]["detach"])) {
567  foreach ($this->group_data["member"]["detach"] as $user) {
568  if ($id_data = $this->__parseId($user)) {
569  if ($id_data['local'] or $id_data['imported']) {
570  if ($this->participants->isAssigned($id_data['usr_id'])) {
571  $this->participants->delete($id_data['usr_id']);
572  }
573  }
574  }
575  }
576  }
577  return true;
578  }
global $DIC
Definition: saml.php:7
const IL_GRP_ADMIN
const IL_GRP_MEMBER
add($a_usr_id, $a_role)
Add user to role.
$ilUser
Definition: imgupload.php:18
$user
Definition: migrateto20.php:57
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __getParentId()

ilGroupXMLParser::__getParentId ( )

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

Referenced by __save().

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

◆ __initContainerSorting()

ilGroupXMLParser::__initContainerSorting (   $a_attribs,
  $a_group_id 
)

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

References ilContainerSortingSettings\_importContainerSortingSettings().

Referenced by __save(), and handlerBeginTag().

618  {
619  include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
621  }
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:

◆ __parseId()

ilGroupXMLParser::__parseId (   $a_id)

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

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

Referenced by __assignMembers().

581  {
582  global $DIC;
583 
584  $ilias = $DIC['ilias'];
585 
586  $fields = explode('_', $a_id);
587 
588  if (!is_array($fields) or
589  $fields[0] != 'il' or
590  !is_numeric($fields[1]) or
591  $fields[2] != 'usr' or
592  !is_numeric($fields[3])) {
593  return false;
594  }
595  if ($id = ilObjUser::_getImportedUserId($a_id)) {
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  if (strlen($user['login'])) {
602  return array('imported' => false,
603  'local' => true,
604  'usr_id' => $fields[3]);
605  }
606  }
607  $GLOBALS['DIC']->logger()->grp()->warning('Parsing id failed: ' . $a_id);
608  return false;
609  }
static _lookupName($a_user_id)
lookup user name
global $DIC
Definition: saml.php:7
if(!array_key_exists('StateId', $_REQUEST)) $id
static _getImportedUserId($i2_id)
$user
Definition: migrateto20.php:57
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __popParentId()

ilGroupXMLParser::__popParentId ( )

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

132  {
133  array_pop($this->parent);
134 
135  return true;
136  }

◆ __pushParentId()

ilGroupXMLParser::__pushParentId (   $a_id)

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

Referenced by __construct(), and __save().

128  {
129  $this->parent[] = $a_id;
130  }
+ Here is the caller graph for this function:

◆ __save()

ilGroupXMLParser::__save ( )

mode can be create or update

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

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

Referenced by handlerEndTag().

400  {
401  if ($this->group_imported) {
402  return true;
403  }
404 
405  $this->group_obj->setImportId($this->group_data["id"]);
406  $this->group_obj->setTitle($this->group_data["title"]);
407  $this->group_obj->setDescription($this->group_data["description"]);
408  $this->group_obj->setInformation((string) $this->group_data['information']);
409 
410  if (
411  $this->group_data['period_start'] &&
412  $this->group_data['period_end']) {
413  $this->group_obj->setStart(new ilDate($this->group_data['period_start'], IL_CAL_UNIX));
414  $this->group_obj->setEnd(new ilDate($this->group_data['period_end'], IL_CAL_UNIX));
415  }
416 
417  $ownerChanged = false;
418  if (isset($this->group_data["owner"])) {
419  $owner = $this->group_data["owner"];
420  if (!is_numeric($owner)) {
421  $owner = ilUtil::__extractId($owner, IL_INST_ID);
422  }
423  if (is_numeric($owner) && $owner > 0) {
424  $this->group_obj->setOwner($owner);
425  $ownerChanged = true;
426  }
427  }
428 
432  if ($this->mode == ilGroupXMLParser::$CREATE) {
433  $this->group_obj->createReference();
434  $this->group_obj->putInTree($this->__getParentId());
435  $this->group_obj->setPermissions($this->__getParentId());
436  if (
437  array_key_exists('type', $this->group_data) &&
438  $this->group_data['type'] == 'closed'
439  ) {
440  $this->group_obj->updateGroupType(GRP_TYPE_CLOSED);
441  }
442  } else {
443  if (
444  array_key_exists('type', $this->group_data) &&
445  $this->group_data['type'] == 'closed'
446  ) {
447  $this->group_obj->updateGroupType(GRP_TYPE_CLOSED);
448  } elseif (
449  array_key_exists('type', $this->group_data) &&
450  $this->group_data['type'] == 'open'
451  ) {
452  $this->group_obj->updateGroupType(GRP_TYPE_OPEN);
453  }
454  }
455  // SET GROUP SPECIFIC DATA
456  switch ($this->group_data['registration_type']) {
457  case 'direct':
458  case 'enabled':
459  $flag = GRP_REGISTRATION_DIRECT;
460  break;
461 
462  case 'disabled':
464  break;
465 
466  case 'confirmation':
467  $flag = GRP_REGISTRATION_REQUEST;
468  break;
469 
470  case 'password':
472  break;
473 
474  default:
475  $flag = GRP_REGISTRATION_DIRECT;
476  }
477  $this->group_obj->setRegistrationType($flag);
478 
479  $end = new ilDateTime(time(), IL_CAL_UNIX);
480  if ($this->group_data['expiration_end']) {
481  $end = new ilDateTime($this->group_data['expiration_end'], IL_CAL_UNIX);
482  }
483 
484  $start = clone $end;
485  if ($this->group_data['expiration_start']) {
486  $start = new ilDateTime($this->group_data['expiration_start'], IL_CAL_UNIX);
487  }
488 
489  $this->group_obj->setRegistrationStart($start);
490  $this->group_obj->setRegistrationEnd($end);
491  $this->group_obj->setPassword($this->group_data['password']);
492  $this->group_obj->enableUnlimitedRegistration(!isset($this->group_data['expiration_end']));
493  $this->group_obj->enableMembershipLimitation($this->group_data['max_members_enabled']);
494  $this->group_obj->setMaxMembers($this->group_data['max_members'] ? $this->group_data['max_members'] : 0);
495  $this->group_obj->enableWaitingList($this->group_data['waiting_list_enabled']);
496 
497  $this->group_obj->setWaitingListAutoFill($this->group_data['auto_wait']);
498  $this->group_obj->setCancellationEnd($this->group_data['cancel_end']);
499  $this->group_obj->setMinMembers($this->group_data['min_members']);
500  $this->group_obj->setShowMembers($this->group_data['show_members'] ? $this->group_data['show_members'] : 0);
501  $this->group_obj->setMailToMembersType((int) $this->group_data['mail_members_type']);
502  $this->group_obj->update();
503 
504  // ASSIGN ADMINS/MEMBERS
505  $this->__assignMembers();
506 
507  $this->__pushParentId($this->group_obj->getRefId());
508 
509  if ($this->sort) {
510  $this->__initContainerSorting($this->sort, $this->group_obj->getId());
511  }
512 
513  $this->group_imported = true;
514 
515  return true;
516  }
const GRP_TYPE_OPEN
const GRP_REGISTRATION_DEACTIVATED
const IL_CAL_UNIX
const GRP_REGISTRATION_PASSWORD
const GRP_REGISTRATION_REQUEST
$start
Definition: bench.php:8
Class for single dates.
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:

◆ handlerBeginTag()

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

handler for begin of element

Implements ilSaxSubsetParser.

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

References $DIC, $GLOBALS, $ilErr, and __initContainerSorting().

184  {
185  global $DIC;
186 
187  $ilErr = $DIC['ilErr'];
188 
189  if ($this->lom_parsing_active) {
190  parent::handlerBeginTag($a_xml_parser, $a_name, $a_attribs);
191  return;
192  }
193 
194  switch ($a_name) {
195  case "MetaData":
196  $this->lom_parsing_active = true;
197  parent::handlerBeginTag($a_xml_parser, $a_name, $a_attribs);
198  break;
199 
200 
201  // GROUP DATA
202  case "group":
203  $this->group_data["admin"] = array();
204  $this->group_data["member"] = array();
205 
206  $this->group_data["type"] = $a_attribs["type"];
207  $this->group_data["id"] = $a_attribs["id"];
208 
209  break;
210 
211  case 'title':
212  break;
213 
214  case "owner":
215  $this->group_data["owner"] = $a_attribs["id"];
216  break;
217 
218  case 'registration':
219  $this->group_data['registration_type'] = $a_attribs['type'];
220  $this->group_data['waiting_list_enabled'] = $a_attribs['waitingList'] == 'Yes' ? true : false;
221  break;
222 
223  case 'period':
224  $this->in_period = true;
225  break;
226 
227  case 'maxMembers':
228  $this->group_data['max_members_enabled'] = $a_attribs['enabled'] == 'Yes' ? true : false;
229  break;
230 
231  case "admin":
232  if (!isset($a_attribs['action']) || $a_attribs['action'] == "Attach") {
233  $this->group_data["admin"]["attach"][] = $a_attribs["id"];
234  } elseif (isset($a_attribs['action']) || $a_attribs['action'] == "Detach") {
235  $this->group_data["admin"]["detach"][] = $a_attribs["id"];
236  }
237 
238  if (isset($a_attribs['notification']) and $a_attribs['notification'] == 'Yes') {
239  $this->group_data['notifications'][] = $a_attribs['id'];
240  }
241 
242  break;
243 
244  case "member":
245  if (!isset($a_attribs['action']) || $a_attribs['action'] == "Attach") {
246  $GLOBALS['DIC']->logger()->grp()->debug('New member with id ' . $a_attribs['id']);
247  $this->group_data["member"]["attach"][] = $a_attribs["id"];
248  } elseif (isset($a_attribs['action']) || $a_attribs['action'] == "Detach") {
249  $GLOBALS['DIC']->logger()->grp()->debug('Deprecated member with id ' . $a_attribs['id']);
250  $this->group_data["member"]["detach"][] = $a_attribs["id"];
251  }
252 
253  break;
254 
255  case 'ContainerSetting':
256  $this->current_container_setting = $a_attribs['id'];
257  break;
258 
259  case 'Sort':
260 
261  if ($this->group_imported) {
262  $this->__initContainerSorting($a_attribs, $this->group_obj->getId());
263  } else {
264  $this->sort = $a_attribs;
265  }
266 
267  break;
268 
269  case 'WaitingListAutoFill':
270  case 'CancellationEnd':
271  case 'minMembers':
272  case 'mailMembersType':
273  break;
274  }
275  }
global $DIC
Definition: saml.php:7
$ilErr
Definition: raiseError.php:18
__initContainerSorting($a_attribs, $a_group_id)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ handlerCharacterData()

ilGroupXMLParser::handlerCharacterData (   $a_xml_parser,
  $a_data 
)

handler for character data

Implements ilSaxSubsetParser.

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

385  {
386  if ($this->lom_parsing_active) {
387  parent::handlerCharacterData($a_xml_parser, $a_data);
388  }
389 
390  $a_data = str_replace("<", "&lt;", $a_data);
391  $a_data = str_replace(">", "&gt;", $a_data);
392 
393  if (!empty($a_data)) {
394  $this->cdata .= $a_data;
395  }
396  }

◆ handlerEndTag()

ilGroupXMLParser::handlerEndTag (   $a_xml_parser,
  $a_name 
)

End element handler.

public

Parameters
resource$a_xml_parserxml parser
string$a_nameelement name

Implements ilSaxSubsetParser.

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

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

279  {
280  if ($this->lom_parsing_active) {
281  parent::handlerEndTag($a_xml_parser, $a_name);
282  }
283 
284  switch ($a_name) {
285  case 'MetaData':
286  $this->lom_parsing_active = false;
287  parent::handlerEndTag($a_xml_parser, $a_name);
288  break;
289 
290 
291  case "title":
292  $this->group_data["title"] = trim($this->cdata);
293  break;
294 
295  case "description":
296  $this->group_data["description"] = trim($this->cdata);
297  break;
298 
299  case 'information':
300  $this->group_data['information'] = trim($this->cdata);
301  break;
302 
303  case 'password':
304  $this->group_data['password'] = trim($this->cdata);
305  break;
306 
307  case 'maxMembers':
308  $this->group_data['max_members'] = trim($this->cdata);
309  break;
310 
311  case 'expiration':
312  $this->group_data['expiration_end'] = trim($this->cdata);
313  break;
314 
315  case 'start':
316  if ($this->in_period) {
317  $this->group_data['period_start'] = trim($this->cdata);
318  } else {
319  $this->group_data['expiration_start'] = trim($this->cdata);
320  }
321  break;
322 
323  case 'end':
324  if ($this->in_period) {
325  $this->group_data['period_end'] = trim($this->cdata);
326  } else {
327  $this->group_data['expiration_end'] = trim($this->cdata);
328  }
329  break;
330 
331  case 'period':
332  $this->in_period = false;
333  break;
334 
335  case "group":
336  // NOW SAVE THE NEW OBJECT (if it hasn't been imported)
337  $this->__save();
338  break;
339 
340  case 'ContainerSetting':
341  if ($this->current_container_setting) {
343  $this->group_obj->getId(),
345  $this->cdata
346  );
347  }
348  break;
349 
350  case 'WaitingListAutoFill':
351  $this->group_data['auto_wait'] = trim($this->cdata);
352  break;
353 
354  case 'CancellationEnd':
355  if ((int) $this->cdata) {
356  $this->group_data['cancel_end'] = new ilDate((int) $this->cdata, IL_CAL_UNIX);
357  }
358  break;
359 
360  case 'minMembers':
361  if ((int) $this->cdata) {
362  $this->group_data['min_members'] = (int) $this->cdata;
363  }
364  break;
365 
366  case 'showMembers':
367  if ((int) $this->cdata) {
368  $this->group_data['show_members'] = (int) $this->cdata;
369  }
370  break;
371 
372  case 'mailMembersType':
373  $this->group_data['mail_members_type'] = (int) $this->cdata;
374  break;
375 
376  }
377  $this->cdata = '';
378  }
const IL_CAL_UNIX
Class for single dates.
static _writeContainerSetting($a_id, $a_keyword, $a_value)
+ Here is the call graph for this function:

◆ setHandlers()

ilGroupXMLParser::setHandlers (   $a_xml_parser)

set event handlers

Parameters
resourcereference to the xml parser public

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

150  {
151  $this->sax_controller->setHandlers($a_xml_parser);
152  $this->sax_controller->setDefaultElementHandler($this);
153 
154  $this->advanced_md_value_parser = new ilAdvancedMDValueParser(
155  $this->group_obj->getId()
156  );
157 
158  $this->sax_controller->setElementHandler(
159  $this->advanced_md_value_parser,
160  'AdvancedMetaData'
161  );
162  }

◆ setMode()

ilGroupXMLParser::setMode (   $mode)

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

References $mode.

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

◆ startParsing()

ilGroupXMLParser::startParsing ( )

start the parser

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

References $CREATE.

169  {
170  parent::startParsing();
171 
172  if ($this->mode == ilGroupXMLParser::$CREATE) {
173  return is_object($this->group_obj) ? $this->group_obj->getRefId() : false;
174  } else {
175  return is_object($this->group_obj) ? $this->group_obj->update() : false;
176  }
177  }

Field Documentation

◆ $advanced_md_value_parser

ilGroupXMLParser::$advanced_md_value_parser = null
protected

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

◆ $counter

ilGroupXMLParser::$counter

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

◆ $CREATE

ilGroupXMLParser::$CREATE = 1
static

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

Referenced by __construct(), __save(), and startParsing().

◆ $current_container_setting

ilGroupXMLParser::$current_container_setting
private

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

Referenced by handlerEndTag().

◆ $group_data

ilGroupXMLParser::$group_data

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

◆ $group_obj

ilGroupXMLParser::$group_obj
private

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

◆ $grp

ilGroupXMLParser::$grp

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

◆ $log

ilGroupXMLParser::$log
protected

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

◆ $lom_parsing_active

ilGroupXMLParser::$lom_parsing_active = false
private

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

◆ $mode

ilGroupXMLParser::$mode

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

Referenced by setMode().

◆ $parent

ilGroupXMLParser::$parent

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

◆ $participants

ilGroupXMLParser::$participants = null
private

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

◆ $sax_controller

ilGroupXMLParser::$sax_controller = null
protected

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

◆ $sort

ilGroupXMLParser::$sort = null
private

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

◆ $UPDATE

ilGroupXMLParser::$UPDATE = 2
static

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