| @@ 288-294 (lines=7) @@ | ||
| 285 | }, $requires); |
|
| 286 | $message = trans('%depend_name%を先に有効化してください。', ['%name%' => $Plugin->getName(), '%depend_name%' => implode(', ', $names)]); |
|
| 287 | ||
| 288 | if ($request->isXmlHttpRequest()) { |
|
| 289 | return $this->json(['success' => false, 'message' => $message], 400); |
|
| 290 | } else { |
|
| 291 | $this->addError($message, 'admin'); |
|
| 292 | ||
| 293 | return $this->redirectToRoute('admin_store_plugin'); |
|
| 294 | } |
|
| 295 | } |
|
| 296 | } |
|
| 297 | ||
| @@ 311-317 (lines=7) @@ | ||
| 308 | ||
| 309 | $cacheUtil->clearCache(); |
|
| 310 | ||
| 311 | if ($request->isXmlHttpRequest()) { |
|
| 312 | return $this->json(['success' => true, 'log' => $log]); |
|
| 313 | } else { |
|
| 314 | $this->addSuccess(trans('「%plugin_name%」を有効にしました。', ['%plugin_name%' => $Plugin->getName()]), 'admin'); |
|
| 315 | ||
| 316 | return $this->redirectToRoute('admin_store_plugin'); |
|
| 317 | } |
|
| 318 | } |
|
| 319 | ||
| 320 | /** |
|
| @@ 346-352 (lines=7) @@ | ||
| 343 | } |
|
| 344 | $message = trans('admin.plugin.disable.depend', ['%name%' => $Plugin->getName(), '%depend_name%' => $dependName]); |
|
| 345 | ||
| 346 | if ($request->isXmlHttpRequest()) { |
|
| 347 | return $this->json(['message' => $message], 400); |
|
| 348 | } else { |
|
| 349 | $this->addError($message, 'admin'); |
|
| 350 | ||
| 351 | return $this->redirectToRoute('admin_store_plugin'); |
|
| 352 | } |
|
| 353 | } |
|
| 354 | ||
| 355 | ob_start(); |
|
| @@ 359-367 (lines=9) @@ | ||
| 356 | $this->pluginService->disable($Plugin); |
|
| 357 | $log = ob_get_clean(); |
|
| 358 | ob_end_flush(); |
|
| 359 | } else { |
|
| 360 | if ($request->isXmlHttpRequest()) { |
|
| 361 | return $this->json(['success' => true, 'log' => $log]); |
|
| 362 | } else { |
|
| 363 | $this->addError('admin.plugin.already.disable', 'admin'); |
|
| 364 | ||
| 365 | return $this->redirectToRoute('admin_store_plugin'); |
|
| 366 | } |
|
| 367 | } |
|
| 368 | ||
| 369 | $cacheUtil->clearCache(); |
|
| 370 | ||
| @@ 371-377 (lines=7) @@ | ||
| 368 | ||
| 369 | $cacheUtil->clearCache(); |
|
| 370 | ||
| 371 | if ($request->isXmlHttpRequest()) { |
|
| 372 | return $this->json(['success' => true, 'log' => $log]); |
|
| 373 | } else { |
|
| 374 | $this->addSuccess('admin.plugin.disable.complete', 'admin'); |
|
| 375 | ||
| 376 | return $this->redirectToRoute('admin_store_plugin'); |
|
| 377 | } |
|
| 378 | } |
|
| 379 | ||
| 380 | /** |
|