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