| @@ 552-561 (lines=10) @@ | ||
| 549 | // buildView must be before sendMail because it adds the game template path to the templateStack |
|
| 550 | $viewModel = $this->buildView($this->game); |
|
| 551 | ||
| 552 | if ($this->getRequest()->isPost()) { |
|
| 553 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 554 | $form->setData($data); |
|
| 555 | if ($form->isValid()) { |
|
| 556 | $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry); |
|
| 557 | if ($result) { |
|
| 558 | $statusMail = true; |
|
| 559 | } |
|
| 560 | } |
|
| 561 | } |
|
| 562 | ||
| 563 | $viewModel->setVariables(array( |
|
| 564 | 'statusMail' => $statusMail, |
|
| @@ 681-690 (lines=10) @@ | ||
| 678 | $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form'); |
|
| 679 | $form->setAttribute('method', 'post'); |
|
| 680 | ||
| 681 | if ($this->getRequest()->isPost()) { |
|
| 682 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 683 | $form->setData($data); |
|
| 684 | if ($form->isValid()) { |
|
| 685 | $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry); |
|
| 686 | if ($result) { |
|
| 687 | $statusMail = true; |
|
| 688 | } |
|
| 689 | } |
|
| 690 | } |
|
| 691 | ||
| 692 | $viewModel = $this->buildView($this->game); |
|
| 693 | ||