| @@ 554-563 (lines=10) @@ | ||
| 551 | // buildView must be before sendMail because it adds the game template path to the templateStack |
|
| 552 | $viewModel = $this->buildView($this->game); |
|
| 553 | ||
| 554 | if ($this->getRequest()->isPost()) { |
|
| 555 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 556 | $form->setData($data); |
|
| 557 | if ($form->isValid()) { |
|
| 558 | $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry); |
|
| 559 | if ($result) { |
|
| 560 | $statusMail = true; |
|
| 561 | } |
|
| 562 | } |
|
| 563 | } |
|
| 564 | ||
| 565 | $viewModel->setVariables(array( |
|
| 566 | 'statusMail' => $statusMail, |
|
| @@ 782-791 (lines=10) @@ | ||
| 779 | $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form'); |
|
| 780 | $form->setAttribute('method', 'post'); |
|
| 781 | ||
| 782 | if ($this->getRequest()->isPost()) { |
|
| 783 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 784 | $form->setData($data); |
|
| 785 | if ($form->isValid()) { |
|
| 786 | $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry); |
|
| 787 | if ($result) { |
|
| 788 | $statusMail = true; |
|
| 789 | } |
|
| 790 | } |
|
| 791 | } |
|
| 792 | ||
| 793 | $viewModel = $this->buildView($this->game); |
|
| 794 | ||