24require_once(
"./Services/Xml/classes/class.ilSaxParser.php");
 
   25require_once(
'./Services/User/classes/class.ilObjUser.php');
 
   26include_once(
'./Services/Calendar/classes/class.ilDateTime.php');
 
   27include_once(
'./Modules/Group/classes/class.ilGroupParticipants.php');
 
   67                define(
'EXPORT_VERSION',2);
 
   69                parent::ilSaxParser(
null);
 
   84                $this->parent[] = $a_id;
 
   88                array_pop($this->parent);
 
   94                return $this->parent[count($this->parent) - 1];
 
  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');
 
  114                parent::startParsing();
 
  118                        return is_object($this->group_obj) ? $this->group_obj->getRefId() : 
false;
 
  122                        return is_object($this->group_obj) ? $this->group_obj->update() : 
false;
 
  138                                #if($a_attribs["exportVersion"] < EXPORT_VERSION)
 
  140                                #       $ilErr->raiseError("!!! This export Version isn't supported, update your ILIAS 2 installation" 
  144                                $this->group_data[
"admin"] = array();
 
  145                                $this->group_data[
"member"] = array();
 
  147                                $this->group_data[
"type"] = $a_attribs[
"type"];
 
  148                                $this->group_data[
"id"] = $a_attribs[
"id"];
 
  156                                $this->group_data[
"owner"] = $a_attribs[
"id"];
 
  160                                $this->group_data[
'registration_type'] = $a_attribs[
'type'];
 
  161                                $this->group_data[
'waiting_list_enabled'] = $a_attribs[
'waitingList'] == 
'Yes' ? true : 
false;
 
  165                                $this->group_data[
'max_members_enabled'] = $a_attribs[
'enabled'] == 
'Yes' ? true : 
false;
 
  169                                if (!isset($a_attribs[
'action']) || $a_attribs[
'action'] == 
"Attach")
 
  171                                        $this->group_data[
"admin"][
"attach"][] = $a_attribs[
"id"];
 
  173                                elseif (isset($a_attribs[
'action']) || $a_attribs[
'action'] == 
"Detach")
 
  175                                        $this->group_data[
"admin"][
"detach"][] = $a_attribs[
"id"];
 
  178                                if(isset($a_attribs[
'notification']) and $a_attribs[
'notification'] == 
'Yes')
 
  180                                        $this->group_data[
'notifications'][] = $a_attribs[
'id'];
 
  186                                if (!isset($a_attribs[
'action']) || $a_attribs[
'action'] == 
"Attach")
 
  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")
 
  192                                        $GLOBALS[
'ilLog']->write(__METHOD__.
': deprecated member with id '.$a_attribs[
'id']);
 
  193                                        $this->group_data[
"member"][
"detach"][] = $a_attribs[
"id"];
 
  207                                $this->file[
"fileName"] = $a_attribs[
"fileName"];
 
  208                                $this->file[
"id"] = $a_attribs[
"id"];
 
  214                        case 'ContainerSetting':
 
  215                                $this->current_container_setting = $a_attribs[
'id'];                            
 
  220                                if($this->group_imported)
 
  226                                        $this->sort = $a_attribs;
 
  231                        case 'WaitingListAutoFill':
 
  232                        case 'CancellationEnd':
 
  244                                $this->group_data[
"title"] = trim($this->cdata);
 
  248                                $this->group_data[
"description"] = trim($this->cdata);
 
  252                                $this->group_data[
'information'] = trim($this->cdata);
 
  256                                $this->group_data[
'password'] = trim($this->cdata);
 
  260                                $this->group_data[
'max_members'] = trim($this->cdata);
 
  264                                $this->group_data[
'expiration_end'] = trim($this->cdata);
 
  268                                $this->group_data[
'expiration_start'] = trim($this->cdata);
 
  272                                $this->group_data[
'expiration_end'] = trim($this->cdata);
 
  280                                $this->folder = trim($this->cdata);
 
  289                        case 'ContainerSetting':
 
  290                                if($this->current_container_setting)
 
  298                                                $this->group_obj->getId(), 
 
  299                                                $this->current_container_setting, 
 
  304                        case 'WaitingListAutoFill':
 
  305                                $this->group_data[
'auto_wait'] = trim($this->cdata);                            
 
  308                        case 'CancellationEnd':
 
  309                                if((
int)$this->cdata)
 
  316                                if((
int)$this->cdata)
 
  318                                        $this->group_data[
'min_members'] = (int)$this->cdata;                                                           
 
  335                $a_data = str_replace(
"<",
"<",$a_data);
 
  336                $a_data = str_replace(
">",
">",$a_data);
 
  340                        $this->cdata .= $a_data;
 
  347                if($this->group_imported)
 
  354                $this->group_obj->setImportId($this->group_data[
"id"]);
 
  355                $this->group_obj->setTitle($this->group_data[
"title"]);
 
  356                $this->group_obj->setDescription($this->group_data[
"description"]);
 
  358                $ownerChanged = 
