Exemplo n.º 1
0
 /**
  * handler for begin of element
  *
  * @param	resource	$a_xml_parser		xml parser
  * @param	string		$a_name				element name
  * @param	array		$a_attribs			element attributes array
  */
 public function handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
 {
     global $ilErr;
     switch ($a_name) {
         case 'Folder':
             break;
         case 'Sorting':
         case 'Sort':
             include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
             ilContainerSortingSettings::_importContainerSortingSettings($a_attribs, $this->getFolder()->getId());
             break;
         case 'Title':
         case 'Description':
             break;
     }
 }
Exemplo n.º 2
0
 function __initContainerSorting($a_attribs, $a_group_id)
 {
     include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
     ilContainerSortingSettings::_importContainerSortingSettings($a_attribs, $a_group_id);
 }
Exemplo n.º 3
0
 /**
  * handler for begin of element
  *
  * @param	resource	$a_xml_parser		xml parser
  * @param	string		$a_name				element name
  * @param	array		$a_attribs			element attributes array
  */
 function handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
 {
     if ($this->in_meta_data) {
         parent::handlerBeginTag($a_xml_parser, $a_name, $a_attribs);
         return;
     }
     switch ($a_name) {
         case 'Course':
             if (strlen($a_attribs['importId'])) {
                 $this->log->write("CourseXMLParser: importId = " . $a_attribs['importId']);
                 $this->course_obj->setImportId($a_attribs['importId']);
                 ilObject::_writeImportId($this->course_obj->getId(), $a_attribs['importId']);
             }
             if (strlen($a_attribs['showMembers'])) {
                 $this->course_obj->setShowMembers($a_attribs['showMembers'] == 'Yes' ? true : false);
             }
             break;
         case 'Admin':
             if ($id_data = $this->__parseId($a_attribs['id'])) {
                 if ($id_data['local'] or $id_data['imported']) {
                     $this->handleAdmin($a_attribs, $id_data);
                 }
             }
             break;
         case 'Tutor':
             if ($id_data = $this->__parseId($a_attribs['id'])) {
                 if ($id_data['local'] or $id_data['imported']) {
                     $this->handleTutor($a_attribs, $id_data);
                 }
             }
             break;
         case 'Member':
             if ($id_data = $this->__parseId($a_attribs['id'])) {
                 if ($id_data['local'] or $id_data['imported']) {
                     $this->handleMember($a_attribs, $id_data);
                 }
             }
             break;
         case 'Subscriber':
             if ($id_data = $this->__parseId($a_attribs['id'])) {
                 if ($id_data['local'] or $id_data['imported']) {
                     $this->handleSubscriber($a_attribs, $id_data);
                 }
             }
             break;
         case 'WaitingList':
             if ($id_data = $this->__parseId($a_attribs['id'])) {
                 if ($id_data['local'] or $id_data['imported']) {
                     $this->handleWaitingList($a_attribs, $id_data);
                 }
             }
             break;
         case 'Owner':
             if ($id_data = $this->__parseId($a_attribs['id'])) {
                 if ($id_data['local'] or $id_data['imported']) {
                     $this->course_obj->setOwner($id_data['usr_id']);
                     $this->course_obj->updateOwner();
                 }
             }
             break;
         case 'Settings':
             $this->in_settings = true;
             break;
         case 'Availability':
             $this->in_availability = true;
             break;
         case 'NotAvailable':
             if ($this->in_availability) {
                 $this->course_obj->setActivationType(IL_CRS_ACTIVATION_OFFLINE);
             } elseif ($this->in_registration) {
                 $this->course_obj->setSubscriptionLimitationType(IL_CRS_SUBSCRIPTION_DEACTIVATED);
             }
             break;
         case 'Unlimited':
             if ($this->in_availability) {
                 $this->course_obj->setOfflineStatus(false);
                 $this->course_obj->setActivationType(IL_CRS_ACTIVATION_UNLIMITED);
             } elseif ($this->in_registration) {
                 $this->course_obj->setSubscriptionLimitationType(IL_CRS_SUBSCRIPTION_UNLIMITED);
             }
             break;
         case 'TemporarilyAvailable':
             if ($this->in_availability) {
                 $this->course_obj->setOfflineStatus(false);
                 $this->course_obj->setActivationType(IL_CRS_ACTIVATION_LIMITED);
             } elseif ($this->in_registration) {
                 $this->course_obj->setSubscriptionLimitationType(IL_CRS_SUBSCRIPTION_LIMITED);
             }
             break;
         case 'Start':
             break;
         case 'End':
             break;
         case 'Syllabus':
             break;
         case 'Contact':
             break;
         case 'Name':
         case 'Responsibility':
         case 'Phone':
         case 'Email':
         case 'Consultation':
             break;
         case 'Registration':
             $this->in_registration = true;
             switch ($a_attribs['registrationType']) {
                 case 'Confirmation':
                     $this->course_obj->setSubscriptionType(IL_CRS_SUBSCRIPTION_CONFIRMATION);
                     break;
                 case 'Direct':
                     $this->course_obj->setSubscriptionType(IL_CRS_SUBSCRIPTION_DIRECT);
                     break;
                 case 'Password':
                     $this->course_obj->setSubscriptionType(IL_CRS_SUBSCRIPTION_PASSWORD);
                     break;
             }
             $this->course_obj->setSubscriptionMaxMembers((int) $a_attribs['maxMembers']);
             $this->course_obj->enableSubscriptionMembershipLimitation($this->course_obj->getSubscriptionMaxMembers() > 0);
             $this->course_obj->setSubscriptionNotify($a_attribs['notification'] == 'Yes' ? true : false);
             $this->course_obj->enableWaitingList($a_attribs['waitingList'] == 'Yes' ? true : false);
             break;
         case 'Sort':
             include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
             ilContainerSortingSettings::_importContainerSortingSettings($a_attribs, $this->course_obj->getId());
             break;
         case 'Archive':
             $this->in_archive = true;
             switch ($a_attribs['Access']) {
                 case 'Disabled':
                     $this->course_obj->setArchiveType(IL_CRS_ARCHIVE_NONE);
                     break;
                 case 'Read':
                     $this->course_obj->setArchiveType(IL_CRS_ARCHIVE_NONE);
                     #$this->course_obj->setViewMode(IL_CRS_VIEW_ARCHIVE);
                     break;
                 case 'Download':
                     #$this->course_obj->setViewMode(IL_CRS_VIEW_ARCHIVE);
                     $this->course_obj->setArchiveType(IL_CRS_ARCHIVE_DOWNLOAD);
                     break;
             }
             break;
         case 'Disabled':
             $this->course_obj->getSubscriptionLimitationType(IL_CRS_SUBSCRIPTION_DEACTIVATED);
             break;
         case "MetaData":
             $this->in_meta_data = true;
             parent::handlerBeginTag($a_xml_parser, $a_name, $a_attribs);
             break;
         case 'ContainerSetting':
             $this->current_container_setting = $a_attribs['id'];
             break;
     }
 }
