| @@ 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) { |
|
| @@ 192-199 (lines=8) @@ | ||
| 189 | ErrorHandler::stop(true); |
|
| 190 | } |
|
| 191 | ||
| 192 | if (isset($data['deleteMainImage']) && |
|
| 193 | $data['deleteMainImage'] && |
|
| 194 | empty($data['uploadMainImage']['tmp_name']) |
|
| 195 | ) { |
|
| 196 | ErrorHandler::start(); |
|
| 197 | $image = $game->getMainImage(); |
|
| 198 | $image = str_replace($media_url, '', $image); |
|
| 199 | unlink($path . $image); |
|
| 200 | $game->setMainImage(null); |
|
| 201 | ErrorHandler::stop(true); |
|
| 202 | } |
|
| @@ 215-222 (lines=8) @@ | ||
| 212 | ErrorHandler::stop(true); |
|
| 213 | } |
|
| 214 | ||
| 215 | if (isset($data['deleteSecondImage']) && |
|
| 216 | $data['deleteSecondImage'] && |
|
| 217 | empty($data['uploadSecondImage']['tmp_name']) |
|
| 218 | ) { |
|
| 219 | ErrorHandler::start(); |
|
| 220 | $image = $game->getSecondImage(); |
|
| 221 | $image = str_replace($media_url, '', $image); |
|
| 222 | unlink($path . $image); |
|
| 223 | $game->setSecondImage(null); |
|
| 224 | ErrorHandler::stop(true); |
|
| 225 | } |
|
| @@ 245-252 (lines=8) @@ | ||
| 242 | ErrorHandler::stop(true); |
|
| 243 | } |
|
| 244 | ||
| 245 | if (isset($data['deleteFbShareImage']) && |
|
| 246 | $data['deleteFbShareImage'] && |
|
| 247 | empty($data['uploadFbShareImage']['tmp_name']) |
|
| 248 | ) { |
|
| 249 | ErrorHandler::start(); |
|
| 250 | $image = $game->getFbShareImage(); |
|
| 251 | $image = str_replace($media_url, '', $image); |
|
| 252 | unlink($path . $image); |
|
| 253 | $game->setFbShareImage(null); |
|
| 254 | ErrorHandler::stop(true); |
|
| 255 | } |
|
| @@ 274-281 (lines=8) @@ | ||
| 271 | ErrorHandler::stop(true); |
|
| 272 | } |
|
| 273 | ||
| 274 | if (isset($data['deleteFbPageTabImage']) && |
|
| 275 | $data['deleteFbPageTabImage'] && |
|
| 276 | empty($data['uploadFbPageTabImage']['tmp_name']) |
|
| 277 | ) { |
|
| 278 | ErrorHandler::start(); |
|
| 279 | $image = $game->getFbPageTabImage(); |
|
| 280 | $image = str_replace($media_url, '', $image); |
|
| 281 | unlink($path . $image); |
|
| 282 | $game->setFbPageTabImage(null); |
|
| 283 | ErrorHandler::stop(true); |
|
| 284 | } |
|