本文整理汇总了PHP中PKPRequest::redirectUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP PKPRequest::redirectUrl方法的具体用法?PHP PKPRequest::redirectUrl怎么用?PHP PKPRequest::redirectUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PKPRequest
的用法示例。
在下文中一共展示了PKPRequest::redirectUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: signOut
/**
* Log a user out.
*/
function signOut()
{
$this->validate();
$this->setupTemplate();
if (Validation::isLoggedIn()) {
Validation::logout();
}
$source = Request::getUserVar('source');
if (isset($source) && !empty($source)) {
PKPRequest::redirectUrl(Request::getProtocol() . '://' . Request::getServerHost() . $source, false);
} else {
PKPRequest::redirect(null, Request::getRequestedPage());
}
}
示例2: download
/**
* Download an article file
* @param array $args
* @param PKPRequest $request
*/
function download($args, $request)
{
$articleId = isset($args[0]) ? $args[0] : 0;
$galleyId = isset($args[1]) ? $args[1] : 0;
$fileId = isset($args[2]) ? (int) $args[2] : 0;
if ($this->galley->getRemoteURL()) {
$request->redirectUrl($this->galley->getRemoteURL());
}
if ($this->userCanViewGalley($request, $articleId, $galleyId)) {
if (!$fileId) {
$submissionFile = $this->galley->getFile();
if ($submissionFile) {
$fileId = $submissionFile->getFileId();
// The file manager expects the real article id. Extract it from the submission file.
$articleId = $submissionFile->getSubmissionId();
} else {
// no proof files assigned to this galley!
return null;
}
}
if (!HookRegistry::call('ArticleHandler::download', array($this->article, &$this->galley, &$fileId))) {
import('lib.pkp.classes.file.SubmissionFileManager');
$submissionFileManager = new SubmissionFileManager($this->article->getContextId(), $this->article->getId());
$submissionFileManager->downloadFile($fileId, null, $request->getUserVar('inline') ? true : false);
}
}
}