ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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

 __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 ()
 

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, ILIAS\GlobalScreen\Provider\__construct(), __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  }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
Controller class for sax element handlers.
__construct(Container $dic, ilPlugin $plugin)
setXMLContent($a_xml_content)
+ Here is the call graph for this function:

Member Function Documentation

◆ __assignMembers()

ilGroupXMLParser::__assignMembers ( )

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

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

Referenced by __save().

550  {
551  global $DIC;
552 
553  $ilias = $DIC['ilias'];
554  $ilUser = $DIC['ilUser'];
555  $ilSetting = $DIC['ilSetting'];
556 
557  $this->participants = new ilGroupParticipants($this->group_obj->getId());
558  $this->participants->add($ilUser->getId(), IL_GRP_ADMIN);
559  $this->participants->updateNotification($ilUser->getId(), $ilSetting->get('mail_grp_admin_notification', true));
560 
561  // attach ADMINs
562  if (isset($this->group_data["admin"]["attach"]) && count($this->group_data["admin"]["attach"])) {
563  foreach ($this->group_data["admin"]["attach"] as $user) {
564  if ($id_data = $this->__parseId($user)) {
565  if ($id_data['local'] or $id_data['imported']) {
566  $this->participants->add($id_data['usr_id'], IL_GRP_ADMIN);
567  if (in_array($user, (array) $this->group_data['notifications'])) {
568  $this->participants->updateNotification($id_data['usr_id'], true);
569  }
570  }
571  }
572  }
573  }
574  // detach ADMINs
575  if (isset($this->group_data["admin"]["detach"]) && count($this->group_data["admin"]["detach"])) {
576  foreach ($this->group_data["admin"]["detach"] as $user) {
577  if ($id_data = $this->__parseId($user)) {
578  if ($id_data['local'] or $id_data['imported']) {
579  if ($this->participants->isAssigned($id_data['usr_id'])) {
580  $this->participants->delete($id_data['usr_id']);
581  }
582  }
583  }
584  }
585  }
586  // MEMBER
587  if (isset($this->group_data["member"]["attach"]) && count($this->group_data["member"]["attach"])) {
588  foreach ($this->group_data["member"]["attach"] as $user) {
589  if ($id_data = $this->__parseId($user)) {
590  if ($id_data['local'] or $id_data['imported']) {
591  $this->participants->add($id_data['usr_id'], IL_GRP_MEMBER);
592  }
593  }
594  }
595  }
596 
597  if (isset($this->group_data["member"]["detach"]) && count($this->group_data["member"]["detach"])) {
598  foreach ($this->group_data["member"]["detach"] as $user) {
599  if ($id_data = $this->__parseId($user)) {
600  if ($id_data['local'] or $id_data['imported']) {
601  if ($this->participants->isAssigned($id_data['usr_id'])) {
602  $this->participants->delete($id_data['usr_id']);
603  }
604  }
605  }
606  }
607  }
608  return true;
609  }
const IL_GRP_ADMIN
const IL_GRP_MEMBER
add($a_usr_id, $a_role)
Add user to role.
$ilUser
Definition: imgupload.php:18
global $ilSetting
Definition: privfeed.php:17
$DIC
Definition: xapitoken.php:46
+ 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 648 of file class.ilGroupXMLParser.php.

References ilContainerSortingSettings\_importContainerSortingSettings().

Referenced by __save(), and handlerBeginTag().

649  {
650  include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
652  }
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 611 of file class.ilGroupXMLParser.php.

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

Referenced by __assignMembers().

