本文整理汇总了PHP中Request::getRequestedPage方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::getRequestedPage方法的具体用法?PHP Request::getRequestedPage怎么用?PHP Request::getRequestedPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Request
的用法示例。
在下文中一共展示了Request::getRequestedPage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getContents
/**
* Get the HTML contents for this block.
* @param $templateMgr object
* @return $string
*/
function getContents(&$templateMgr)
{
$journal =& Request::getJournal();
$cacheManager =& CacheManager::getManager();
$cache =& $cacheManager->getFileCache('keywords_' . AppLocale::getLocale(), $journal->getId(), array(&$this, '_cacheMiss'));
// If the cache is older than a couple of days, regenerate it
if (time() - $cache->getCacheTime() > 60 * 60 * 24 * KEYWORD_BLOCK_CACHE_DAYS) {
$cache->flush();
}
$keywords =& $cache->getContents();
if (empty($keywords)) {
return '';
}
// Get the max occurrences for all keywords
$maxOccurs = array_shift(array_values($keywords));
// Now sort the array alphabetically
ksort($keywords);
$page = Request::getRequestedPage();
$op = Request::getRequestedOp();
$templateMgr->assign_by_ref('cloudKeywords', $keywords);
$templateMgr->assign_by_ref('maxOccurs', $maxOccurs);
if ($page == 'index' && $op == 'index' || $page == 'issue' || $page == 'search') {
return parent::getContents($templateMgr);
} else {
return '';
}
}
示例2: saveSettings
function saveSettings()
{
RTAdminHandler::validate();
// Bring in the comments constants.
$commentDao =& DAORegistry::getDao('CommentDAO');
$journal = Request::getJournal();
if ($journal) {
$rtDao =& DAORegistry::getDAO('RTDAO');
$rt = $rtDao->getJournalRTByJournal($journal);
if (Request::getUserVar('version') == '') {
$rt->setVersion(null);
} else {
$rt->setVersion(Request::getUserVar('version'));
}
$rt->setEnabled(Request::getUserVar('enabled') == true);
$rt->setAbstract(Request::getUserVar('abstract') == true);
$rt->setCaptureCite(Request::getUserVar('captureCite') == true);
$rt->setViewMetadata(Request::getUserVar('viewMetadata') == true);
$rt->setSupplementaryFiles(Request::getUserVar('supplementaryFiles') == true);
$rt->setPrinterFriendly(Request::getUserVar('printerFriendly') == true);
$rt->setAuthorBio(Request::getUserVar('authorBio') == true);
$rt->setDefineTerms(Request::getUserVar('defineTerms') == true);
$rt->setEmailAuthor(Request::getUserVar('emailAuthor') == true);
$rt->setEmailOthers(Request::getUserVar('emailOthers') == true);
$rt->setFindingReferences(Request::getUserVar('findingReferences') == true);
$journal->updateSetting('enableComments', Request::getUserVar('enableComments') ? Request::getUserVar('enableCommentsMode') : COMMENTS_DISABLED);
$rtDao->updateJournalRT($rt);
}
Request::redirect(null, Request::getRequestedPage());
}
示例3: signInAsUser
/**
* Sign in as another user.
* @param $args array ($userId)
*/
function signInAsUser($args)
{
$this->addCheck(new HandlerValidatorConference($this));
$this->addCheck(new HandlerValidatorRoles($this, true, null, null, array(ROLE_ID_SITE_ADMIN, ROLE_ID_CONFERENCE_MANAGER)));
$this->validate();
if (isset($args[0]) && !empty($args[0])) {
$userId = (int) $args[0];
$conference =& Request::getConference();
if (!Validation::canAdminister($conference->getId(), $userId)) {
$this->setupTemplate();
// We don't have administrative rights
// over this user. Display an error.
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('pageTitle', 'manager.people');
$templateMgr->assign('errorMsg', 'manager.people.noAdministrativeRights');
$templateMgr->assign('backLink', Request::url(null, null, null, 'people', 'all'));
$templateMgr->assign('backLinkLabel', 'manager.people.allUsers');
return $templateMgr->display('common/error.tpl');
}
$userDao =& DAORegistry::getDAO('UserDAO');
$newUser =& $userDao->getUser($userId);
$session =& Request::getSession();
// FIXME Support "stack" of signed-in-as user IDs?
if (isset($newUser) && $session->getUserId() != $newUser->getId()) {
$session->setSessionVar('signedInAs', $session->getUserId());
$session->setSessionVar('userId', $userId);
$session->setUserId($userId);
$session->setSessionVar('username', $newUser->getUsername());
Request::redirect(null, null, 'user');
}
}
Request::redirect(null, null, Request::getRequestedPage());
}
示例4: display
/**
* Display the form.
*/
function display()
{
$journal =& Request::getJournal();
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('enablePublicSuppFileId', $journal->getSetting('enablePublicSuppFileId'));
$templateMgr->assign('rolePath', Request::getRequestedPage());
$templateMgr->assign('articleId', $this->article->getId());
$templateMgr->assign('suppFileId', $this->suppFileId);
$typeOptionsOutput = array('author.submit.suppFile.researchInstrument', 'author.submit.suppFile.researchMaterials', 'author.submit.suppFile.researchResults', 'author.submit.suppFile.transcripts', 'author.submit.suppFile.dataAnalysis', 'author.submit.suppFile.dataSet', 'author.submit.suppFile.sourceText');
$typeOptionsValues = $typeOptionsOutput;
array_push($typeOptionsOutput, 'common.other');
array_push($typeOptionsValues, '');
$templateMgr->assign('typeOptionsOutput', $typeOptionsOutput);
$templateMgr->assign('typeOptionsValues', $typeOptionsValues);
// Sometimes it's necessary to track the page we came from in
// order to redirect back to the right place
$templateMgr->assign('from', Request::getUserVar('from'));
if (isset($this->article)) {
$templateMgr->assign('submissionProgress', $this->article->getSubmissionProgress());
}
if (isset($this->suppFile)) {
$templateMgr->assign_by_ref('suppFile', $this->suppFile);
}
$templateMgr->assign('helpTopicId', 'submission.supplementaryFiles');
// consider public identifiers
$pubIdPlugins =& PluginRegistry::loadCategory('pubIds', true);
$templateMgr->assign('pubIdPlugins', $pubIdPlugins);
AppLocale::requireComponents(LOCALE_COMPONENT_OJS_AUTHOR);
parent::display();
}
示例5: saveProgramSettings
/**
* Save changes to program settings.
*/
function saveProgramSettings()
{
$this->validate();
$this->setupTemplate(true);
$schedConf =& Request::getSchedConf();
if (!$schedConf) {
Request::redirect(null, null, 'index');
}
import('classes.manager.form.ProgramSettingsForm');
$settingsForm = new ProgramSettingsForm();
$settingsForm->readInputData();
$formLocale = $settingsForm->getFormLocale();
$programTitle = Request::getUserVar('programFileTitle');
$editData = false;
if (Request::getUserVar('uploadProgramFile')) {
if (!$settingsForm->uploadProgram('programFile', $formLocale)) {
$settingsForm->addError('programFile', Locale::translate('common.uploadFailed'));
}
$editData = true;
} elseif (Request::getUserVar('deleteProgramFile')) {
$settingsForm->deleteProgram('programFile', $formLocale);
$editData = true;
}
if (!$editData && $settingsForm->validate()) {
$settingsForm->execute();
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign(array('currentUrl' => Request::url(null, null, null, 'program'), 'pageTitle' => 'schedConf.program', 'message' => 'common.changesSaved', 'backLink' => Request::url(null, null, Request::getRequestedPage()), 'backLinkLabel' => 'manager.conferenceSiteManagement'));
$templateMgr->display('common/message.tpl');
} else {
$settingsForm->display();
}
}
示例6: displayCallback
/**
* Hook callback function for TemplateManager::display
* @param $hookName string
* @param $args array
* @return boolean
*/
function displayCallback($hookName, $args)
{
// Only pages can receive scripts
$request =& Registry::get('request');
if (!is_a($request->getRouter(), 'PKPPageRouter')) {
return null;
}
$page = Request::getRequestedPage();
$op = Request::getRequestedOp();
$scripts = JQueryPlugin::getEnabledScripts($page, $op);
if (empty($scripts)) {
return null;
}
$templateManager =& $args[0];
$additionalHeadData = $templateManager->get_template_vars('additionalHeadData');
$baseUrl = $templateManager->get_template_vars('baseUrl');
if (Config::getVar('general', 'enable_cdn')) {
$jQueryScript = '<script src="http://www.google.com/jsapi"></script>
<script>
google.load("jquery", "1");
google.load("jqueryui", "1");
</script>';
} else {
$jQueryScript = '<script type="text/javascript" src="' . Request::getBaseUrl() . '/lib/pkp/js/lib/jquery/jquery.min.js"></script>
<script type="text/javascript" src="' . Request::getBaseUrl() . '/lib/pkp/js/lib/jquery/plugins/jqueryUi.min.js"></script>';
}
$jQueryScript .= "\n" . JQueryPlugin::addScripts($baseUrl, $scripts);
$templateManager->assign('additionalHeadData', $additionalHeadData . "\n" . $jQueryScript);
}
示例7: display
/**
* Display the form.
*/
function display()
{
$journal =& Request::getJournal();
$reviewFormDao =& DAORegistry::getDAO('ReviewFormDAO');
$reviewForm =& $reviewFormDao->getReviewForm($this->reviewFormId, ASSOC_TYPE_JOURNAL, $journal->getId());
$reviewFormElementDao =& DAORegistry::getDAO('ReviewFormElementDAO');
$reviewFormElements =& $reviewFormElementDao->getReviewFormElements($this->reviewFormId);
$reviewFormResponseDao =& DAORegistry::getDAO('ReviewFormResponseDAO');
$reviewFormResponses =& $reviewFormResponseDao->getReviewReviewFormResponseValues($this->reviewId);
$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
$reviewAssignment = $reviewAssignmentDao->getById($this->reviewId);
$sectionDecisionDao =& DAORegistry::getDAO('SectionDecisionDAO');
$sectionDecision =& $sectionDecisionDao->getSectionDecision($reviewAssignment->getDecisionId());
$editorPreview = Request::getRequestedPage() != 'reviewer';
if (!$editorPreview) {
ReviewerHandler::setupTemplate(true, 0, $sectionDecision->getArticleId());
}
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('pageTitle', 'submission.reviewFormResponse');
$templateMgr->assign_by_ref('reviewForm', $reviewForm);
$templateMgr->assign('reviewFormElements', $reviewFormElements);
$templateMgr->assign('reviewFormResponses', $reviewFormResponses);
$templateMgr->assign('reviewId', $this->reviewId);
$templateMgr->assign('articleId', $sectionDecision->getArticleId());
$templateMgr->assign('isLocked', isset($reviewAssignment) && $reviewAssignment->getDateCompleted() != null);
$templateMgr->assign('editorPreview', $editorPreview);
parent::display();
}
示例8: display
/**
* Display the form.
*/
function display()
{
$conference =& Request::getConference();
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('enablePublicSuppFileId', $conference->getSetting('enablePublicSuppFileId'));
$templateMgr->assign('rolePath', Request::getRequestedPage());
$templateMgr->assign('paperId', $this->paper->getPaperId());
$templateMgr->assign('suppFileId', $this->suppFileId);
$typeOptionsOutput = array('author.submit.suppFile.researchInstrument', 'author.submit.suppFile.researchMaterials', 'author.submit.suppFile.researchResults', 'author.submit.suppFile.transcripts', 'author.submit.suppFile.dataAnalysis', 'author.submit.suppFile.dataSet', 'author.submit.suppFile.sourceText');
$typeOptionsValues = $typeOptionsOutput;
array_push($typeOptionsOutput, 'common.other');
array_push($typeOptionsValues, '');
$templateMgr->assign('typeOptionsOutput', $typeOptionsOutput);
$templateMgr->assign('typeOptionsValues', $typeOptionsValues);
// Sometimes it's necessary to track the page we came from in
// order to redirect back to the right place
$templateMgr->assign('from', Request::getUserVar('from'));
if (isset($this->paper)) {
$templateMgr->assign('submissionProgress', $this->paper->getSubmissionProgress());
}
if (isset($this->suppFile)) {
$templateMgr->assign_by_ref('suppFile', $this->suppFile);
}
$templateMgr->assign('helpTopicId', 'submission.supplementaryFiles');
parent::display();
}
示例9: saveSettings
function saveSettings()
{
$this->validate();
$conference = Request::getConference();
if ($conference) {
$rtDao =& DAORegistry::getDAO('RTDAO');
$rt = $rtDao->getConferenceRTByConference($conference);
if (Request::getUserVar('version') == '') {
$rt->setVersion(null);
} else {
$rt->setVersion(Request::getUserVar('version'));
}
$rt->setEnabled(Request::getUserVar('enabled') == true);
$rt->setAbstract(Request::getUserVar('abstract') == true);
$rt->setCaptureCite(Request::getUserVar('captureCite') == true);
$rt->setViewMetadata(Request::getUserVar('viewMetadata') == true);
$rt->setSupplementaryFiles(Request::getUserVar('supplementaryFiles') == true);
$rt->setPrinterFriendly(Request::getUserVar('printerFriendly') == true);
$rt->setAuthorBio(Request::getUserVar('authorBio') == true);
$rt->setDefineTerms(Request::getUserVar('defineTerms') == true);
$rt->setAddComment(Request::getUserVar('addComment') == true);
$rt->setEmailAuthor(Request::getUserVar('emailAuthor') == true);
$rt->setEmailOthers(Request::getUserVar('emailOthers') == true);
$rt->setFindingReferences(Request::getUserVar('findingReferences') == true);
$rtDao->updateConferenceRT($rt);
}
Request::redirect(null, null, Request::getRequestedPage());
}
示例10: getContents
function getContents(&$templateMgr)
{
if (Request::getRequestedPage() . '/' . Request::getRequestedOp() !== 'record/view') {
return '';
}
return parent::getContents($templateMgr);
}
示例11: validateUrls
function validateUrls($args)
{
$this->validate();
$rtDao =& DAORegistry::getDAO('RTDAO');
$conference = Request::getConference();
if (!$conference) {
Request::redirect(null, null, Request::getRequestedPage());
return;
}
$versionId = isset($args[0]) ? $args[0] : 0;
$conferenceId = $conference->getId();
$version = $rtDao->getVersion($versionId, $conferenceId);
if ($version) {
// Validate the URLs for a single version
$versions = array(&$version);
import('core.ArrayItemIterator');
$versions = new ArrayItemIterator($versions, 1, 1);
} else {
// Validate all URLs for this conference
$versions = $rtDao->getVersions($conferenceId);
}
$this->setupTemplate(true, $version);
$templateMgr =& TemplateManager::getManager();
$templateMgr->register_modifier('validate_url', 'smarty_rtadmin_validate_url');
$templateMgr->assign_by_ref('versions', $versions);
$templateMgr->assign('helpTopicId', 'conference.generalManagement.readingTools');
$templateMgr->display('rtadmin/validate.tpl');
}
示例12: handleRequest
/**
* Handle a new request.
*/
function handleRequest()
{
if (!Config::getVar('general', 'installed') && pageRequiresInstall()) {
// Redirect to installer if application has not been installed
Request::redirect(null, 'install');
}
// Determine the handler for this request
$page = Request::getRequestedPage();
$op = Request::getRequestedOp();
$sourceFile = sprintf('pages/%s/index.php', $page);
// If a hook has been registered to handle this page, give it the
// opportunity to load required resources and set HANDLER_CLASS.
if (!HookRegistry::call('LoadHandler', array(&$page, &$op, &$sourceFile))) {
if (file_exists($sourceFile)) {
require $sourceFile;
} else {
require 'pages/index/index.php';
}
}
if (!defined('SESSION_DISABLE_INIT')) {
// Initialize session
$sessionManager =& SessionManager::getManager();
$session =& $sessionManager->getUserSession();
}
$methods = array_map('strtolower', get_class_methods(HANDLER_CLASS));
if (in_array(strtolower($op), $methods)) {
// Call a specific operation
call_user_func(array(HANDLER_CLASS, $op), Request::getRequestedArgs());
} else {
// Call the selected handler's index operation
call_user_func(array(HANDLER_CLASS, 'index'), Request::getRequestedArgs());
}
}
示例13: display
/**
* Display the form.
*/
function display()
{
$conference =& Request::getConference();
$reviewFormDao =& DAORegistry::getDAO('ReviewFormDAO');
$reviewForm =& $reviewFormDao->getReviewForm($this->reviewFormId, $conference->getId());
$reviewFormElementDao =& DAORegistry::getDAO('ReviewFormElementDAO');
$reviewFormElements =& $reviewFormElementDao->getReviewFormElements($this->reviewFormId);
$reviewFormResponseDao =& DAORegistry::getDAO('ReviewFormResponseDAO');
$reviewFormResponses =& $reviewFormResponseDao->getReviewReviewFormResponseValues($this->reviewId);
$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
$reviewAssignment = $reviewAssignmentDao->getReviewAssignmentById($this->reviewId);
$editorPreview = Request::getRequestedPage() != 'reviewer';
if (!$editorPreview) {
ReviewerHandler::setupTemplate(true, $reviewAssignment->getPaperId(), $this->reviewId);
}
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('pageTitle', 'submission.reviewFormResponse');
$templateMgr->assign_by_ref('reviewForm', $reviewForm);
$templateMgr->assign('reviewFormElements', $reviewFormElements);
$templateMgr->assign('reviewFormResponses', $reviewFormResponses);
$templateMgr->assign('reviewId', $this->reviewId);
$templateMgr->assign('paperId', $reviewAssignment->getPaperId());
$templateMgr->assign('isLocked', isset($reviewAssignment) && $reviewAssignment->getDateCompleted() != null);
$templateMgr->assign('editorPreview', $editorPreview);
parent::display();
}
示例14: display
/**
* Display the form.
*/
function display()
{
$journal =& Request::getJournal();
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('rolePath', Request::getRequestedPage());
$templateMgr->assign('articleId', $this->article->getArticleId());
parent::display();
}
示例15: logRequestInline
/**
* Log a request for an lineable galley (e.g. text file).
*/
function logRequestInline($hookName, $args)
{
$journal =& Request::getJournal();
if (!$journal || Request::getRequestedPage() != 'article' || Request::getRequestedOp() != 'view') {
return false;
}
$counterReportDao =& DAORegistry::getDAO('CounterReportDAO');
$counterReportDao->incrementCount($journal->getJournalId(), (int) strftime('%Y'), (int) strftime('%m'), false, false);
}