/** * @param ilPropertyFormGUI $form * @param ilObjCloud $obj */ function afterSavePluginCreation(ilObjCloud &$obj, ilPropertyFormGUI $form) { if ($form->getInput(self::F_BASE_FOLDER) == self::F_DROPBOX_DEFAULT_BASE_FOLDER) { $obj->setRootFolder($obj->getTitle()); } else { $obj->setRootFolder($form->getInput(self::F_DROPBOX_CUSTOM_BASE_FOLDER_INPUT)); } if ($form->getInput(self::F_ONLINE) == "1") { $obj->setOnline(true); } $obj->doUpdate(); }
/** * @param ilObjCloud $a_new_object */ protected function afterSave(ilObjCloud $a_new_object) { try { $form = $this->initCreateForm("cld"); if ($form->checkInput()) { $a_new_object->setServiceName($form->getInput("service")); $a_new_object->setRootFolder("/"); $a_new_object->setOnline(false); $a_new_object->setAuthComplete(false); $this->plugin_service = new ilCloudPluginService($a_new_object->getServiceName(), $a_new_object->getId()); $init_gui = ilCloudConnector::getCreationGUIClass($this->plugin_service); if ($init_gui) { $init_gui->afterSavePluginCreation($a_new_object, $form); } $a_new_object->update(); $this->serviceAuth($a_new_object); } } catch (Exception $e) { ilUtil::sendFailure($e->getMessage(), true); ilObjectGUI::redirectToRefId($this->parent_id); } }