本文整理汇总了PHP中Nette\Application\UI\Form::getMode方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::getMode方法的具体用法?PHP Form::getMode怎么用?PHP Form::getMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Application\UI\Form
的用法示例。
在下文中一共展示了Form::getMode方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: partnerFormSuccessHandle
/**
* PartnerForm success event handler
* @param Form $form
*/
public function partnerFormSuccessHandle(Form $form)
{
$values = $form->getValues();
try {
switch ($form->getMode()) {
case FormMode::CREATE_MODE:
$this->createPartnerHandle($values);
break;
case FormMode::UPDATE_MODE:
$this->updatePartnerHandle($values);
break;
}
} catch (Exceptions\DuplicateEntryException $ex) {
$form->addError("partnersModule.partnerForm.partnerNameAlreadyExist");
}
}
示例2: paymentFormSubmitHandle
/**
* PaymentForm onSuccess event handler
* @param Form $form
*/
public function paymentFormSubmitHandle(Form $form)
{
$values = $form->getValues();
switch ($form->getMode()) {
case FormMode::CREATE_MODE:
// $oSelId = $values[PaymentForm::PAYMENT_OWNER_TYPE_SELECT_ID];
// switch ($oSelId) {
// case PaymentOwnerType::GROUP:
// $groupId = $values[PaymentForm::OWNER_TYPE_GROUP];
// try {
// $users = $this->getPositionService()->getUsersWithinGroup($groupId);
// $this->createMultiPaymentHandle($values, $users);
// } catch (Exceptions\DataErrorException $ex) {
// $this->handleDataLoad(null, "this", $ex);
// }
// break;
// case PaymentOwnerType::SELECT:
$ids = $values[PaymentForm::OWNER_TYPE_SELECT];
$this->createMultiPaymentHandle($values, $ids);
break;
// }
break;
case FormMode::UPDATE_MODE:
$this->updatePaymentHandle($values);
break;
}
}
示例3: seasonApplicationFormSubmitHandle
public function seasonApplicationFormSubmitHandle(Form $form)
{
$values = $form->getValues();
try {
switch ($form->getMode()) {
case FormMode::CREATE_MODE:
$users = $values->owner;
$values->offsetUnset("owner");
foreach ($users as $u) {
$values["owner"] = $u;
$this->createSeasonApplicationHandle($values);
}
break;
case FormMode::UPDATE_MODE:
$this->updateSeasonApplicationHandle($values);
break;
}
} catch (Exceptions\NoResultException $ex) {
$this->logWarning($ex);
$form->addError($this->tt("seasonsModule.admin.error.noTaxForSeasonAndGroup"));
} catch (Exceptions\InvalidStateException $ex) {
$this->logWarning("SeasonApplicationForm /// " . $ex);
$form->addError($this->tt("seasonsModule.admin.error.appDeadlineExpired"));
} catch (Exceptions\DuplicateEntryException $ex) {
$this->logWarning($ex);
$form->addError($this->tt("seasonsModule.admin.error.seasonAppUniqueExist"), self::FM_ERROR);
}
}
示例4: motEntryFormSuccessHandle
public function motEntryFormSuccessHandle(Form $form)
{
$values = $form->getValues();
switch ($form->getMode()) {
case FormMode::CREATE_MODE:
$ids = $values->offsetGet(MotivationEntryForm::MULTI_OWNER_ID);
$values->offsetUnset(MotivationEntryForm::MULTI_OWNER_ID);
$this->createEntry($values, $ids);
break;
case FormMode::UPDATE_MODE:
$this->updateEntry($values);
break;
}
}
示例5: searchFormSuccess
public function searchFormSuccess(Form $form)
{
$values = $form->getValues();
switch ($form->getMode()) {
case FormMode::CREATE_MODE:
$this->redirect(":System:Search:default", $values->keyword);
break;
case FormMode::UPDATE_MODE:
break;
}
}
示例6: forumThreadFormSuccess
public function forumThreadFormSuccess(Form $form)
{
$values = $form->getValues();
try {
switch ($form->getMode()) {
case FormMode::CREATE_MODE:
$this->createForumThread($values);
break;
case FormMode::UPDATE_MODE:
break;
}
} catch (Exceptions\DuplicateEntryException $ex) {
$form->addError("communicationModule.club.forumThreadAlreadyExist");
}
}
示例7: articleFormSubmitted
/**
* Article form success handler
* @param Form $form
*/
public function articleFormSubmitted(Form $form)
{
$values = $form->getValues();
try {
switch ($form->getMode()) {
case FormMode::CREATE_MODE:
$this->createArticle($values);
break;
case FormMode::UPDATE_MODE:
$this->updateArticle($values);
break;
}
} catch (Exceptions\DuplicateEntryException $ex) {
$form->addError("articlesModule.admin.articleForm.errors.articleAlreadyExist");
}
}
示例8: commentFormSuccess
/**
* CommentForm onSuccess event handler
* @param Form $form
*/
public function commentFormSuccess(Form $form)
{
$values = $form->getValues();
switch ($form->getMode()) {
case FormMode::CREATE_MODE:
if ($this->isCommenting()) {
$this->presenter->addComment($values);
}
break;
case FormMode::UPDATE_MODE:
$this->presenter->updateComment($values);
break;
}
if ($this->presenter->isAjax()) {
unset($this->template->showSimpleForm);
$this->redrawControl("commentsData");
}
}
示例9: forumThreadFormSuccess
public function forumThreadFormSuccess(Form $form)
{
$values = $form->getValues();
try {
switch ($form->getMode()) {
case FormMode::CREATE_MODE:
$this->createForumThread($values);
break;
case FormMode::UPDATE_MODE:
$this->updateForumThread($values);
break;
}
} catch (Exceptions\DuplicateEntryException $ex) {
$form->addError("forumModule.admin.forThrForm.errors.forumThrAlreadyExist");
}
}