| @@ 289-295 (lines=7) @@ | ||
| 286 | }, $requires); |
|
| 287 | $message = trans('%depend_name%を先に有効化してください。', ['%name%' => $Plugin->getName(), '%depend_name%' => implode(', ', $names)]); |
|
| 288 | ||
| 289 | if ($request->isXmlHttpRequest()) { |
|
| 290 | return $this->json(['success' => false, 'message' => $message], 400); |
|
| 291 | } else { |
|
| 292 | $this->addError($message, 'admin'); |
|
| 293 | ||
| 294 | return $this->redirectToRoute('admin_store_plugin'); |
|
| 295 | } |
|
| 296 | } |
|
| 297 | } |
|
| 298 | ||
| @@ 266-271 (lines=6) @@ | ||
| 263 | $log = null; |
|
| 264 | ||
| 265 | if ($Plugin->isEnabled()) { |
|
| 266 | if ($request->isXmlHttpRequest()) { |
|
| 267 | return $this->json(['success' => true]); |
|
| 268 | } else { |
|
| 269 | $this->addError(trans('admin.store.plugin.already.enabled', ['%plugin_name%' => $Plugin->getName()]), 'admin'); |
|
| 270 | return $this->redirectToRoute('admin_store_plugin'); |
|
| 271 | } |
|
| 272 | } else { |
|
| 273 | // ストアからインストールしたプラグインは依存プラグインが有効化されているかを確認 |
|
| 274 | if ($Plugin->getSource()) { |
|
| @@ 351-357 (lines=7) @@ | ||
| 348 | } |
|
| 349 | $message = trans('admin.plugin.disable.depend', ['%name%' => $Plugin->getName(), '%depend_name%' => $dependName]); |
|
| 350 | ||
| 351 | if ($request->isXmlHttpRequest()) { |
|
| 352 | return $this->json(['message' => $message], 400); |
|
| 353 | } else { |
|
| 354 | $this->addError($message, 'admin'); |
|
| 355 | ||
| 356 | return $this->redirectToRoute('admin_store_plugin'); |
|
| 357 | } |
|
| 358 | } |
|
| 359 | ||
| 360 | try { |
|
| @@ 367-375 (lines=9) @@ | ||
| 364 | $log = ob_get_clean(); |
|
| 365 | ob_end_flush(); |
|
| 366 | } |
|
| 367 | } else { |
|
| 368 | if ($request->isXmlHttpRequest()) { |
|
| 369 | return $this->json(['success' => true, 'log' => $log]); |
|
| 370 | } else { |
|
| 371 | $this->addError(trans('admin.store.plugin.already.disabled', ['%plugin_name%' => $Plugin->getName()]), 'admin'); |
|
| 372 | ||
| 373 | return $this->redirectToRoute('admin_store_plugin'); |
|
| 374 | } |
|
| 375 | } |
|
| 376 | ||
| 377 | if ($request->isXmlHttpRequest()) { |
|
| 378 | return $this->json(['success' => true, 'log' => $log]); |
|
| @@ 377-383 (lines=7) @@ | ||
| 374 | } |
|
| 375 | } |
|
| 376 | ||
| 377 | if ($request->isXmlHttpRequest()) { |
|
| 378 | return $this->json(['success' => true, 'log' => $log]); |
|
| 379 | } else { |
|
| 380 | $this->addSuccess(trans('admin.store.plugin.disable.complete', ['%plugin_name%' => $Plugin->getName()]), 'admin'); |
|
| 381 | ||
| 382 | return $this->redirectToRoute('admin_store_plugin'); |
|
| 383 | } |
|
| 384 | } |
|
| 385 | ||
| 386 | /** |
|