/** * Download a file. * @param $args array * @param $request Request */ function downloadFile($args, &$request) { // FIXME: authorize! $fileId = (int) $request->getUserVar('fileId'); $revision = (int) $request->getUserVar('fileRevision'); $monograph =& $this->getMonograph(); import('classes.file.MonographFileManager'); MonographFileManager::downloadFile($monograph->getId(), $fileId, $revision ? $revision : null); }
/** * Download the monograph file * @param $args array * @param $request PKPRequest * @return string Serialized JSON object */ function downloadFile($args, &$request) { $monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH); $fileId = (int) $request->getUserVar('fileId'); assert(!empty($fileId)); import('classes.file.MonographFileManager'); MonographFileManager::downloadFile($monograph->getId(), $fileId); }
/** * Download the monograph file * @param $args array * @param $request PKPRequest * @return string Serialized JSON object */ function downloadFile($args, &$request) { $monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH); $fileId = (int) $request->getUserVar('fileId'); assert(!empty($fileId)); $sessionManager =& SessionManager::getManager(); $session =& $sessionManager->getUserSession(); $user =& $session->getUser(); $viewsDao =& DAORegistry::getDAO('ViewsDAO'); $viewsDao->recordView(ASSOC_TYPE_MONOGRAPH_FILE, $fileId, $user->getId()); import('classes.file.MonographFileManager'); MonographFileManager::downloadFile($monograph->getId(), $fileId); }
/** * Download the monograph file * @param $args array * @param $request PKPRequest * @return string Serialized JSON object */ function downloadFile($args, &$request) { $monographId = $request->getUserVar('monographId'); $fileId = $request->getUserVar('fileId'); import('classes.file.MonographFileManager'); MonographFileManager::downloadFile($monographId, $fileId); }
/** * View a file inline (variant of downloadFile). * @param $monographId integer * @param $fileId integer * @param $revision integer * @see MonographFileManager::downloadFile */ function viewFile($monographId, $fileId, $revision = null) { MonographFileManager::downloadFile($monographId, $fileId, $revision, true); }
/** * Download the monograph file * @param $args array * @param $request PKPRequest */ function downloadFile($args, &$request) { // Download the file. $monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH); /* @var $monograph Monograph */ $fileId = $request->getUserVar('fileId'); import('classes.file.MonographFileManager'); MonographFileManager::downloadFile($monograph->getId(), $fileId); // NB: This will check the validity of the file id. }
/** * Download the monograph file * @param $args array * @param $request PKPRequest * @return string Serialized JSON object */ function downloadFile($args, &$request) { $monographId = $request->getUserVar('monographId'); $fileId = $request->getUserVar('fileId'); $sessionManager =& SessionManager::getManager(); $session =& $sessionManager->getUserSession(); $user =& $session->getUser(); import('classes.file.MonographFileManager'); MonographFileManager::downloadFile($monographId, $fileId); }
/** * Download a file * @param $args array * @param $request Request */ function downloadFile($args, &$request) { $monographId = (int) $request->getUserVar('monographId'); $fileId = (int) $request->getUserVar('fileId'); $revision = (int) $request->getUserVar('fileRevision'); import('classes.file.MonographFileManager'); MonographFileManager::downloadFile($monographId, $fileId, $revision ? $revision : null); }