false;
 
  359                if (isset($this->group_data[
"owner"])) 
 
  361                        $owner = $this->group_data[
"owner"];
 
  362                        if (!is_numeric($owner)) 
 
  366                        if (is_numeric($owner) && $owner > 0) 
 
  368                                $this->group_obj->setOwner($owner);
 
  369                                $ownerChanged = 
true;
 
  378                        $this->group_obj->create();
 
  379                        $this->group_obj->createReference();
 
  386                        switch($this->group_data[
'type'])
 
  398                        $this->group_obj->updateOwner();
 
  399                        if($this->group_obj->getGroupStatus() != $grp_status)
 
  401                                $this->group_obj->setGroupType($grp_status);
 
  402                                $this->group_obj->updateGroupType();
 
  407                switch($this->group_data[
'registration_type'])
 
  429                $this->group_obj->setRegistrationType($flag);
 
  432                if($this->group_data[
'expiration_end'])
 
  438                if($this->group_data[
'expiration_start'])
 
  443                $this->group_obj->setRegistrationStart($start);
 
  444                $this->group_obj->setRegistrationEnd($end);
 
  445                $this->group_obj->setPassword($this->group_data[
'password']);
 
  446                $this->group_obj->enableUnlimitedRegistration(!isset($this->group_data[
'expiration_end']));
 
  447                $this->group_obj->enableMembershipLimitation($this->group_data[
'max_members_enabled']);
 
  448                $this->group_obj->setMaxMembers($this->group_data[
'max_members'] ? $this->group_data[
'max_members'] : 0);
 
  449                $this->group_obj->enableWaitingList($this->group_data[
'waiting_list_enabled']);
 
  451                $this->group_obj->setWaitingListAutoFill($this->group_data[
'auto_wait']);
 
  452                $this->group_obj->setCancellationEnd($this->group_data[
'cancel_end']);
 
  453                $this->group_obj->setMinMembers($this->group_data[
'min_members']);              
 
  457                        $this->group_obj->initGroupStatus($this->group_data[
"type"] == 
"open" ? 0 : 1);
 
  460                $this->group_obj->update();
 
  472                $this->group_imported = 
