| @@ 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) { |
|
| @@ 219-229 (lines=11) @@ | ||
| 216 | ErrorHandler::stop(true); |
|
| 217 | } |
|
| 218 | ||
| 219 | if (isset($data['deleteMainImage']) && |
|
| 220 | $data['deleteMainImage'] && |
|
| 221 | empty($data['uploadMainImage']['tmp_name']) |
|
| 222 | ) { |
|
| 223 | ErrorHandler::start(); |
|
| 224 | $image = $game->getMainImage(); |
|
| 225 | $image = str_replace($media_url, '', $image); |
|
| 226 | unlink($path . $image); |
|
| 227 | $game->setMainImage(null); |
|
| 228 | ErrorHandler::stop(true); |
|
| 229 | } |
|
| 230 | ||
| 231 | if (! empty($data['uploadSecondImage']['tmp_name'])) { |
|
| 232 | ErrorHandler::start(); |
|
| @@ 242-252 (lines=11) @@ | ||
| 239 | ErrorHandler::stop(true); |
|
| 240 | } |
|
| 241 | ||
| 242 | if (isset($data['deleteSecondImage']) && |
|
| 243 | $data['deleteSecondImage'] && |
|
| 244 | empty($data['uploadSecondImage']['tmp_name']) |
|
| 245 | ) { |
|
| 246 | ErrorHandler::start(); |
|
| 247 | $image = $game->getSecondImage(); |
|
| 248 | $image = str_replace($media_url, '', $image); |
|
| 249 | unlink($path . $image); |
|
| 250 | $game->setSecondImage(null); |
|
| 251 | ErrorHandler::stop(true); |
|
| 252 | } |
|
| 253 | ||
| 254 | if (! empty($data['uploadStylesheet']['tmp_name'])) { |
|
| 255 | ErrorHandler::start(); |
|
| @@ 272-282 (lines=11) @@ | ||
| 269 | ErrorHandler::stop(true); |
|
| 270 | } |
|
| 271 | ||
| 272 | if (isset($data['deleteFbShareImage']) && |
|
| 273 | $data['deleteFbShareImage'] && |
|
| 274 | empty($data['uploadFbShareImage']['tmp_name']) |
|
| 275 | ) { |
|
| 276 | ErrorHandler::start(); |
|
| 277 | $image = $game->getFbShareImage(); |
|
| 278 | $image = str_replace($media_url, '', $image); |
|
| 279 | unlink($path . $image); |
|
| 280 | $game->setFbShareImage(null); |
|
| 281 | ErrorHandler::stop(true); |
|
| 282 | } |
|
| 283 | ||
| 284 | if (! empty($data['uploadFbPageTabImage']['tmp_name'])) { |
|
| 285 | ErrorHandler::start(); |
|
| @@ 301-311 (lines=11) @@ | ||
| 298 | ErrorHandler::stop(true); |
|
| 299 | } |
|
| 300 | ||
| 301 | if (isset($data['deleteFbPageTabImage']) && |
|
| 302 | $data['deleteFbPageTabImage'] && |
|
| 303 | empty($data['uploadFbPageTabImage']['tmp_name']) |
|
| 304 | ) { |
|
| 305 | ErrorHandler::start(); |
|
| 306 | $image = $game->getFbPageTabImage(); |
|
| 307 | $image = str_replace($media_url, '', $image); |
|
| 308 | unlink($path . $image); |
|
| 309 | $game->setFbPageTabImage(null); |
|
| 310 | ErrorHandler::stop(true); |
|
| 311 | } |
|
| 312 | ||
| 313 | $game = $this->getGameMapper()->update($game); |
|
| 314 | ||
| @@ 48-58 (lines=11) @@ | ||
| 45 | $game = $this->getGameMapper()->update($game); |
|
| 46 | } |
|
| 47 | ||
| 48 | if (isset($data['deleteScratchcardImage']) && |
|
| 49 | $data['deleteScratchcardImage'] && |
|
| 50 | empty($data['uploadScratchcardImage']['tmp_name']) |
|
| 51 | ) { |
|
| 52 | ErrorHandler::start(); |
|
| 53 | $image = $game->getScratchcardImage(); |
|
| 54 | $image = str_replace($media_url, '', $image); |
|
| 55 | unlink($path .$image); |
|
| 56 | $game->setScratchcardImage(null); |
|
| 57 | ErrorHandler::stop(true); |
|
| 58 | } |
|
| 59 | ||
| 60 | if ($game->getOccurrenceNumber() && $game->getScheduleOccurrenceAuto()) { |
|
| 61 | $this->scheduleOccurrences($game, $data); |
|