本文整理汇总了PHP中Application::getRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::getRequest方法的具体用法?PHP Application::getRequest怎么用?PHP Application::getRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application
的用法示例。
在下文中一共展示了Application::getRequest方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* @see FileLoader::execute()
*/
function execute()
{
if (!$this->_plugin) {
return false;
}
$plugin = $this->_plugin;
$journals = $this->_getJournals();
$request =& Application::getRequest();
foreach ($journals as $journal) {
$unregisteredArticles = $plugin->_getUnregisteredArticles($journal);
$unregisteredArticlesIds = array();
foreach ($unregisteredArticles as $articleData) {
$article = $articleData['article'];
if (is_a($article, 'PublishedArticle')) {
$unregisteredArticlesIds[$article->getId()] = $article;
}
}
$toBeDepositedIds = array();
foreach ($unregisteredArticlesIds as $id => $article) {
if (!$plugin->updateDepositStatus($request, $journal, $article)) {
array_push($toBeDepositedIds, $id);
}
}
// If there are unregistered things and we want automatic deposits
if (count($toBeDepositedIds) && $plugin->getSetting($journal->getId(), 'automaticRegistration')) {
$exportSpec = array(DOI_EXPORT_ARTICLES => $toBeDepositedIds);
$plugin->registerObjects($request, $exportSpec, $journal);
}
}
}
示例2: SubmissionSubmitForm
/**
* Constructor.
* @param $submission object
* @param $step int
*/
function SubmissionSubmitForm($context, $submission, $step)
{
parent::Form(sprintf('submission/form/step%d.tpl', $step));
$this->addCheck(new FormValidatorPost($this));
$this->step = (int) $step;
$this->submission = $submission;
$this->submissionId = $submission ? $submission->getId() : null;
$this->context = $context;
// Determine whether or not the current user belongs to a manager, editor, or assistant group
// and could potentially expedite this submission.
$request = Application::getRequest();
$user = $request->getUser();
$userGroupAssignmentDao = DAORegistry::getDAO('UserGroupAssignmentDAO');
$userGroupDao = DAORegistry::getDAO('UserGroupDAO');
$userGroupAssignments = $userGroupAssignmentDao->getByUserId($user->getId(), $context->getId());
if (!$userGroupAssignments->wasEmpty()) {
while ($userGroupAssignment = $userGroupAssignments->next()) {
$userGroup = $userGroupDao->getById($userGroupAssignment->getUserGroupId());
if (in_array($userGroup->getRoleId(), array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR, ROLE_ID_ASSISTANT))) {
$this->_canExpedite = true;
break;
}
}
}
}
示例3: __construct
public function __construct()
{
$this->_request = Application::getRequest();
$this->_response = Application::getResponse();
$this->view = Application::getView();
$this->init();
}
示例4: init
/**
* Initialize the theme's styles, scripts and hooks. This is run on the
* currently active theme and it's parent themes.
*
* @return null
*/
public function init()
{
// Load Noto Sans font from Google Font CDN
// To load extended latin or other character sets, see:
// https://www.google.com/fonts#UsePlace:use/Collection:Noto+Sans
if (Config::getVar('general', 'enable_cdn')) {
$this->addStyle('fontNotoSans', '//fonts.googleapis.com/css?family=Noto+Sans:400,400italic,700,700italic', array('baseUrl' => ''));
}
// Load primary stylesheet
$this->addStyle('stylesheet', 'styles/index.less');
// Load jQuery from a CDN or, if CDNs are disabled, from a local copy.
$min = Config::getVar('general', 'enable_minified') ? '.min' : '';
$request = Application::getRequest();
if (Config::getVar('general', 'enable_cdn')) {
$jquery = '//ajax.googleapis.com/ajax/libs/jquery/' . CDN_JQUERY_VERSION . '/jquery' . $min . '.js';
$jqueryUI = '//ajax.googleapis.com/ajax/libs/jqueryui/' . CDN_JQUERY_UI_VERSION . '/jquery-ui' . $min . '.js';
} else {
// Use OJS's built-in jQuery files
$jquery = $request->getBaseUrl() . '/lib/pkp/lib/vendor/components/jquery/jquery' . $min . '.js';
$jqueryUI = $request->getBaseUrl() . '/lib/pkp/lib/vendor/components/jqueryui/jquery-ui' . $min . '.js';
}
// Use an empty `baseUrl` argument to prevent the theme from looking for
// the files within the theme directory
$this->addScript('jQuery', $jquery, array('baseUrl' => ''));
$this->addScript('jQueryUI', $jqueryUI, array('baseUrl' => ''));
$this->addScript('jQueryTagIt', $request->getBaseUrl() . '/lib/pkp/js/lib/jquery/plugins/jquery.tag-it.js', array('baseUrl' => ''));
// Load custom JavaScript for this theme
$this->addScript('default', 'js/main.js');
}
示例5: __construct
/**
* コンストラクタ
*
* @param Application $application
*/
public function __construct($application)
{
$this->controller_name = strtolower(substr(get_class($this), 0, -10));
$this->application = $application;
$this->request = $application->getRequest();
$this->response = $application->getResponse();
$this->session = $application->getSession();
$this->db_manager = $application->getDbManager();
}
示例6: __construct
/**
* Constructor
*/
function __construct()
{
// import app-specific grid data provider for access policies.
$request = Application::getRequest();
$fileId = $request->getUserVar('fileId');
// authorized in authorize() method.
import('lib.pkp.controllers.grid.files.dependent.DependentFilesGridDataProvider');
parent::__construct(new DependentFilesGridDataProvider($fileId), WORKFLOW_STAGE_ID_PRODUCTION, FILE_GRID_ADD | FILE_GRID_DELETE | FILE_GRID_VIEW_NOTES | FILE_GRID_EDIT);
$this->addRoleAssignment(array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR, ROLE_ID_ASSISTANT, ROLE_ID_AUTHOR), array('fetchGrid', 'fetchRow'));
}
示例7: __construct
/**
* Constructor
*/
function __construct()
{
import('lib.pkp.controllers.grid.files.query.QueryNoteFilesCategoryGridDataProvider');
$request = Application::getRequest();
$stageId = $request->getUservar('stageId');
// authorized by data provider.
parent::__construct(new QueryNoteFilesCategoryGridDataProvider(), $stageId, FILE_GRID_DELETE | FILE_GRID_VIEW_NOTES | FILE_GRID_EDIT);
$this->addRoleAssignment(array(ROLE_ID_SUB_EDITOR, ROLE_ID_MANAGER, ROLE_ID_ASSISTANT), array('fetchGrid', 'fetchCategory', 'fetchRow', 'addFile', 'downloadFile', 'deleteFile', 'updateQueryNoteFiles'));
// Set the grid title.
$this->setTitle('submission.queryNoteFiles');
}
示例8: __construct
/**
* Constructor.
* @param $template string Form template
* @param $pubObject object
* @param $approval boolean
* @param $confirmationText string
*/
function __construct($template, $pubObject, $approval, $confirmationText)
{
parent::__construct($template);
$this->_pubObject = $pubObject;
$this->_approval = $approval;
$this->_confirmationText = $confirmationText;
$request = Application::getRequest();
$context = $request->getContext();
$this->_contextId = $context->getId();
$this->addCheck(new FormValidatorPost($this));
$this->addCheck(new FormValidatorCSRF($this));
}
示例9: QueryNoteFilesGridHandler
/**
* Constructor
*/
function QueryNoteFilesGridHandler()
{
// import app-specific grid data provider for access policies.
$request = Application::getRequest();
$stageId = $request->getUservar('stageId');
// authorized in authorize() method.
import('lib.pkp.controllers.grid.files.query.QueryNoteFilesGridDataProvider');
parent::FileListGridHandler(new QueryNoteFilesGridDataProvider($request->getUserVar('noteId')), $stageId, FILE_GRID_ADD | FILE_GRID_DELETE | FILE_GRID_VIEW_NOTES | FILE_GRID_EDIT);
$this->addRoleAssignment(array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR, ROLE_ID_ASSISTANT, ROLE_ID_AUTHOR), array('fetchGrid', 'fetchRow', 'selectFiles'));
// Set grid title.
$this->setTitle('submission.queries.attachedFiles');
}
示例10: isValid
/**
* Check the number of lisbuilder rows. If it's equal to 0, return false.
*
* @see FormValidator::isValid()
* @return boolean
*/
function isValid()
{
$value = $this->getFieldValue();
import('lib.pkp.classes.controllers.listbuilder.ListbuilderHandler');
$request =& Application::getRequest();
ListbuilderHandler::unpack($request, $value);
if ($this->_valid) {
return true;
} else {
return false;
}
}
示例11: CategoryForm
/**
* Constructor.
* @param $pressId Press id.
* @param $categoryId Category id.
*/
function CategoryForm($pressId, $categoryId = null)
{
parent::Form('controllers/grid/settings/category/form/categoryForm.tpl');
$this->_pressId = $pressId;
$this->_categoryId = $categoryId;
$request = Application::getRequest();
$user = $request->getUser();
$this->_userId = $user->getId();
// Validation checks for this form
$this->addCheck(new FormValidatorLocale($this, 'name', 'required', 'grid.category.nameRequired'));
$this->addCheck(new FormValidatorAlphaNum($this, 'path', 'required', 'grid.category.pathAlphaNumeric'));
$this->addCheck(new FormValidatorCustom($this, 'path', 'required', 'grid.category.pathExists', create_function('$path,$form,$categoryDao,$pressId', 'return !$categoryDao->categoryExistsByPath($path,$pressId) || ($form->getData(\'oldPath\') != null && $form->getData(\'oldPath\') == $path);'), array(&$this, DAORegistry::getDAO('CategoryDAO'), $pressId)));
$this->addCheck(new FormValidatorPost($this));
}
示例12: validate
/**
* Perform additional validation checks
* @copydoc Form::validate
*/
function validate()
{
if (!parent::validate()) {
return false;
}
// Validate that the section ID is attached to this journal.
$request = Application::getRequest();
$context = $request->getContext();
$sectionDao = DAORegistry::getDAO('SectionDAO');
$section = $sectionDao->getById($this->getData('sectionId'), $context->getId());
if (!$section) {
return false;
}
return true;
}
示例13: IssueEntryPublicationMetadataForm
/**
* Constructor.
* @param $submissionId integer
* @param $userId integer
* @param $stageId integer
* @param $formParams array
*/
function IssueEntryPublicationMetadataForm($submissionId, $userId, $stageId = null, $formParams = null)
{
parent::Form('controllers/tab/issueEntry/form/publicationMetadataFormFields.tpl');
$submissionDao = Application::getSubmissionDAO();
$this->_submission = $submissionDao->getById($submissionId);
$this->_stageId = $stageId;
$this->_formParams = $formParams;
$this->_userId = $userId;
$this->addCheck(new FormValidatorPost($this));
if (isset($formParams['expeditedSubmission']) && $formParams['expeditedSubmission']) {
// make choosing an issue mandatory for expedited submissions.
$request = Application::getRequest();
$context = $request->getContext();
$this->addCheck(new FormValidatorCustom($this, 'issueId', 'required', 'author.submit.form.issueRequired', array(DAORegistry::getDAO('IssueDAO'), 'issueIdExists'), array($context->getId())));
}
}
示例14: PKPPublicIdentifiersForm
/**
* Constructor.
* @param $template string Form template path
* @param $pubObject object
* @param $stageId integer
* @param $formParams array
*/
function PKPPublicIdentifiersForm($pubObject, $stageId = null, $formParams = null)
{
parent::Form('controllers/tab/pubIds/form/publicIdentifiersForm.tpl');
$this->_pubObject = $pubObject;
$this->_stageId = $stageId;
$this->_formParams = $formParams;
$request = Application::getRequest();
$context = $request->getContext();
$this->_contextId = $context->getId();
AppLocale::requireComponents(LOCALE_COMPONENT_PKP_EDITOR);
$this->addCheck(new FormValidatorPost($this));
$this->addCheck(new FormValidatorCSRF($this));
// action links for pub id reset requests
$pubIdPluginHelper = new PKPPubIdPluginHelper();
$pubIdPluginHelper->setLinkActions($this->getContextId(), $this, $pubObject);
}
示例15: validate
/**
* Perform additional validation checks
* @copydoc Form::validate
*/
function validate()
{
if (!parent::validate()) {
return false;
}
// Validate that the series ID is attached to this press.
if ($seriesId = $this->getData('seriesId')) {
$request = Application::getRequest();
$context = $request->getContext();
$seriesDao = DAORegistry::getDAO('SeriesDAO');
$series = $seriesDao->getById($seriesId, $context->getId());
if (!$series) {
return false;
}
}
return true;
}