612  {
613  global $DIC;
614 
615  $ilias = $DIC['ilias'];
616 
617  $fields = explode('_', $a_id);
618 
619  if (!is_array($fields) or
620  $fields[0] != 'il' or
621  !is_numeric($fields[1]) or
622  $fields[2] != 'usr' or
623  !is_numeric($fields[3])) {
624  return false;
625  }
626  if ($id = ilObjUser::_getImportedUserId($a_id)) {
627  return array('imported' => true,
628  'local' => false,
629  'usr_id' => $id);
630  }
631  if (($fields[1] == $ilias->getSetting('inst_id', 0)) and ($user = ilObjUser::_lookupName($fields[3]))) {
632  if (strlen($user['login'])) {
633  return array('imported' => false,
634  'local' => true,
635  'usr_id' => $fields[3]);
636  }
637  }
638  $GLOBALS['DIC']->logger()->grp()->warning('Parsing id failed: ' . $a_id);
639  return false;
640  }
static _lookupName($a_user_id)
lookup user name
static _getImportedUserId($i2_id)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$DIC
Definition: xapitoken.php:46
+ 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 406 of file class.ilGroupXMLParser.php.

References $CREATE, Vendor\Package\$e, __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().

407  {
408  if ($this->group_imported) {
409  return true;
410  }
411 
412  $this->group_obj->setImportId($this->group_data["id"]);
413  $this->group_obj->setTitle($this->group_data["title"]);
414  $this->group_obj->setDescription($this->group_data["description"]);
415  $this->group_obj->setInformation((string) $this->group_data['information']);
416 
417  if (
418  $this->group_data['period_start'] &&
419  $this->group_data['period_end']) {
420  try {
421  if ($this->group_data['period_with_time']) {
422  $this->group_obj->setPeriod(
423  new \ilDateTime($this->group_data['period_start'], IL_CAL_UNIX),
424  new \ilDateTime($this->group_data['period_end'], IL_CAL_UNIX)
425  );
426  } else {
427  $this->group_obj->setPeriod(
428  new \ilDateTime($this->group_data['period_start'], IL_CAL_UNIX),
429  new \ilDateTime($this->group_data['period_end'], IL_CAL_UNIX)
430  );
431  }
432  } catch (Exception $e) {
433  $this->log->warning('Ignoring invalid group period settings: ');
434  $this->log->warning('Period start: ' . $this->group_data['period_start']);
435  $this->log->warning('Period end: ' . $this->group_data['period_end']);
436  }
437  }
438 
439  $ownerChanged = false;
440  if (isset($this->group_data["owner"])) {
441  $owner = $this->group_data["owner"];
442  if (!is_numeric($owner)) {
443  $owner = ilUtil::__extractId($owner, IL_INST_ID);
444  }
445  if (is_numeric($owner) && $owner > 0) {
446  $this->group_obj->setOwner($owner);
447  $ownerChanged = true;
448  }
449  }
450 
454  if ($this->mode == ilGroupXMLParser::$CREATE) {
455  $this->group_obj->createReference();
456  $this->group_obj->putInTree($this->__getParentId());
457  $this->group_obj->setPermissions($this->__getParentId());
458  if (
459  array_key_exists('type', $this->group_data) &&
460  $this->group_data['type'] == 'closed'
461  ) {
462  $this->group_obj->updateGroupType(GRP_TYPE_CLOSED);
463  }
464  } else {
465  if (
466  array_key_exists('type', $this->group_data) &&
467  $this->group_data['type'] == 'closed'
468  ) {
469  $this->group_obj->updateGroupType(GRP_TYPE_CLOSED);
470  } elseif (
471  array_key_exists('type', $this->group_data) &&
472  $this->group_data['type'] == 'open'
473  ) {
474  $this->group_obj->updateGroupType(GRP_TYPE_OPEN);
475  }
476  }
477  // SET GROUP SPECIFIC DATA
478  switch ($this->group_data['registration_type']) {
479  case 'direct':
480  case 'enabled':
481  $flag = GRP_REGISTRATION_DIRECT;
482  break;
483 
484  case 'disabled':
486  break;
487 
488  case 'confirmation':
489  $flag = GRP_REGISTRATION_REQUEST;
490  break;
491 
492  case 'password':
494  break;
495 
496  default:
497  $flag = GRP_REGISTRATION_DIRECT;
498  }
499  $this->group_obj->setRegistrationType($flag);
500 
501 
502  $registration_end = null;
503  if ($this->group_data['expiration_end']) {
504  $registration_end = new ilDateTime($this->group_data['expiration_end'], IL_CAL_UNIX);
505  }
506 
507  $registration_start = null;
508  if ($this->group_data['expiration_start']) {
509  $registration_start = new ilDateTime($this->group_data['expiration_start'], IL_CAL_UNIX);
510  }
511  if (
512  $registration_start instanceof ilDateTime &&
513  $registration_end instanceof ilDateTime
514  ) {
515  $this->group_obj->enableUnlimitedRegistration(false);
516  $this->group_obj->setRegistrationStart($registration_start);
517  $this->group_obj->setRegistrationEnd($registration_end);
518 
519  } else {
520  $this->group_obj->enableUnlimitedRegistration(true);
521  }
522  $this->group_obj->setPassword($this->group_data['password']);
523  $this->group_obj->enableMembershipLimitation($this->group_data['max_members_enabled']);
524  $this->group_obj->setMaxMembers($this->group_data['max_members'] ? $this->group_data['max_members'] : 0);
525  $this->group_obj->enableWaitingList($this->group_data['waiting_list_enabled']);
526 
527  $this->group_obj->setWaitingListAutoFill($this->group_data['auto_wait']);
528  $this->group_obj->setCancellationEnd($this->group_data['cancel_end']);
529  $this->group_obj->setMinMembers($this->group_data['min_members']);
530  $this->group_obj->setShowMembers($this->group_data['show_members'] ? $this->group_data['show_members'] : 0);
531  $this->group_obj->setAutoNotification($this->group_data['auto_notification'] ? true : false);
532  $this->group_obj->setMailToMembersType((int) $this->group_data['mail_members_type']);
533  $this->group_obj->update();
534 
535  // ASSIGN ADMINS/MEMBERS
536  $this->__assignMembers();
537 
538  $this->__pushParentId($this->group_obj->getRefId());
539 
540  if ($this->sort) {
541  $this->__initContainerSorting($this->sort, $this->group_obj->getId());
542  }
543 
544  $this->group_imported = true;
545 
546  return true;
547  }
const GRP_TYPE_OPEN
const GRP_REGISTRATION_DEACTIVATED
const IL_CAL_UNIX
const GRP_REGISTRATION_PASSWORD
const GRP_REGISTRATION_REQUEST
const GRP_TYPE_CLOSED
__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  $this->group_data['period_with_time'] = $a_attribs['withTime'];
226  break;
227 
228  case 'maxMembers':
229  $this->group_data['max_members_enabled'] = $a_attribs['enabled'] == 'Yes' ? true : false;
230  break;
231 
232  case "admin":
233  if (!isset($a_attribs['action']) || $a_attribs['action'] == "Attach") {
234  $this->group_data["admin"]["attach"][] = $a_attribs["id"];
235  } elseif (isset($a_attribs['action']) || $a_attribs['action'] == "Detach") {
236  $this->group_data["admin"]["detach"][] = $a_attribs["id"];
237  }
238 
239  if (isset($a_attribs['notification']) and $a_attribs['notification'] == 'Yes') {
240  $this->group_data['notifications'][] = $a_attribs['id'];
241  }
242 
243  break;
244 
245  case "member":
246  if (!isset($a_attribs['action']) || $a_attribs['action'] == "Attach") {
247  $GLOBALS['DIC']->logger()->grp()->debug('New member with id ' . $a_attribs['id']);
248  $this->group_data["member"]["attach"][] = $a_attribs["id"];
249  } elseif (isset($a_attribs['action']) || $a_attribs['action'] == "Detach") {
250  $GLOBALS['DIC']->logger()->grp()->debug('Deprecated member with id ' . $a_attribs['id']);
251  $this->group_data["member"]["detach"][] = $a_attribs["id"];
252  }
253 
254  break;
255 
256  case 'ContainerSetting':
257  $this->current_container_setting = $a_attribs['id'];
258  break;
259 
260  case 'Sort':
261 
262  if ($this->group_imported) {
263  $this->__initContainerSorting($a_attribs, $this->group_obj->getId());
264  } else {
265  $this->sort = $a_attribs;
266  }
267 
268  break;
269 
270  case 'WaitingListAutoFill':
271  case 'CancellationEnd':
272  case 'minMembers':
273  case 'mailMembersType':
274  break;
275  }
276  }
$ilErr
Definition: raiseError.php:18
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
__initContainerSorting($a_attribs, $a_group_id)
$DIC
Definition: xapitoken.php:46
+ 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 391 of file class.ilGroupXMLParser.php.

