/**
  * updates object entry in object_data
  *
  * @access	public
  */
 function updateObject()
 {
     if (!$this->checkPermissionBool("write")) {
         $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"), $this->ilias->error_obj->MESSAGE);
     } else {
         $form = $this->initEditForm();
         if ($form->checkInput()) {
             include_once 'Services/Container/classes/class.ilContainerSortingSettings.php';
             $settings = new ilContainerSortingSettings($this->object->getId());
             $settings->setSortMode($form->getInput("sorting"));
             $settings->update();
             // save custom icons
             if ($this->ilias->getSetting("custom_icons")) {
                 if ($form->getItemByPostVar("cont_big_icon")->getDeletionFlag()) {
                     $this->object->removeBigIcon();
                 }
                 if ($form->getItemByPostVar("cont_small_icon")->getDeletionFlag()) {
                     $this->object->removeSmallIcon();
                 }
                 if ($form->getItemByPostVar("cont_tiny_icon")->getDeletionFlag()) {
                     $this->object->removeTinyIcon();
                 }
                 $this->object->saveIcons($_FILES["cont_big_icon"]['tmp_name'], $_FILES["cont_small_icon"]['tmp_name'], $_FILES["cont_tiny_icon"]['tmp_name']);
             }
             // BEGIN ChangeEvent: Record update
             global $ilUser;
             require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
             ilChangeEvent::_recordWriteEvent($this->object->getId(), $ilUser->getId(), 'update');
             ilChangeEvent::_catchupWriteEvents($this->object->getId(), $ilUser->getId());
             // END ChangeEvent: Record update
             // Update ecs export settings
             include_once 'Modules/Category/classes/class.ilECSCategorySettings.php';
             $ecs = new ilECSCategorySettings($this->object);
             if ($ecs->handleSettingsUpdate()) {
                 return $this->afterUpdate();
             }
         }
         // display form to correct errors
         $this->setEditTabs();
         $form->setValuesByPost();
         $this->tpl->setContent($form->getHTML());
     }
 }
Ejemplo n.º 2
0
 /**
  * updates object entry in object_data
  *
  * @access	public
  */
 function updateObject()
 {
     if (!$this->checkPermissionBool("write")) {
         $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"), $this->ilias->error_obj->MESSAGE);
     } else {
         $form = $this->initEditForm();
         if ($form->checkInput()) {
             $title = $form->getInput("title");
             $desc = $form->getInput("desc");
             $lang = $this->object->getTranslations();
             $lang = $lang["Fobject"][0]["lang"];
             $this->object->deleteTranslation($lang);
             $this->object->addTranslation($title, $desc, $lang, true);
             $this->object->setTitle($title);
             $this->object->setDescription($desc);
             $this->object->update();
             $this->saveSortingSettings($form);
             // save custom icons
             /*				if ($this->ilias->getSetting("custom_icons"))
             				{
             					if($form->getItemByPostVar("cont_big_icon")->getDeletionFlag())
             					{
             						$this->object->removeBigIcon();
             					}
             					if($form->getItemByPostVar("cont_small_icon")->getDeletionFlag())
             					{
             						$this->object->removeSmallIcon();
             					}
             					if($form->getItemByPostVar("cont_tiny_icon")->getDeletionFlag())
             					{
             						$this->object->removeTinyIcon();
             					}
             
             					$this->object->saveIcons($_FILES["cont_big_icon"]['tmp_name'],
             						$_FILES["cont_small_icon"]['tmp_name'],
             						$_FILES["cont_tiny_icon"]['tmp_name']);
             				}*/
             // BEGIN ChangeEvent: Record update
             global $ilUser;
             require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
             ilChangeEvent::_recordWriteEvent($this->object->getId(), $ilUser->getId(), 'update');
             ilChangeEvent::_catchupWriteEvents($this->object->getId(), $ilUser->getId());
             // END ChangeEvent: Record update
             // services
             include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
             ilObjectServiceSettingsGUI::updateServiceSettingsForm($this->object->getId(), $form, array(ilObjectServiceSettingsGUI::INFO_TAB_VISIBILITY, ilObjectServiceSettingsGUI::NEWS_VISIBILITY, ilObjectServiceSettingsGUI::TAXONOMIES));
             // Update ecs export settings
             include_once 'Modules/Category/classes/class.ilECSCategorySettings.php';
             $ecs = new ilECSCategorySettings($this->object);
             if ($ecs->handleSettingsUpdate()) {
                 return $this->afterUpdate();
             }
         }
         // display form to correct errors
         $this->setEditTabs();
         $form->setValuesByPost();
         $this->tpl->setContent($form->getHTML());
     }
 }