當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PKPApplication類代碼示例

本文整理匯總了PHP中PKPApplication的典型用法代碼示例。如果您正苦於以下問題:PHP PKPApplication類的具體用法?PHP PKPApplication怎麽用?PHP PKPApplication使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了PKPApplication類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: HandlerValidatorPress

 /**
  * Constructor.
  * @see HandlerValidator::HandlerValidator()
  */
 function HandlerValidatorPress(&$handler, $redirectToLogin = false, $message = null, $additionalArgs = array())
 {
     $application =& PKPApplication::getApplication();
     $request =& $application->getRequest();
     $policy = new ContextRequiredPolicy($request, $message);
     parent::HandlerValidatorPolicy($policy, $handler, $redirectToLogin, $message, $additionalArgs);
 }
開發者ID:jerico-dev,項目名稱:omp,代碼行數:11,代碼來源:HandlerValidatorPress.inc.php

示例2: HandlerValidatorRoles

 /**
  * Constructor.
  * @param $handler Handler the associated form
  * @param $roles array of role id's
  * @param $all bool flag for whether all roles must exist or just 1
  */
 function HandlerValidatorRoles(&$handler, $redirectLogin = true, $message = null, $additionalArgs = array(), $roles, $all = false)
 {
     $application =& PKPApplication::getApplication();
     $request =& $application->getRequest();
     $policy = new RoleBasedHandlerOperationPolicy($request, $roles, array(), $message, $all, true);
     parent::HandlerValidatorPolicy($policy, $handler, $redirectLogin, $message, $additionalArgs);
 }
開發者ID:yuricampos,項目名稱:ojs,代碼行數:13,代碼來源:HandlerValidatorRoles.inc.php

示例3: fetch

 /**
  * @copydoc SiteSetupForm::fetch()
  */
 function fetch($request, $params = null)
 {
     $application = PKPApplication::getApplication();
     $templateMgr = TemplateManager::getManager();
     $templateMgr->assign('availableMetricTypes', $application->getMetricTypes(true));
     return parent::fetch($request, $params = null);
 }
開發者ID:pkp,項目名稱:ojs,代碼行數:10,代碼來源:AppSiteSetupForm.inc.php

示例4: isTinyMCEInstalled

 function isTinyMCEInstalled()
 {
     // If the thesis plugin isn't enabled, don't do anything.
     $application =& PKPApplication::getApplication();
     $products =& $application->getEnabledProducts('plugins.generic');
     return isset($products['tinymce']);
 }
開發者ID:artkuo,項目名稱:ocs,代碼行數:7,代碼來源:StaticPagesPlugin.inc.php

示例5: MedraSettingsForm

 /**
  * Constructor
  * @param $plugin MedraExportPlugin
  * @param $contextId integer
  */
 function MedraSettingsForm($plugin, $contextId)
 {
     $this->_contextId = $contextId;
     $this->_plugin = $plugin;
     parent::Form($plugin->getTemplatePath() . 'settingsForm.tpl');
     // DOI plugin settings action link
     $pubIdPlugins = PluginRegistry::loadCategory('pubIds', true);
     if (isset($pubIdPlugins['doipubidplugin'])) {
         $application = PKPApplication::getApplication();
         $request = $application->getRequest();
         $dispatcher = $application->getDispatcher();
         import('lib.pkp.classes.linkAction.request.AjaxModal');
         $doiPluginSettingsLinkAction = new LinkAction('settings', new AjaxModal($dispatcher->url($request, ROUTE_COMPONENT, null, 'grid.settings.plugins.SettingsPluginGridHandler', 'manage', null, array('plugin' => 'doipubidplugin', 'category' => 'pubIds')), __('plugins.importexport.common.settings.DOIPluginSettings')), __('plugins.importexport.common.settings.DOIPluginSettings'), null);
         $this->setData('doiPluginSettingsLinkAction', $doiPluginSettingsLinkAction);
     }
     // Add form validation checks.
     $this->addCheck(new FormValidator($this, 'registrantName', FORM_VALIDATOR_REQUIRED_VALUE, 'plugins.importexport.medra.settings.form.registrantNameRequired'));
     $this->addCheck(new FormValidator($this, 'fromCompany', FORM_VALIDATOR_REQUIRED_VALUE, 'plugins.importexport.medra.settings.form.fromCompanyRequired'));
     $this->addCheck(new FormValidator($this, 'fromName', FORM_VALIDATOR_REQUIRED_VALUE, 'plugins.importexport.medra.settings.form.fromNameRequired'));
     $this->addCheck(new FormValidatorEmail($this, 'fromEmail', FORM_VALIDATOR_REQUIRED_VALUE, 'plugins.importexport.medra.settings.form.fromEmailRequired'));
     $this->addCheck(new FormValidatorInSet($this, 'exportIssuesAs', FORM_VALIDATOR_REQUIRED_VALUE, 'plugins.importexport.medra.settings.form.exportIssuesAs', array(O4DOI_ISSUE_AS_WORK, O4DOI_ISSUE_AS_MANIFESTATION)));
     $this->addCheck(new FormValidatorInSet($this, 'publicationCountry', FORM_VALIDATOR_REQUIRED_VALUE, 'plugins.importexport.medra.settings.form.publicationCountry', array_keys($this->_getCountries())));
     // The username is used in HTTP basic authentication and according to RFC2617 it therefore may not contain a colon.
     $this->addCheck(new FormValidatorRegExp($this, 'username', FORM_VALIDATOR_OPTIONAL_VALUE, 'plugins.importexport.medra.settings.form.usernameRequired', '/^[^:]+$/'));
     $this->addCheck(new FormValidatorPost($this));
 }