Exemplo n.º 4
0
 /**
  * handler for begin of element
  */
 function handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
 {
     global $ilErr;
     switch ($a_name) {
         // GROUP DATA
         case "group":
             #if($a_attribs["exportVersion"] < EXPORT_VERSION)
             #{
             #	$ilErr->raiseError("!!! This export Version isn't supported, update your ILIAS 2 installation"
             #					   ,$ilErr->WARNING);
             #}
             // DEFAULT
             $this->group_data["admin"] = array();
             $this->group_data["member"] = array();
             $this->group_data["type"] = $a_attribs["type"];
             $this->group_data["id"] = $a_attribs["id"];
             break;
         case 'title':
             break;
         case "owner":
             $this->group_data["owner"] = $a_attribs["id"];
             break;
         case 'registration':
             $this->group_data['registration_type'] = $a_attribs['type'];
             $this->group_data['waiting_list_enabled'] = $a_attribs['waitingList'] == 'Yes' ? true : false;
             break;
         case 'maxMembers':
             $this->group_data['max_members_enabled'] = $a_attribs['enabled'] == 'Yes' ? true : false;
             break;
         case "admin":
             if (!isset($a_attribs['action']) || $a_attribs['action'] == "Attach") {
                 $this->group_data["admin"]["attach"][] = $a_attribs["id"];
             } elseif (isset($a_attribs['action']) || $a_attribs['action'] == "Detach") {
                 $this->group_data["admin"]["detach"][] = $a_attribs["id"];
             }
             if (isset($a_attribs['notification']) and $a_attribs['notification'] == 'Yes') {
                 $this->group_data['notifications'][] = $a_attribs['id'];
             }
             break;
         case "member":
             if (!isset($a_attribs['action']) || $a_attribs['action'] == "Attach") {
                 $GLOBALS['ilLog']->write(__METHOD__ . ': new member with id ' . $a_attribs['id']);
                 $this->group_data["member"]["attach"][] = $a_attribs["id"];
             } elseif (isset($a_attribs['action']) || $a_attribs['action'] == "Detach") {
                 $GLOBALS['ilLog']->write(__METHOD__ . ': deprecated member with id ' . $a_attribs['id']);
                 $this->group_data["member"]["detach"][] = $a_attribs["id"];
             }
             break;
         case "folder":
             // NOW SAVE THE NEW OBJECT (if it hasn't been imported)
             $this->__save();
             break;
         case "file":
             // NOW SAVE THE NEW OBJECT (if it hasn't been imported)
             $this->__save();
             $this->file["fileName"] = $a_attribs["fileName"];
             $this->file["id"] = $a_attribs["id"];
             // SAVE IT
             $this->__saveFile();
             break;
         case 'ContainerSetting':
             $this->current_container_setting = $a_attribs['id'];
             break;
         case 'Sort':
             // NOW SAVE THE NEW OBJECT (if it hasn't been imported)
             $this->__save();
             include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
             ilContainerSortingSettings::_importContainerSortingSettings($a_attribs, $this->group_obj->getId());
             break;
     }
 }
 /**
  * handler for begin of element
  */
 public function handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
 {
     global $ilErr;
     switch ($a_name) {
         case "Category":
             break;
         case 'Translations':
             $this->getCategory()->removeTranslations();
             break;
         case 'Translation':
             $this->current_translation = array();
             $this->current_translation['default'] = $a_attribs['default'] ? 1 : 0;
             $this->current_translation['lang'] = $a_attribs['language'];
             break;
         case 'Sorting':
         case 'Sort':
             include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
             ilContainerSortingSettings::_importContainerSortingSettings($a_attribs, $this->getCategory()->getId());
             break;
         case 'ContainerSetting':
             $this->current_container_setting = $a_attribs['id'];
             break;
     }
 }