| @@ 686-695 (lines=10) @@ | ||
| 683 | $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form'); |
|
| 684 | $form->setAttribute('method', 'post'); |
|
| 685 | ||
| 686 | if ($this->getRequest()->isPost()) { |
|
| 687 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 688 | $form->setData($data); |
|
| 689 | if ($form->isValid()) { |
|
| 690 | $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry); |
|
| 691 | if ($result) { |
|
| 692 | $statusMail = true; |
|
| 693 | } |
|
| 694 | } |
|
| 695 | } |
|
| 696 | ||
| 697 | $viewModel = $this->buildView($this->game); |
|
| 698 | ||
| @@ 528-537 (lines=10) @@ | ||
| 525 | // buildView must be before sendMail because it adds the game template path to the templateStack |
|
| 526 | $viewModel = $this->buildView($this->game); |
|
| 527 | ||
| 528 | if ($this->getRequest()->isPost()) { |
|
| 529 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 530 | $form->setData($data); |
|
| 531 | if ($form->isValid()) { |
|
| 532 | $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry); |
|
| 533 | if ($result) { |
|
| 534 | $statusMail = true; |
|
| 535 | } |
|
| 536 | } |
|
| 537 | } |
|
| 538 | ||
| 539 | $viewModel->setVariables(array( |
|
| 540 | 'statusMail' => $statusMail, |
|