| @@ 393-400 (lines=8) @@ | ||
| 390 | ErrorHandler::stop(true); |
|
| 391 | } |
|
| 392 | ||
| 393 | if (isset($data['deleteMainImage']) && |
|
| 394 | $data['deleteMainImage'] && |
|
| 395 | empty($data['uploadMainImage']['tmp_name']) |
|
| 396 | ) { |
|
| 397 | ErrorHandler::start(); |
|
| 398 | $image = $game->getMainImage(); |
|
| 399 | $image = str_replace($media_url, '', $image); |
|
| 400 | unlink($path . $image); |
|
| 401 | $game->setMainImage(null); |
|
| 402 | ErrorHandler::stop(true); |
|
| 403 | } |
|
| @@ 416-423 (lines=8) @@ | ||
| 413 | ErrorHandler::stop(true); |
|
| 414 | } |
|
| 415 | ||
| 416 | if (isset($data['deleteSecondImage']) && |
|
| 417 | $data['deleteSecondImage'] && |
|
| 418 | empty($data['uploadSecondImage']['tmp_name']) |
|
| 419 | ) { |
|
| 420 | ErrorHandler::start(); |
|
| 421 | $image = $game->getSecondImage(); |
|
| 422 | $image = str_replace($media_url, '', $image); |
|
| 423 | unlink($path . $image); |
|
| 424 | $game->setSecondImage(null); |
|
| 425 | ErrorHandler::stop(true); |
|
| 426 | } |
|
| @@ 446-453 (lines=8) @@ | ||
| 443 | ErrorHandler::stop(true); |
|
| 444 | } |
|
| 445 | ||
| 446 | if (isset($data['deleteFbShareImage']) && |
|
| 447 | $data['deleteFbShareImage'] && |
|
| 448 | empty($data['uploadFbShareImage']['tmp_name']) |
|
| 449 | ) { |
|
| 450 | ErrorHandler::start(); |
|
| 451 | $image = $game->getFbShareImage(); |
|
| 452 | $image = str_replace($media_url, '', $image); |
|
| 453 | unlink($path . $image); |
|
| 454 | $game->setFbShareImage(null); |
|
| 455 | ErrorHandler::stop(true); |
|
| 456 | } |
|
| @@ 476-483 (lines=8) @@ | ||
| 473 | ErrorHandler::stop(true); |
|
| 474 | } |
|
| 475 | ||
| 476 | if (isset($data['deleteFbPageTabImage']) && |
|
| 477 | $data['deleteFbPageTabImage'] && |
|
| 478 | empty($data['uploadFbPageTabImage']['tmp_name']) |
|
| 479 | ) { |
|
| 480 | ErrorHandler::start(); |
|
| 481 | $image = $game->getFbPageTabImage(); |
|
| 482 | $image = str_replace($media_url, '', $image); |
|
| 483 | unlink($path . $image); |
|
| 484 | $game->setFbPageTabImage(null); |
|
| 485 | ErrorHandler::stop(true); |
|
| 486 | } |
|
| @@ 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) { |
|