true;
 
  481                $this->folder_obj->setTitle($this->folder);
 
  482                $this->folder_obj->create();
 
  483                $this->folder_obj->createReference();
 
  497                $this->file_obj->setType(
"file");
 
  498                $this->file_obj->setTitle($this->file[
"fileName"]);
 
  499                $this->file_obj->setFileName($this->file[
"fileName"]);
 
  500                $this->file_obj->create();
 
  501                $this->file_obj->createReference();
 
  506                $this->file_obj->createDirectory();
 
  510                if($this->import_file_obj->findObjectFile($this->file[
"id"]))
 
  512                        $this->file_obj->copy($this->import_file_obj->getObjectFile(),$this->file[
"fileName"]);
 
  515                unset($this->file_obj);
 
  516                unset($this->import_file_obj);
 
  527                $this->participants->updateNotification(
$ilUser->getId(),
$ilSetting->get(
'mail_grp_admin_notification', 
true));
 
  530                if (count($this->group_data[
"admin"][
"attach"]))
 
  532                        foreach($this->group_data[
"admin"][
"attach"] as $user)
 
  536                                        if($id_data[
'local'] or $id_data[
'imported'])
 
  538                                                $this->participants->add($id_data[
'usr_id'],
IL_GRP_ADMIN);
 
  539                                                if(in_array($user,(array) $this->group_data[
'notifications']))
 
  541                                                        $this->participants->updateNotification($id_data[
'usr_id'],
true);
 
  548                if (count($this->group_data[
"admin"][
"detach"]))
 
  550                        foreach($this->group_data[
"admin"][
"detach"] as $user)
 
  554                                        if($id_data[
'local'] or $id_data[
'imported'])
 
  556                                                if($this->participants->isAssigned($id_data[
'usr_id']))
 
  558                                                        $this->participants->delete($id_data[
'usr_id']);
 
  565                if (count($this->group_data[
"member"][
"attach"]))
 
  567                        foreach($this->group_data[
"member"][
"attach"] as $user)
 
  571                                        if($id_data[
'local'] or $id_data[
'imported'])
 
  579                if (count($this->group_data[
"member"][
"detach"]))
 
  581                        foreach($this->group_data[
"member"][
"detach"] as $user)
 
  585                                        if($id_data[
'local'] or $id_data[
'imported'])
 
  587                                                if($this->participants->isAssigned($id_data[
'usr_id']))
 
  589                                                        $this->participants->delete($id_data[
'usr_id']);
 
  600                include_once 
"./Modules/Group/classes/class.ilObjGroup.php";
 
  614                include_once 
"./Modules/Folder/classes/class.ilObjFolder.php";
 
  623                include_once 
"./Modules/Group/classes/class.ilFileDataImportGroup.php";
 
  632                include_once 
"./Modules/File/classes/class.ilObjFile.php";
 
  641                unset($this->folder_obj);
 
  648                $fields = explode(
'_',$a_id);
 
  650                if(!is_array($fields) or
 
  651                   $fields[0] != 
'il' or
 
  652                   !is_numeric($fields[1]) or
 
  653                   $fields[2] != 
'usr' or
 
  654                   !is_numeric($fields[3]))
 
  660                        return array(
'imported' => 
true,
 
  666                        if(strlen($user[
'login']))
 
  668                                return array(
'imported' => 
false,
 
  670                                                         'usr_id' => $fields[3]);
 
  673                $GLOBALS[
'ilLog']->write(__METHOD__.
' Parsing id failed: '.$a_id);
 
  688                include_once 
'./Services/Container/classes/class.ilContainerSortingSettings.php';
 
const GRP_REGISTRATION_DIRECT
const GRP_REGISTRATION_PASSWORD
const GRP_REGISTRATION_DEACTIVATED
const GRP_REGISTRATION_REQUEST
static _importContainerSortingSettings($attibs, $obj_id)
sorting import for all container objects
_writeContainerSetting($a_id, $a_keyword, $a_value)
@classDescription Date and time handling
This class handles all operations on files for the exercise object.
ilGroupXMLParser($a_xml, $a_parent_id)
Constructor.
$current_container_setting
setHandlers($a_xml_parser)
set event handler should be overwritten by inherited class @access private
handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
handler for begin of element
handlerCharacterData($a_xml_parser, $a_data)
handler for character data
__initContainerSorting($a_attribs, $a_group_id)
startParsing()
start the parser
handlerEndTag($a_xml_parser, $a_name)
static _lookupName($a_user_id)
lookup user name
_getImportedUserId($i2_id)
Base class for sax-based expat parsing extended classes need to overwrite the method setHandlers and ...
setXMLContent($a_xml_content)
static __extractId($ilias_id, $inst_id)
extract ref id from role title, e.g.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.