| @@ 635-644 (lines=10) @@ | ||
| 632 | // buildView must be before sendMail because it adds the game template path to the templateStack |
|
| 633 | $viewModel = $this->buildView($this->game); |
|
| 634 | ||
| 635 | if ($this->getRequest()->isPost()) { |
|
| 636 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 637 | $form->setData($data); |
|
| 638 | if ($form->isValid()) { |
|
| 639 | $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry); |
|
| 640 | if ($result) { |
|
| 641 | $statusMail = true; |
|
| 642 | } |
|
| 643 | } |
|
| 644 | } |
|
| 645 | ||
| 646 | $viewModel->setVariables(array( |
|
| 647 | 'statusMail' => $statusMail, |
|
| @@ 947-956 (lines=10) @@ | ||
| 944 | $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form'); |
|
| 945 | $form->setAttribute('method', 'post'); |
|
| 946 | ||
| 947 | if ($this->getRequest()->isPost()) { |
|
| 948 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 949 | $form->setData($data); |
|
| 950 | if ($form->isValid()) { |
|
| 951 | $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry); |
|
| 952 | if ($result) { |
|
| 953 | $statusMail = true; |
|
| 954 | } |
|
| 955 | } |
|
| 956 | } |
|
| 957 | ||
| 958 | $viewModel = $this->buildView($this->game); |
|
| 959 | ||