| @@ 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) { |
|
| @@ 220-227 (lines=8) @@ | ||
| 217 | ErrorHandler::stop(true); |
|
| 218 | } |
|
| 219 | ||
| 220 | if (isset($data['deleteMainImage']) && |
|
| 221 | $data['deleteMainImage'] && |
|
| 222 | empty($data['uploadMainImage']['tmp_name']) |
|
| 223 | ) { |
|
| 224 | ErrorHandler::start(); |
|
| 225 | $image = $game->getMainImage(); |
|
| 226 | $image = str_replace($media_url, '', $image); |
|
| 227 | unlink($path . $image); |
|
| 228 | $game->setMainImage(null); |
|
| 229 | ErrorHandler::stop(true); |
|
| 230 | } |
|
| @@ 243-250 (lines=8) @@ | ||
| 240 | ErrorHandler::stop(true); |
|
| 241 | } |
|
| 242 | ||
| 243 | if (isset($data['deleteSecondImage']) && |
|
| 244 | $data['deleteSecondImage'] && |
|
| 245 | empty($data['uploadSecondImage']['tmp_name']) |
|
| 246 | ) { |
|
| 247 | ErrorHandler::start(); |
|
| 248 | $image = $game->getSecondImage(); |
|
| 249 | $image = str_replace($media_url, '', $image); |
|
| 250 | unlink($path . $image); |
|
| 251 | $game->setSecondImage(null); |
|
| 252 | ErrorHandler::stop(true); |
|
| 253 | } |
|
| @@ 273-280 (lines=8) @@ | ||
| 270 | ErrorHandler::stop(true); |
|
| 271 | } |
|
| 272 | ||
| 273 | if (isset($data['deleteFbShareImage']) && |
|
| 274 | $data['deleteFbShareImage'] && |
|
| 275 | empty($data['uploadFbShareImage']['tmp_name']) |
|
| 276 | ) { |
|
| 277 | ErrorHandler::start(); |
|
| 278 | $image = $game->getFbShareImage(); |
|
| 279 | $image = str_replace($media_url, '', $image); |
|
| 280 | unlink($path . $image); |
|
| 281 | $game->setFbShareImage(null); |
|
| 282 | ErrorHandler::stop(true); |
|
| 283 | } |
|
| @@ 302-309 (lines=8) @@ | ||
| 299 | ErrorHandler::stop(true); |
|
| 300 | } |
|
| 301 | ||
| 302 | if (isset($data['deleteFbPageTabImage']) && |
|
| 303 | $data['deleteFbPageTabImage'] && |
|
| 304 | empty($data['uploadFbPageTabImage']['tmp_name']) |
|
| 305 | ) { |
|
| 306 | ErrorHandler::start(); |
|
| 307 | $image = $game->getFbPageTabImage(); |
|
| 308 | $image = str_replace($media_url, '', $image); |
|
| 309 | unlink($path . $image); |
|
| 310 | $game->setFbPageTabImage(null); |
|
| 311 | ErrorHandler::stop(true); |
|
| 312 | } |
|
| @@ 88-95 (lines=8) @@ | ||
| 85 | $game = $this->getGameMapper()->update($game); |
|
| 86 | } |
|
| 87 | ||
| 88 | if (isset($data['deleteScratchcardImage']) && |
|
| 89 | $data['deleteScratchcardImage'] && |
|
| 90 | empty($data['uploadScratchcardImage']['tmp_name']) |
|
| 91 | ) { |
|
| 92 | ErrorHandler::start(); |
|
| 93 | $image = $game->getScratchcardImage(); |
|
| 94 | $image = str_replace($media_url, '', $image); |
|
| 95 | unlink($path .$image); |
|
| 96 | $game->setScratchcardImage(null); |
|
| 97 | ErrorHandler::stop(true); |
|
| 98 | } |
|