当前位置: 首页>>代码示例>>PHP>>正文


PHP Request::getPress方法代码示例

本文整理汇总了PHP中Request::getPress方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::getPress方法的具体用法?PHP Request::getPress怎么用?PHP Request::getPress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Request的用法示例。


在下文中一共展示了Request::getPress方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 /**
  * Save modified settings.
  */
 function execute()
 {
     $press =& Request::getPress();
     $settingsDao =& DAORegistry::getDAO('PressSettingsDAO');
     // Verify additional locales
     foreach (array('supportedLocales', 'supportedSubmissionLocales', 'supportedFormLocales') as $name) {
         ${$name} = array();
         foreach ($this->getData($name) as $locale) {
             if (Locale::isLocaleValid($locale) && in_array($locale, $this->availableLocales)) {
                 array_push(${$name}, $locale);
             }
         }
     }
     $primaryLocale = $this->getData('primaryLocale');
     // Make sure at least the primary locale is chosen as available
     if ($primaryLocale != null && !empty($primaryLocale)) {
         foreach (array('supportedLocales', 'supportedSubmissionLocales', 'supportedFormLocales') as $name) {
             if (!in_array($primaryLocale, ${$name})) {
                 array_push(${$name}, $primaryLocale);
             }
         }
     }
     $this->setData('supportedLocales', $supportedLocales);
     $this->setData('supportedSubmissionLocales', $supportedSubmissionLocales);
     $this->setData('supportedFormLocales', $supportedFormLocales);
     foreach ($this->_data as $name => $value) {
         if (!in_array($name, array_keys($this->settings))) {
             continue;
         }
         $settingsDao->updateSetting($press->getId(), $name, $value, $this->settings[$name]);
     }
     $pressDao =& DAORegistry::getDAO('PressDAO');
     $press->setPrimaryLocale($this->getData('primaryLocale'));
     $pressDao->updatePress($press);
 }
开发者ID:jerico-dev,项目名称:omp,代码行数:38,代码来源:LanguageSettingsForm.inc.php

示例2: initData

 /**
  * Initialize form data from current settings.
  * @param $args array
  * @param $request PKPRequest
  */
 function initData($args, &$request)
 {
     $press =& Request::getPress();
     $submissionChecklistAll = $press->getSetting('submissionChecklist');
     $checklistItem = array();
     // preparea  localizable array for this checklist Item
     foreach (Locale::getSupportedLocales() as $locale => $name) {
         $checklistItem[$locale] = null;
     }
     // if editing, set the content
     // use of 'content' as key is for backwards compatibility
     if (isset($this->submissionChecklistId)) {
         foreach (Locale::getSupportedLocales() as $locale => $name) {
             if (!isset($submissionChecklistAll[$locale][$this->submissionChecklistId]['content'])) {
                 $checklistItem[$locale] = '';
             } else {
                 $checklistItem[$locale] = $submissionChecklistAll[$locale][$this->submissionChecklistId]['content'];
             }
         }
     }
     // assign the data to the form
     $this->_data = array('checklistItem' => $checklistItem);
     // grid related data
     $this->_data['gridId'] = $args['gridId'];
     $this->_data['rowId'] = $args['rowId'];
 }
开发者ID:jerico-dev,项目名称:omp,代码行数:31,代码来源:SubmissionChecklistForm.inc.php