392  {
393  if ($this->lom_parsing_active) {
394  parent::handlerCharacterData($a_xml_parser, $a_data);
395  }
396 
397  $a_data = str_replace("<", "&lt;", $a_data);
398  $a_data = str_replace(">", "&gt;", $a_data);
399 
400  if (!empty($a_data)) {
401  $this->cdata .= $a_data;
402  }
403  }

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

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

280  {
281  if ($this->lom_parsing_active) {
282  parent::handlerEndTag($a_xml_parser, $a_name);
283  }
284 
285  switch ($a_name) {
286  case 'MetaData':
287  $this->lom_parsing_active = false;
288  parent::handlerEndTag($a_xml_parser, $a_name);
289  break;
290 
291 
292  case "title":
293  $this->group_data["title"] = trim($this->cdata);
294  break;
295 
296  case "description":
297  $this->group_data["description"] = trim($this->cdata);
298  break;
299 
300  case 'information':
301  $this->group_data['information'] = trim($this->cdata);
302  break;
303 
304  case 'password':
305  $this->group_data['password'] = trim($this->cdata);
306  break;
307 
308  case 'maxMembers':
309  $this->group_data['max_members'] = trim($this->cdata);
310  break;
311 
312  case 'expiration':
313  $this->group_data['expiration_end'] = trim($this->cdata);
314  break;
315 
316  case 'start':
317  if ($this->in_period) {
318  $this->group_data['period_start'] = trim($this->cdata);
319  } else {
320  $this->group_data['expiration_start'] = trim($this->cdata);
321  }
322  break;
323 
324  case 'end':
325  if ($this->in_period) {
326  $this->group_data['period_end'] = trim($this->cdata);
327  } else {
328  $this->group_data['expiration_end'] = trim($this->cdata);
329  }
330  break;
331 
332  case 'period':
333  $this->in_period = false;
334  break;
335 
336  case "group":
337  // NOW SAVE THE NEW OBJECT (if it hasn't been imported)
338  $this->__save();
339  break;
340 
341  case 'ContainerSetting':
342  if ($this->current_container_setting) {
344  $this->group_obj->getId(),
346  $this->cdata
347  );
348  }
349  break;
350 
351  case 'WaitingListAutoFill':
352  $this->group_data['auto_wait'] = trim($this->cdata);
353  break;
354 
355  case 'CancellationEnd':
356  if ((int) $this->cdata) {
357  $this->group_data['cancel_end'] = new ilDate((int) $this->cdata, IL_CAL_UNIX);
358  }
359  break;
360 
361  case 'minMembers':
362  if ((int) $this->cdata) {
363  $this->group_data['min_members'] = (int) $this->cdata;
364  }
365  break;
366 
367  case 'showMembers':
368  if ((int) $this->cdata) {
369  $this->group_data['show_members'] = (int) $this->cdata;
370  }
371  break;
372 
373  case 'admissionNotification':
374  if ((int) $this->cdata) {
375  $this->group_data['auto_notification'] = (bool) $this->cdata;
376  }
377  break;
378 
379  case 'mailMembersType':
380  $this->group_data['mail_members_type'] = (int) $this->cdata;
381  break;
382 
383  }
384  $this->cdata = '';
385  }
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 643 of file class.ilGroupXMLParser.php.

References $mode.

644  {
645  $this->mode = $mode;
646  }

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