| @@ 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 | ||
| @@ 636-645 (lines=10) @@ | ||
| 633 | // buildView must be before sendMail because it adds the game template path to the templateStack |
|
| 634 | $viewModel = $this->buildView($this->game); |
|
| 635 | ||
| 636 | if ($this->getRequest()->isPost()) { |
|
| 637 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 638 | $form->setData($data); |
|
| 639 | if ($form->isValid()) { |
|
| 640 | $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry); |
|
| 641 | if ($result) { |
|
| 642 | $statusMail = true; |
|
| 643 | } |
|
| 644 | } |
|
| 645 | } |
|
| 646 | ||
| 647 | $viewModel->setVariables(array( |
|
| 648 | 'statusMail' => $statusMail, |
|