| @@ 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 | } |
|
| @@ 129-138 (lines=10) @@ | ||
| 126 | ErrorHandler::stop(true); |
|
| 127 | } |
|
| 128 | ||
| 129 | if (isset($data['delete_image']) && empty($data['upload_image']['tmp_name'])) { |
|
| 130 | ErrorHandler::start(); |
|
| 131 | $image = $question->getImage(); |
|
| 132 | $image = str_replace($media_url, '', $image); |
|
| 133 | if (file_exists($path .$image)) { |
|
| 134 | unlink($path .$image); |
|
| 135 | } |
|
| 136 | $question->setImage(null); |
|
| 137 | ErrorHandler::stop(true); |
|
| 138 | } |
|
| 139 | ||
| 140 | $i = 0; |
|
| 141 | foreach ($question->getAnswers() as $answer) { |
|
| @@ 215-222 (lines=8) @@ | ||
| 212 | ErrorHandler::stop(true); |
|
| 213 | } |
|
| 214 | ||
| 215 | if (isset($data['deleteMainImage']) && |
|
| 216 | $data['deleteMainImage'] && |
|
| 217 | empty($data['uploadMainImage']['tmp_name']) |
|
| 218 | ) { |
|
| 219 | ErrorHandler::start(); |
|
| 220 | $image = $game->getMainImage(); |
|
| 221 | $image = str_replace($media_url, '', $image); |
|
| 222 | unlink($path . $image); |
|
| 223 | $game->setMainImage(null); |
|
| 224 | ErrorHandler::stop(true); |
|
| 225 | } |
|
| @@ 238-245 (lines=8) @@ | ||
| 235 | ErrorHandler::stop(true); |
|
| 236 | } |
|
| 237 | ||
| 238 | if (isset($data['deleteSecondImage']) && |
|
| 239 | $data['deleteSecondImage'] && |
|
| 240 | empty($data['uploadSecondImage']['tmp_name']) |
|
| 241 | ) { |
|
| 242 | ErrorHandler::start(); |
|
| 243 | $image = $game->getSecondImage(); |
|
| 244 | $image = str_replace($media_url, '', $image); |
|
| 245 | unlink($path . $image); |
|
| 246 | $game->setSecondImage(null); |
|
| 247 | ErrorHandler::stop(true); |
|
| 248 | } |
|
| @@ 268-275 (lines=8) @@ | ||
| 265 | ErrorHandler::stop(true); |
|
| 266 | } |
|
| 267 | ||
| 268 | if (isset($data['deleteFbShareImage']) && |
|
| 269 | $data['deleteFbShareImage'] && |
|
| 270 | empty($data['uploadFbShareImage']['tmp_name']) |
|
| 271 | ) { |
|
| 272 | ErrorHandler::start(); |
|
| 273 | $image = $game->getFbShareImage(); |
|
| 274 | $image = str_replace($media_url, '', $image); |
|
| 275 | unlink($path . $image); |
|
| 276 | $game->setFbShareImage(null); |
|
| 277 | ErrorHandler::stop(true); |
|
| 278 | } |
|
| @@ 297-304 (lines=8) @@ | ||
| 294 | ErrorHandler::stop(true); |
|
| 295 | } |
|
| 296 | ||
| 297 | if (isset($data['deleteFbPageTabImage']) && |
|
| 298 | $data['deleteFbPageTabImage'] && |
|
| 299 | empty($data['uploadFbPageTabImage']['tmp_name']) |
|
| 300 | ) { |
|
| 301 | ErrorHandler::start(); |
|
| 302 | $image = $game->getFbPageTabImage(); |
|
| 303 | $image = str_replace($media_url, '', $image); |
|
| 304 | unlink($path . $image); |
|
| 305 | $game->setFbPageTabImage(null); |
|
| 306 | ErrorHandler::stop(true); |
|
| 307 | } |
|