| @@ 91-101 (lines=11) @@ | ||
| 88 | $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form'); |
|
| 89 | $form->setAttribute('method', 'post'); |
|
| 90 | ||
| 91 | if ($this->getRequest()->isPost()) { |
|
| 92 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 93 | $form->setData($data); |
|
| 94 | if ($form->isValid()) { |
|
| 95 | $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry); |
|
| 96 | if ($result) { |
|
| 97 | $statusMail = true; |
|
| 98 | $this->getGameService()->addAnotherChance($this->game, $this->user, 1); |
|
| 99 | } |
|
| 100 | } |
|
| 101 | } |
|
| 102 | ||
| 103 | // buildView must be before sendMail because it adds the game template path to the templateStack |
|
| 104 | $viewModel = $this->buildView($this->game); |
|
| @@ 114-124 (lines=11) @@ | ||
| 111 | $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form'); |
|
| 112 | $form->setAttribute('method', 'post'); |
|
| 113 | ||
| 114 | if ($this->getRequest()->isPost()) { |
|
| 115 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 116 | $form->setData($data); |
|
| 117 | if ($form->isValid()) { |
|
| 118 | $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry); |
|
| 119 | if ($result) { |
|
| 120 | $statusMail = true; |
|
| 121 | $this->getGameService()->addAnotherChance($this->game, $this->user, 1); |
|
| 122 | } |
|
| 123 | } |
|
| 124 | } |
|
| 125 | ||
| 126 | // buildView must be before sendMail because it adds the game template path to the templateStack |
|
| 127 | $viewModel = $this->buildView($this->game); |
|