開發者ID:bkroll,項目名稱:ojs,代碼行數:31,代碼來源:MedraSettingsForm.inc.php

示例6: assignParams

 /**
  * Assign parameters to template
  * @param $paramArray array
  */
 function assignParams($paramArray = array())
 {
     $submission = $this->submission;
     $application = PKPApplication::getApplication();
     $request = $application->getRequest();
     parent::assignParams(array_merge(array('submissionTitle' => strip_tags($submission->getLocalizedTitle()), 'submissionId' => $submission->getId(), 'submissionAbstract' => PKPString::html2text($submission->getLocalizedAbstract()), 'authorString' => strip_tags($submission->getAuthorString())), $paramArray));
 }
開發者ID:jprk,項目名稱:pkp-lib,代碼行數:11,代碼來源:SubmissionMailTemplate.inc.php

示例7: callbackTemplateArticlePageFooter

 /**
  * @see templates/article/footer.tpl
  */
 function callbackTemplateArticlePageFooter($hookName, $params)
 {
     $smarty =& $params[1];
     $output =& $params[2];
     // Identify similarity terms for the given article.
     $displayedArticle = $smarty->get_template_vars('article');
     $articleId = $displayedArticle->getId();
     import('classes.search.ArticleSearch');
     $articleSearch = new ArticleSearch();
     $searchTerms = $articleSearch->getSimilarityTerms($articleId);
     if (empty($searchTerms)) {
         return false;
     }
     // If we got similarity terms then execute a search with...
     // ... request, journal and error messages, ...
     $request = PKPApplication::getRequest();
     $router = $request->getRouter();
     $journal = $router->getContext($request);
     $error = null;
     // ... search keywords ...
     $query = implode(' ', $searchTerms);
     $keywords = array(null => $query);
     // ... and pagination.
     $rangeInfo = Handler::getRangeInfo($request, 'articlesBySimilarity');
     $rangeInfo->setCount(RECOMMEND_BY_SIMILARITY_PLUGIN_COUNT);
     $results = $articleSearch->retrieveResults($request, $journal, $keywords, $error, null, null, $rangeInfo, array($articleId));
     $smarty->assign('articlesBySimilarity', $results);
     $smarty->assign('articlesBySimilarityQuery', $query);
     $output .= $smarty->fetch($this->getTemplatePath() . 'articleFooter.tpl');
     return false;
 }
開發者ID:laelnasan,項目名稱:UTFPR-ojs,代碼行數:34,代碼來源:RecommendBySimilarityPlugin.inc.php

示例8:

 /**
  * @see Filter::process()
  */
 function &process(&$input)
 {
     // Initialize view
     $locale = AppLocale::getLocale();
     $application = PKPApplication::getApplication();
     $request = $application->getRequest();
     $templateMgr = TemplateManager::getManager($request);
     // Add the filter's directory as additional template dir so that
     // templates can include sub-templates in the same folder.
     array_unshift($templateMgr->template_dir, $this->getBasePath());
     // Give sub-filters a chance to add their variables
     // to the template.
     $this->addTemplateVars($templateMgr, $input, $request, $locale);
     // Use a base path hash as compile id to make sure that we don't
     // get namespace problems if several filters use the same
     // template names.
     $previousCompileId = $templateMgr->compile_id;
     $templateMgr->compile_id = md5($this->getBasePath());
     // Let the template engine render the citation.
     $output = $templateMgr->fetch($this->getTemplateName());
     // Remove the additional template dir
     array_shift($templateMgr->template_dir);
     // Restore the compile id.
     $templateMgr->compile_id = $previousCompileId;
     return $output;
 }
開發者ID:jprk,項目名稱:pkp-lib,代碼行數:29,代碼來源:TemplateBasedFilter.inc.php

示例9: isConfigured

 /**
  * Check if there is a payment plugin and if is configured
  * @return bool
  */
 function isConfigured()
 {
     $paymentPlugin =& $this->getPaymentPlugin();
     if ($paymentPlugin !== null) {
         return $paymentPlugin->isConfigured(PKPApplication::getRequest());
     }
     return false;
 }
