/**
	 * Download specific revision
	 *
	 * @param void
	 * @return null
	 */
	function download_revision() {
		$inline = (boolean) array_var($_GET, 'inline', false);
		$revision = ProjectFileRevisions::findById(get_id());
		if(!($revision instanceof ProjectFileRevision)) {
			flash_error(lang('file revision dnx'));
			ajx_current("empty");
			return;
		} // if
			
		$file = $revision->getFile();
		if(!($file instanceof ProjectFile)) {
			flash_error(lang('file dnx'));
			ajx_current("empty");
			return;
		} // if
			
		if(!($file->canDownload(logged_user()))) {
			flash_error(lang('no access permissions'));
			ajx_current("empty");
			return;
		} // if
		session_commit();
		download_from_repository($revision->getRepositoryId(),$revision->getTypeString(), $file->getFilename(), !$inline);
		die();
	} // download_revision
 function download()
 {
     $this->setTemplate(get_template_path('back'));
     $id = array_var($_GET, 'id');
     $email = MailContents::findById($id);
     if (!$email instanceof MailContent) {
         flash_error(lang('email dnx'));
         return;
     }
     if (!$email->canView(logged_user())) {
         flash_error(lang('no access permissions'));
         return;
     }
     if ($email->getContent()) {
         download_contents($email->getContent(), 'message/rfc822', $email->getSubject() . ".eml", strlen($email->getContent()), true);
         die;
     } else {
         download_from_repository($email->getContentFileId(), 'message/rfc822', $email->getSubject() . ".eml", true);
         die;
     }
 }