示例3: display

 /**
  * Display the form.
  */
 function display()
 {
     $press =& Request::getPress();
     $user =& Request::getUser();
     $submission = $this->reviewerSubmission;
     $reviewFormResponseDao =& DAORegistry::getDAO('ReviewFormResponseDAO');
     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
     $reviewAssignment = $reviewAssignmentDao->getById($submission->getReviewId());
     if ($submission->getDateConfirmed() == null) {
         $confirmedStatus = 0;
     } else {
         $confirmedStatus = 1;
     }
     $templateMgr =& TemplateManager::getManager();
     $reviewerRequestParams = array('reviewer' => $reviewAssignment->getReviewerFullName(), 'personalNote' => 'EDITOR NOTE', 'editor' => $press->getSetting('contactName'));
     $templateMgr->assign('reviewerRequest', Locale::translate('reviewer.step1.requestBoilerplate', $reviewerRequestParams));
     $templateMgr->assign_by_ref('submission', $submission);
     $templateMgr->assign_by_ref('reviewAssignment', $reviewAssignment);
     $templateMgr->assign_by_ref('press', $press);
     $templateMgr->assign_by_ref('reviewGuidelines', $press->getLocalizedSetting('reviewGuidelines'));
     $templateMgr->assign('step', 1);
     $templateMgr->assign('completedSteps', $submission->getStatus());
     $templateMgr->assign('blindReview', true);
     // FIXME: Need to be able to get/set if a review is blind or not
     // FIXME: Need press setting that denotes competing interests are required
     $templateMgr->assign('competingInterestsText', $submission->getCompetingInterests());
     import('classes.submission.reviewAssignment.ReviewAssignment');
     $templateMgr->assign_by_ref('reviewerRecommendationOptions', ReviewAssignment::getReviewerRecommendationOptions());
     $templateMgr->assign('helpTopicId', 'editorial.reviewersRole.review');
     parent::display();
 }
开发者ID:ramonsodoma,项目名称:omp,代码行数:34,代码来源:ReviewerReviewStep1Form.inc.php

示例4: SubmissionSubmitStep3Form

 /**
  * Constructor.
  */
 function SubmissionSubmitStep3Form($monograph)
 {
     parent::SubmissionSubmitForm($monograph, 3);
     $press =& Request::getPress();
     // Validation checks for this form
     $this->addCheck(new FormValidatorLocale($this, 'title', 'required', 'submission.submit.form.titleRequired'));
 }
开发者ID:jerico-dev,项目名称:omp,代码行数:10,代码来源:SubmissionSubmitStep3Form.inc.php

示例5: become

 /**
  * Become a given role.
  */
 function become($args)
 {
     parent::validate(true);
     $press =& Request::getPress();
     $user =& Request::getUser();
     switch (array_shift($args)) {
         case 'author':
             $roleId = ROLE_ID_AUTHOR;
             $setting = 'allowRegAuthor';
             $deniedKey = 'user.noRoles.submitMonographRegClosed';
             break;
         case 'reviewer':
             $roleId = ROLE_ID_REVIEWER;
             $setting = 'allowRegReviewer';
             $deniedKey = 'user.noRoles.regReviewerClosed';
             break;
         default:
             Request::redirect(null, null, 'index');
     }
     if ($press->getSetting($setting)) {
         $userGroupDao =& DAORegistry::getDAO('UserGroupDAO');
         $userGroup =& $userGroupDao->getDefaultByRoleId($press->getId(), $roleId);
         $userGroupDao->assignUserToGroup($user->getId(), $userGroup->getId());
         Request::redirectUrl(Request::getUserVar('source'));
     } else {
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->assign('message', $deniedKey);
         return $templateMgr->display('common/message.tpl');
     }
 }
开发者ID:jerico-dev,项目名称:omp,代码行数:33,代码来源:UserHandler.inc.php

示例6: display

 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     $press = Request::getPress();
     $templateMgr->assign_by_ref('submission', $this->reviewerSubmission);
     $templateMgr->assign_by_ref('press', $press);
     $templateMgr->assign('step', 3);
     $reviewAssignment =& $this->getReviewAssignment();
     $templateMgr->assign_by_ref('reviewAssignment', $reviewAssignment);
     /*  FIXME #5123: Include when review form infrastructure is in place
     		if($reviewAssignment->getReviewFormId()) {
     
     			// Get the review form components
     			$reviewFormElementDao =& DAORegistry::getDAO('ReviewFormElementDAO');
     			$reviewFormElements =& $reviewFormElementDao->getReviewFormElements($reviewAssignment->getReviewFormId());
     			$reviewFormResponseDao =& DAORegistry::getDAO('ReviewFormResponseDAO');
     			$reviewFormResponses =& $reviewFormResponseDao->getReviewReviewFormResponseValues($reviewAssignment->getReviewId());
     			$reviewFormDao =& DAORegistry::getDAO('ReviewFormDAO');
     			$reviewformid = $reviewAssignment->getReviewFormId();
     			$reviewForm =& $reviewFormDao->getReviewForm($reviewAssignment->getReviewFormId(), ASSOC_TYPE_PRESS, $press->getId());
     
     			$templateMgr->assign_by_ref('reviewForm', $reviewForm);
     			$templateMgr->assign('reviewFormElements', $reviewFormElements);
     			$templateMgr->assign('reviewFormResponses', $reviewFormResponses);
     			$templateMgr->assign('isLocked', isset($reviewAssignment) && $reviewAssignment->getDateCompleted() != null);
     		}*/
     parent::display();
 }
