| @@ 945-954 (lines=10) @@ | ||
| 942 | $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form'); |
|
| 943 | $form->setAttribute('method', 'post'); |
|
| 944 | ||
| 945 | if ($this->getRequest()->isPost()) { |
|
| 946 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 947 | $form->setData($data); |
|
| 948 | if ($form->isValid()) { |
|
| 949 | $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry); |
|
| 950 | if ($result) { |
|
| 951 | $statusMail = true; |
|
| 952 | } |
|
| 953 | } |
|
| 954 | } |
|
| 955 | ||
| 956 | $viewModel = $this->buildView($this->game); |
|
| 957 | ||
| @@ 614-623 (lines=10) @@ | ||
| 611 | // buildView must be before sendMail because it adds the game template path to the templateStack |
|
| 612 | $viewModel = $this->buildView($this->game); |
|
| 613 | ||
| 614 | if ($this->getRequest()->isPost()) { |
|
| 615 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 616 | $form->setData($data); |
|
| 617 | if ($form->isValid()) { |
|
| 618 | $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry); |
|
| 619 | if ($result) { |
|
| 620 | $statusMail = true; |
|
| 621 | } |
|
| 622 | } |
|
| 623 | } |
|
| 624 | ||
| 625 | $viewModel->setVariables(array( |
|
| 626 | 'statusMail' => $statusMail, |
|