| @@ 89-96 (lines=8) @@ | ||
| 86 | $game = $this->getGameMapper()->update($game); |
|
| 87 | } |
|
| 88 | ||
| 89 | if (isset($data['deleteScratchcardImage']) && |
|
| 90 | $data['deleteScratchcardImage'] && |
|
| 91 | empty($data['uploadScratchcardImage']['tmp_name']) |
|
| 92 | ) { |
|
| 93 | ErrorHandler::start(); |
|
| 94 | $image = $game->getScratchcardImage(); |
|
| 95 | $image = str_replace($media_url, '', $image); |
|
| 96 | unlink($path .$image); |
|
| 97 | $game->setScratchcardImage(null); |
|
| 98 | ErrorHandler::stop(true); |
|
| 99 | } |
|
| @@ 128-137 (lines=10) @@ | ||
| 125 | ErrorHandler::stop(true); |
|
| 126 | } |
|
| 127 | ||
| 128 | if (isset($data['delete_image']) && empty($data['upload_image']['tmp_name'])) { |
|
| 129 | ErrorHandler::start(); |
|
| 130 | $image = $question->getImage(); |
|
| 131 | $image = str_replace($media_url, '', $image); |
|
| 132 | if (file_exists($path .$image)) { |
|
| 133 | unlink($path .$image); |
|
| 134 | } |
|
| 135 | $question->setImage(null); |
|
| 136 | ErrorHandler::stop(true); |
|
| 137 | } |
|
| 138 | ||
| 139 | $i = 0; |
|
| 140 | foreach ($question->getAnswers() as $answer) { |
|
| @@ 189-196 (lines=8) @@ | ||
| 186 | ErrorHandler::stop(true); |
|
| 187 | } |
|
| 188 | ||
| 189 | if (isset($data['deleteMainImage']) && |
|
| 190 | $data['deleteMainImage'] && |
|
| 191 | empty($data['uploadMainImage']['tmp_name']) |
|
| 192 | ) { |
|
| 193 | ErrorHandler::start(); |
|
| 194 | $image = $game->getMainImage(); |
|
| 195 | $image = str_replace($media_url, '', $image); |
|
| 196 | unlink($path . $image); |
|
| 197 | $game->setMainImage(null); |
|
| 198 | ErrorHandler::stop(true); |
|
| 199 | } |
|
| @@ 212-219 (lines=8) @@ | ||
| 209 | ErrorHandler::stop(true); |
|
| 210 | } |
|
| 211 | ||
| 212 | if (isset($data['deleteSecondImage']) && |
|
| 213 | $data['deleteSecondImage'] && |
|
| 214 | empty($data['uploadSecondImage']['tmp_name']) |
|
| 215 | ) { |
|
| 216 | ErrorHandler::start(); |
|
| 217 | $image = $game->getSecondImage(); |
|
| 218 | $image = str_replace($media_url, '', $image); |
|
| 219 | unlink($path . $image); |
|
| 220 | $game->setSecondImage(null); |
|
| 221 | ErrorHandler::stop(true); |
|
| 222 | } |
|
| @@ 242-249 (lines=8) @@ | ||
| 239 | ErrorHandler::stop(true); |
|
| 240 | } |
|
| 241 | ||
| 242 | if (isset($data['deleteFbShareImage']) && |
|
| 243 | $data['deleteFbShareImage'] && |
|
| 244 | empty($data['uploadFbShareImage']['tmp_name']) |
|
| 245 | ) { |
|
| 246 | ErrorHandler::start(); |
|
| 247 | $image = $game->getFbShareImage(); |
|
| 248 | $image = str_replace($media_url, '', $image); |
|
| 249 | unlink($path . $image); |
|
| 250 | $game->setFbShareImage(null); |
|
| 251 | ErrorHandler::stop(true); |
|
| 252 | } |
|
| @@ 271-278 (lines=8) @@ | ||
| 268 | ErrorHandler::stop(true); |
|
| 269 | } |
|
| 270 | ||
| 271 | if (isset($data['deleteFbPageTabImage']) && |
|
| 272 | $data['deleteFbPageTabImage'] && |
|
| 273 | empty($data['uploadFbPageTabImage']['tmp_name']) |
|
| 274 | ) { |
|
| 275 | ErrorHandler::start(); |
|
| 276 | $image = $game->getFbPageTabImage(); |
|
| 277 | $image = str_replace($media_url, '', $image); |
|
| 278 | unlink($path . $image); |
|
| 279 | $game->setFbPageTabImage(null); |
|
| 280 | ErrorHandler::stop(true); |
|
| 281 | } |
|