本文整理汇总了PHP中Form::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::fetch方法的具体用法?PHP Form::fetch怎么用?PHP Form::fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Form
的用法示例。
在下文中一共展示了Form::fetch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run($static = false)
{
$form = new Form();
$form->post('login')->val('blank')->post('password')->val('blank');
if (!$form->submit()) {
// Error
$this->_error($static);
return false;
}
$data = $form->fetch();
$login = $data['login'];
$password = Hash::create('sha256', $data['password'], PASS_HASH_KEY);
$query = "SELECT userid, login, role FROM user WHERE login = :login AND password = :password";
if (!($result = $this->db->select($query, array(':login' => $login, ':password' => $password)))) {
$this->_error($static);
return false;
}
Session::init();
Session::set('userid', $result[0]['userid']);
Session::set('login', $result[0]['login']);
Session::set('role', $result[0]['role']);
Session::set('loggedIn', true);
if ($static) {
header('location:' . URL . 'dashboard');
}
echo json_encode('success');
}
示例2: fetch
/**
* @copydoc Form::fetch()
*/
function fetch($request)
{
$templateMgr = TemplateManager::getManager($request);
$pubIdPlugins = PluginRegistry::loadCategory('pubIds', true, $this->getContextId());
$templateMgr->assign(array('pubIdPlugins' => $pubIdPlugins, 'pubObject' => $this->getPubObject(), 'approval' => $this->getApproval(), 'confirmationText' => $this->getConfirmationText()));
return parent::fetch($request);
}
示例3: fetch
/**
* @copydoc Form::fetch()
*/
function fetch($request)
{
$urnNamespaces = array('' => '', 'urn:nbn:de' => 'urn:nbn:de', 'urn:nbn:at' => 'urn:nbn:at', 'urn:nbn:ch' => 'urn:nbn:ch', 'urn:nbn' => 'urn:nbn', 'urn' => 'urn');
$templateMgr = TemplateManager::getManager($request);
$templateMgr->assign('urnNamespaces', $urnNamespaces);
return parent::fetch($request);
}
示例4: fetch
/**
* @copydoc Form::fetch()
*/
function fetch($request)
{
$templateMgr = TemplateManager::getManager($request);
$noteDao = DAORegistry::getDAO('NoteDAO');
$templateMgr->assign(array('notes' => $noteDao->getByAssoc($this->getAssocType(), $this->getAssocId()), 'submitNoteText' => $this->getSubmitNoteLocaleKey(), 'newNoteFormTemplate' => $this->getNewNoteFormTemplate()));
return parent::fetch($request);
}
示例5: fetch
/**
* @copydoc Form::fetch()
*/
function fetch($request, $template = null, $display = false)
{
$templateMgr = TemplateManager::getManager($request);
$site = $request->getSite();
$context = $request->getContext();
if ($this->captchaEnabled) {
import('lib.pkp.lib.recaptcha.recaptchalib');
$publicKey = Config::getVar('captcha', 'recaptcha_public_key');
$useSSL = Config::getVar('security', 'force_ssl') ? true : false;
$reCaptchaHtml = recaptcha_get_html($publicKey, null, $useSSL);
$templateMgr->assign(array('reCaptchaHtml' => $reCaptchaHtml, 'captchaEnabled' => true));
}
$countryDao = DAORegistry::getDAO('CountryDAO');
$countries = $countryDao->getCountries();
$templateMgr->assign('countries', $countries);
$userDao = DAORegistry::getDAO('UserDAO');
$templateMgr->assign('genderOptions', $userDao->getGenderOptions());
$site = $request->getSite();
$templateMgr->assign('availableLocales', $site->getSupportedLocaleNames());
import('lib.pkp.classes.user.form.UserFormHelper');
$userFormHelper = new UserFormHelper();
$userFormHelper->assignRoleContent($templateMgr, $request);
$templateMgr->assign(array('source' => $request->getUserVar('source'), 'minPasswordLength' => $site->getMinPasswordLength(), 'privacyStatement' => $context->getLocalizedSetting('privacyStatement'), 'includeEntirePage' => $display));
return parent::fetch($request, $template, $display);
}
示例6: fetch
/**
* Fetch
* @param $request PKPRequest
* @see Form::fetch()
*/
function fetch($request)
{
$templateMgr = TemplateManager::getManager($request);
$templateMgr->assign('submissionFileCategories', array(GENRE_CATEGORY_DOCUMENT => __('submission.document'), GENRE_CATEGORY_ARTWORK => __('submission.art'), GENRE_CATEGORY_SUPPLEMENTARY => __('submission.supplementary')));
AppLocale::requireComponents(LOCALE_COMPONENT_APP_MANAGER);
return parent::fetch($request);
}
示例7: fetch
/**
* Fetch the form.
*/
function fetch($request)
{
$templateMgr = TemplateManager::getManager($request);
$journal = $request->getJournal();
// set up the accessibility options pulldown
$templateMgr->assign('enableDelayedOpenAccess', $journal->getSetting('enableDelayedOpenAccess'));
$templateMgr->assign('accessOptions', array(ISSUE_ACCESS_OPEN => AppLocale::Translate('editor.issues.openAccess'), ISSUE_ACCESS_SUBSCRIPTION => AppLocale::Translate('editor.issues.subscription')));
if ($this->issue) {
$templateMgr->assign('issue', $this->issue);
$templateMgr->assign('issueId', $this->issue->getId());
}
// Cover image preview
$coverImage = null;
if ($this->issue) {
$coverImage = $this->issue->getCoverImage();
}
// Cover image delete link action
if ($coverImage) {
import('lib.pkp.classes.linkAction.LinkAction');
import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal');
$router = $request->getRouter();
$deleteCoverImageLinkAction = new LinkAction('deleteCoverImage', new RemoteActionConfirmationModal($request->getSession(), __('common.confirmDelete'), null, $router->url($request, null, null, 'deleteCoverImage', null, array('coverImage' => $coverImage, 'issueId' => $this->issue->getId())), 'modal_delete'), __('common.delete'), null);
$templateMgr->assign('deleteCoverImageLinkAction', $deleteCoverImageLinkAction);
}
return parent::fetch($request);
}
示例8: fetch
/**
* Fetch the HTML contents of the form.
* @param $request PKPRequest
* return string
*/
function fetch($request)
{
$templateMgr = TemplateManager::getManager($request);
$templateMgr->assign('submissionId', $this->getMonograph()->getId());
$templateMgr->assign('stageId', $this->getStageId());
$templateMgr->assign('formParams', $this->getFormParams());
$onixCodelistItemDao = DAORegistry::getDAO('ONIXCodelistItemDAO');
// get the lists associated with the select elements on this form
$audienceCodes = $onixCodelistItemDao->getCodes('List28');
$audienceRangeQualifiers = $onixCodelistItemDao->getCodes('List30');
$audienceRanges = $onixCodelistItemDao->getCodes('List77');
// assign these lists to the form for select options
$templateMgr->assign('audienceCodes', $audienceCodes);
$templateMgr->assign('audienceRangeQualifiers', $audienceRangeQualifiers);
$templateMgr->assign('audienceRanges', $audienceRanges);
$publishedMonograph = $this->getPublishedMonograph();
if ($publishedMonograph) {
// pre-select the existing values on the form.
$templateMgr->assign('audience', $publishedMonograph->getAudience());
$templateMgr->assign('audienceRangeQualifier', $publishedMonograph->getAudienceRangeQualifier());
$templateMgr->assign('audienceRangeFrom', $publishedMonograph->getAudienceRangeFrom());
$templateMgr->assign('audienceRangeTo', $publishedMonograph->getAudienceRangeTo());
$templateMgr->assign('audienceRangeExact', $publishedMonograph->getAudienceRangeExact());
$templateMgr->assign('coverImage', $publishedMonograph->getCoverImage());
}
return parent::fetch($request);
}
示例9: fetch
/**
* Display the form.
* @param $args array
* @param $request PKPRequest
*/
function fetch($args, $request)
{
$templateMgr = TemplateManager::getManager($request);
import('lib.pkp.classes.reviewForm.ReviewFormElement');
$templateMgr->assign(array('reviewFormId' => $this->reviewFormId, 'reviewFormElementId' => $this->reviewFormElementId, 'multipleResponsesElementTypes' => ReviewFormElement::getMultipleResponsesElementTypes(), 'multipleResponsesElementTypesString' => ';' . implode(';', ReviewFormElement::getMultipleResponsesElementTypes()) . ';', 'reviewFormElementTypeOptions' => ReviewFormElement::getReviewFormElementTypeOptions()));
return parent::fetch($request);
}
示例10: fetch
/**
* Fetch
* @param $request PKPRequest
* @see Form::fetch()
*/
function fetch(&$request)
{
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('monographFileCategories', array(GENRE_CATEGORY_DOCUMENT => Locale::translate('submission.document'), GENRE_CATEGORY_ARTWORK => Locale::translate('submission.art')));
Locale::requireComponents(array(LOCALE_COMPONENT_OMP_MANAGER));
return parent::fetch($request);
}
示例11: fetch
/**
* Fetch the HTML contents of the form.
* @param $request PKPRequest
* return string
*/
function fetch($request)
{
$context = $request->getContext();
$templateMgr = TemplateManager::getManager($request);
$templateMgr->assign('submissionId', $this->getSubmission()->getId());
$templateMgr->assign('stageId', $this->getStageId());
$templateMgr->assign('formParams', $this->getFormParams());
$templateMgr->assign('context', $context);
$journalSettingsDao = DAORegistry::getDAO('JournalSettingsDAO');
$templateMgr->assign('issueOptions', $this->getIssueOptions($context));
$publishedArticle = $this->getPublishedArticle();
if ($publishedArticle) {
$templateMgr->assign('publishedArticle', $publishedArticle);
$issueDao = DAORegistry::getDAO('IssueDAO');
$issue = $issueDao->getById($publishedArticle->getIssueId());
if ($issue) {
$templateMgr->assign('issueAccess', $issue->getAccessStatus());
$templateMgr->assign('accessOptions', array(ARTICLE_ACCESS_ISSUE_DEFAULT => __('editor.issues.default'), ARTICLE_ACCESS_OPEN => __('editor.issues.open')));
}
}
// include payment information
// Set up required Payment Related Information
import('classes.payment.ojs.OJSPaymentManager');
$paymentManager = new OJSPaymentManager($request);
$completedPaymentDao = DAORegistry::getDAO('OJSCompletedPaymentDAO');
$publicationFeeEnabled = $paymentManager->publicationEnabled();
$templateMgr->assign('publicationFeeEnabled', $publicationFeeEnabled);
if ($publicationFeeEnabled) {
$templateMgr->assign('publicationPayment', $completedPaymentDao->getPublicationCompletedPayment($context->getId(), $this->getSubission()->getId()));
}
$templateMgr->assign('submission', $this->getSubmission());
return parent::fetch($request);
}
示例12: fetch
function fetch(&$request)
{
$monograph =& $this->getMonograph();
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign_by_ref('monograph', $this->getMonograph());
return parent::fetch($request);
}
示例13: fetch
/**
* Display the form.
*/
function fetch($args, $request)
{
$json = new JSONMessage();
$templateMgr = TemplateManager::getManager($request);
$templateMgr->assign('reviewFormId', $this->reviewFormId);
return parent::fetch($request);
}
示例14: fetch
/**
* Fetch the form.
* @see Form::fetch()
*/
function fetch(&$request)
{
$templateMgr =& TemplateManager::getManager();
$noteDao =& DAORegistry::getDAO('NoteDAO');
$notes =& $noteDao->getByAssoc($this->getAssocType(), $this->getAssocId());
$templateMgr->assign_by_ref('notes', $notes);
return parent::fetch($request);
}
示例15: fetch
/**
* Display the form.
* @param $request PKPRequest
* @param $requestArgs array Request parameters to bounce back with the form submission.
*/
function fetch($request, $requestArgs = array())
{
$userDao = DAORegistry::getDAO('UserDAO');
$user = $userDao->getById($this->_reviewAssignment->getReviewerId());
$templateMgr = TemplateManager::getManager($request);
$templateMgr->assign(array('userFullName' => $this->_reviewAssignment->getReviewerFullName(), 'requestArgs' => $requestArgs, 'reviewAssignmentId' => $this->_reviewAssignment->getId()));
return parent::fetch($request);
}