开发者ID:ramonsodoma,项目名称:omp,代码行数:31,代码来源:ReviewerReviewStep3Form.inc.php

示例7: define

 /**
  * Used by subclasses to validate access keys when they are allowed.
  * @param $userId int The user this key refers to
  * @param $reviewId int The ID of the review this key refers to
  * @param $newKey string The new key name, if one was supplied; otherwise, the existing one (if it exists) is used
  * @return object Valid user object if the key was valid; otherwise NULL.
  */
 function &validateAccessKey($userId, $reviewId, $newKey = null)
 {
     $press =& Request::getPress();
     if (!$press || !$press->getSetting('reviewerAccessKeysEnabled')) {
         $accessKey = false;
         return $accessKey;
     }
     define('REVIEWER_ACCESS_KEY_SESSION_VAR', 'ReviewerAccessKey');
     import('lib.pkp.classes.security.AccessKeyManager');
     $accessKeyManager = new AccessKeyManager();
     $session =& Request::getSession();
     // Check to see if a new access key is being used.
     if (!empty($newKey)) {
         if (Validation::isLoggedIn()) {
             Validation::logout();
         }
         $keyHash = $accessKeyManager->generateKeyHash($newKey);
         $session->setSessionVar(REVIEWER_ACCESS_KEY_SESSION_VAR, $keyHash);
     } else {
         $keyHash = $session->getSessionVar(REVIEWER_ACCESS_KEY_SESSION_VAR);
     }
     // Now that we've gotten the key hash (if one exists), validate it.
     $accessKey =& $accessKeyManager->validateKey('ReviewerContext', $userId, $keyHash, $reviewId);
     if ($accessKey) {
         $userDao =& DAORegistry::getDAO('UserDAO');
         $user =& $userDao->getUser($accessKey->getUserId(), false);
         return $user;
     }
     // No valid access key -- return NULL.
     return $accessKey;
 }
开发者ID:ramonsodoma,项目名称:omp,代码行数:38,代码来源:ReviewerHandler.inc.php

示例8: execute

 /**
  * Save group group.
  * @see Form::execute()
  */
 function execute()
 {
     $groupDao =& DAORegistry::getDAO('GroupDAO');
     $press =& Request::getPress();
     if (!isset($this->group)) {
         $this->group = $groupDao->newDataObject();
     }
     $this->group->setAssocType(ASSOC_TYPE_PRESS);
     $this->group->setAssocId($press->getId());
     $this->group->setTitle($this->getData('title'), Locale::getLocale());
     // Localized
     $this->group->setContext($this->getData('context'));
     // Eventually this will be a general Groups feature; for now,
     // we're just using it to display press team entries in About.
     $this->group->setAboutDisplayed(true);
     // Update or insert group group
     if ($this->group->getId() != null) {
         $groupDao->updateObject($this->group);
     } else {
         $this->group->setSequence(REALLY_BIG_NUMBER);
         $groupDao->insertGroup($this->group);
         // Re-order the groups so the new one is at the end of the list.
         $groupDao->resequenceGroups($this->group->getAssocType(), $this->group->getAssocId());
     }
     return true;
 }
开发者ID:jerico-dev,项目名称:omp,代码行数:30,代码来源:GroupForm.inc.php

示例9: display

 /**
  * Display the form.
  */
 function display()
 {
     $press =& Request::getPress();
     $templateMgr =& TemplateManager::getManager();
     if (Config::getVar('email', 'allow_envelope_sender')) {
         $templateMgr->assign('envelopeSenderEnabled', true);
     }
     $templateMgr->assign('pressEnabled', $press->getEnabled());
     parent::display();
 }
