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