| @@ 124-135 (lines=12) @@ | ||
| 121 | $data = $form->getData(); |
|
| 122 | $post = $this->getGameService()->createPost($data, $this->game, $this->user, $form); |
|
| 123 | ||
| 124 | if ($post && !empty($this->game->nextStep('play'))) { |
|
| 125 | // determine the route where the user should go |
|
| 126 | $redirectUrl = $this->frontendUrl()->fromRoute( |
|
| 127 | 'postvote/'.$this->game->nextStep('play'), |
|
| 128 | array('id' => $this->game->getIdentifier()) |
|
| 129 | ); |
|
| 130 | ||
| 131 | return $this->redirect()->toUrl($redirectUrl); |
|
| 132 | } |
|
| 133 | } else { |
|
| 134 | $messages = $form->getMessages(); |
|
| 135 | $viewModel = $this->buildView($this->game); |
|
| 136 | $viewModel->setVariables(array( |
|
| 137 | 'success' => false, |
|
| 138 | 'message' => implode(',', $messages['title']), |
|
| @@ 198-209 (lines=12) @@ | ||
| 195 | // With core shortener helper |
|
| 196 | $socialLinkUrl = $this->shortenUrl()->shortenUrl($socialLinkUrl); |
|
| 197 | ||
| 198 | if (!$this->user && !$this->game->getAnonymousAllowed()) { |
|
| 199 | $redirect = urlencode( |
|
| 200 | $this->frontendUrl()->fromRoute( |
|
| 201 | 'mission/result', |
|
| 202 | array('id' => $this->game->getIdentifier()) |
|
| 203 | ) |
|
| 204 | ); |
|
| 205 | ||
| 206 | return $this->redirect()->toUrl( |
|
| 207 | $this->frontendUrl()->fromRoute('zfcuser/register').'?redirect='.$redirect |
|
| 208 | ); |
|
| 209 | } |
|
| 210 | ||
| 211 | $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form'); |
|
| 212 | $form->setAttribute('method', 'post'); |
|