開發者ID:jprk,項目名稱:pkp-lib,代碼行數:12,代碼來源:PaymentManager.inc.php

示例10: testHandlerValidatorRoles

 /**
  * @covers HandlerValidatorRoles
  */
 public function testHandlerValidatorRoles()
 {
     $contextDepth = PKPApplication::getApplication()->getContextDepth();
     // tests: userId, role type, user has role in context?, match all roles?, expected result of isValid()
     $tests = array(array(7, array(HANDLER_VALIDATOR_ROLES_FULL_CONTEXT_ROLE), true, false, true), array(7, array(HANDLER_VALIDATOR_ROLES_MANAGER_ROLE), true, true, true), array(7, array(HANDLER_VALIDATOR_ROLES_SITE_ADMIN_ROLE), true, false, true), array(null, array(HANDLER_VALIDATOR_ROLES_FULL_CONTEXT_ROLE), true, false, false), array(7, array(HANDLER_VALIDATOR_ROLES_FULL_CONTEXT_ROLE), false, false, false), array(7, array(HANDLER_VALIDATOR_ROLES_FULL_CONTEXT_ROLE, HANDLER_VALIDATOR_ROLES_MANAGER_ROLE), array(true, false), false, true), array(7, array(HANDLER_VALIDATOR_ROLES_FULL_CONTEXT_ROLE, HANDLER_VALIDATOR_ROLES_MANAGER_ROLE), array(true, true), false, true), array(7, array(HANDLER_VALIDATOR_ROLES_FULL_CONTEXT_ROLE, HANDLER_VALIDATOR_ROLES_MANAGER_ROLE), array(true, false), true, false), array(7, array(HANDLER_VALIDATOR_ROLES_FULL_CONTEXT_ROLE, HANDLER_VALIDATOR_ROLES_MANAGER_ROLE), array(true, true), true, true));
     foreach ($tests as $testNumber => $test) {
         $this->executeHandlerValidatorRolesTest($test, $testNumber);
     }
 }
開發者ID:doana,項目名稱:pkp-lib,代碼行數:12,代碼來源:HandlerValidatorRolesTest.php

示例11: register

 function register($category, $path)
 {
     $success = parent::register($category, $path);
     $this->addLocaleData();
     $request =& PKPApplication::getRequest();
     $templateMgr =& TemplateManager::getManager($request);
     $templateMgr->register_modifier('bibtex_escape', array(&$this, 'bibtexEscape'));
     return $success;
 }
開發者ID:yuricampos,項目名稱:ojs,代碼行數:9,代碼來源:BibtexCitationPlugin.inc.php

示例12: setUp

 /**
  * @copydoc PKPTestCase::setUp()
  */
 protected function setUp()
 {
     $application = PKPApplication::getApplication();
     $_SERVER['REQUEST_METHOD'] = 'GET';
     $request = $application->getRequest();
     if (is_null($request->getRouter())) {
         $router = new PKPRouter();
         $request->setRouter($router);
     }
 }
開發者ID:PublishingWithoutWalls,項目名稱:pkp-lib,代碼行數:13,代碼來源:Nlm30CitationSchemaCitationOutputFormatFilterTest.inc.php

示例13: setUp

 /**
  * @see WebTestCase::setUp()
  */
 protected function setUp()
 {
     parent::setUp();
     $application = PKPApplication::getApplication();
     $request = $application->getRequest();
     if (is_null($request->getRouter())) {
         $router = new PKPRouter();
         $request->setRouter($router);
     }
 }
開發者ID:laelnasan,項目名稱:UTFPR-ojs,代碼行數:13,代碼來源:FunctionalPubIdsImportExportTestCase.php

示例14: PressOAI

 /**
  * @see OAI#OAI
  */
 function PressOAI($config)
 {
     parent::OAI($config);
     $application = PKPApplication::getApplication();
     $request = $application->getRequest();
     $this->site = $request->getSite();
     $this->press = $request->getPress();
     $this->pressId = isset($this->press) ? $this->press->getId() : null;
     $this->dao = DAORegistry::getDAO('OAIDAO');
     $this->dao->setOAI($this);
 }
開發者ID:PublishingWithoutWalls,項目名稱:omp,代碼行數:14,代碼來源:PressOAI.inc.php

示例15: assignParams

 function assignParams($paramArray = array())
 {
     $submission = $this->submission;
     $application = PKPApplication::getApplication();
     $request = $application->getRequest();
     $paramArray['submissionTitle'] = strip_tags($submission->getLocalizedTitle());
     $paramArray['submissionId'] = $submission->getId();
     $paramArray['submissionAbstract'] = String::html2text($submission->getLocalizedAbstract());
     $paramArray['authorString'] = strip_tags($submission->getAuthorString());
     parent::assignParams($paramArray);
 }
開發者ID:mczirfusz,項目名稱:pkp-lib,代碼行數:11,代碼來源:SubmissionMailTemplate.inc.php


注:本文中的PKPApplication類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。