/** * provide file as a download */ public function sendFile() { global $ilAccess, $tpl, $lng; if ($ilAccess->checkAccess('read', "", $this->object->getRefId())) { $file_path = $this->bibl_obj->getFileAbsolutePath(); if ($file_path) { if (is_file($file_path)) { $path_array = explode(DIRECTORY_SEPARATOR, $file_path); $filename = $path_array[sizeof($path_array) - 1]; ilUtil::deliverFile($file_path, $filename); } else { ilUtil::sendFailure($lng->txt("file_not_found")); $this->showContent($this->bibl_obj); } } } else { ilUtil::sendFailure($this->lng->txt("no_permission"), true); ilObjectGUI::_gotoRepositoryRoot(); } }
/** * Attention only use this for objects who have not yet been created (use like: $x = new ilObjDataCollection; $x->cloneStructure($id)) * @param $original_id The original ID of the dataselection you want to clone it's structure * @return void */ public function cloneStructure($original_id) { $original = new ilObjBibliographic($original_id); $this->moveFile($original->getFileAbsolutePath()); $this->setOnline($original->getOnline()); $this->setDescription($original->getDescription()); $this->setTitle($original->getTitle()); $this->setType($original->getType()); $this->doUpdate(); $this->writeSourcefileEntriesToDb(); }
/** * * @param int $a_id */ public function exportLibraryFile($a_id) { $obj = new ilObjBibliographic($a_id); copy($obj->getFileAbsolutePath(), $this->absolute_export_dir . "/" . $obj->getFilename()); }