开发者ID:jerico-dev,项目名称:omp,代码行数:13,代码来源:PressSetupStep1Form.inc.php

示例10: execute

 /**
  * Save modified settings.
  */
 function execute()
 {
     $press =& Request::getPress();
     $settingsDao =& DAORegistry::getDAO('PressSettingsDAO');
     foreach ($this->_data as $name => $value) {
         if (isset($this->settings[$name])) {
             $isLocalized = in_array($name, $this->getLocaleFieldNames());
             $settingsDao->updateSetting($press->getId(), $name, $value, $this->settings[$name], $isLocalized);
         }
     }
 }
开发者ID:ramonsodoma,项目名称:omp,代码行数:14,代码来源:PressSetupForm.inc.php

示例11: getContents

 function getContents(&$templateMgr)
 {
     $user =& Request::getUser();
     $press =& Request::getPress();
     if ($user && $press) {
         $userId = $user->getId();
         $notificationDao =& DAORegistry::getDAO('NotificationDAO');
         $templateMgr->assign('unreadNotifications', $notificationDao->getUnreadNotificationCount($userId));
     }
     return parent::getContents($templateMgr);
 }
开发者ID:jerico-dev,项目名称:omp,代码行数:11,代码来源:NotificationBlockPlugin.inc.php

示例12: getContents

 /**
  * Get the HTML contents for this block.
  * @param $templateMgr object
  * @return $string
  */
 function getContents(&$templateMgr)
 {
     $press =& Request::getPress();
     if (!$press) {
         return '';
     }
     $templateMgr->assign('forReaders', $press->getLocalizedSetting('readerInformation'));
     $templateMgr->assign('forAuthors', $press->getLocalizedSetting('authorInformation'));
     $templateMgr->assign('forLibrarians', $press->getLocalizedSetting('librarianInformation'));
     return parent::getContents($templateMgr);
 }
开发者ID:jerico-dev,项目名称:omp,代码行数:16,代码来源:InformationBlockPlugin.inc.php

示例13: _setMailFrom

 /**
  * Helper Function - set mail from address
  * @param MailTemplate $mail 
  */
 function _setMailFrom(&$mail)
 {
     $site =& Request::getSite();
     $press =& Request::getPress();
     // Set the sender based on the current context
     if ($press && $press->getSetting('supportEmail')) {
         $mail->setFrom($press->getSetting('supportEmail'), $press->getSetting('supportName'));
     } else {
         $mail->setFrom($site->getLocalizedContactEmail(), $site->getLocalizedContactName());
     }
 }
开发者ID:jerico-dev,项目名称:omp,代码行数:15,代码来源:LoginHandler.inc.php

示例14: assignParams

 function assignParams($paramArray = array())
 {
     $monograph =& $this->monograph;
     $press = isset($this->press) ? $this->press : Request::getPress();
     $paramArray['monographTitle'] = strip_tags($monograph->getLocalizedTitle());
     $paramArray['monographId'] = $monograph->getId();
     $paramArray['pressName'] = strip_tags($press->getLocalizedName());
     $paramArray['seriesName'] = strip_tags($monograph->getSeriesTitle());
     $paramArray['monographAbstract'] = String::html2text($monograph->getLocalizedAbstract());
     $paramArray['authorString'] = strip_tags($monograph->getAuthorString());
     parent::assignParams($paramArray);
 }
开发者ID:ramonsodoma,项目名称:omp,代码行数:12,代码来源:MonographMailTemplate.inc.php

示例15: display

 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     $press = Request::getPress();
     $reviewerGuidelines = $press->getLocalizedSetting('reviewGuidelines');
     if (empty($reviewerGuidelines)) {
         $reviewerGuidelines = Locale::translate('reviewer.monograph.noGuidelines');
     }
     $templateMgr->assign_by_ref('reviewerGuidelines', $press->getLocalizedSetting('reviewGuidelines'));
     $templateMgr->assign_by_ref('submission', $this->reviewerSubmission);
     $templateMgr->assign('step', 2);
     parent::display();
 }
开发者ID:ramonsodoma,项目名称:omp,代码行数:16,代码来源:ReviewerReviewStep2Form.inc.php


注:本文中的Request::getPress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。