From 41b6ccc339088148a9a0596dfe7f051d78123018 Mon Sep 17 00:00:00 2001 From: taekyoungc Date: Thu, 25 Jun 2026 23:16:57 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EA=B8=B0=EB=B3=B8=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EB=93=B1=EB=A1=9D/=EC=88=98=EC=A0=95=20=ED=99=94=EB=A9=B4=20?= =?UTF-8?q?=ED=83=AD=20=EC=95=88=20=EC=A4=91=EC=B2=A9=20=EC=85=B8=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CodeKind/CodeDetail create·edit 가 view('admin/layout') 직접 사용 → 탭(iframe) 안에서 풀셸 중첩 - renderWorkPage 로 교체 + renderWorkPage 가 embed 요청이면 경로 무관하게 embed 레이아웃 사용하도록 일반화 Co-Authored-By: Claude Opus 4.8 --- app/Controllers/Admin/CodeDetail.php | 22 ++++++++-------------- app/Controllers/Admin/CodeKind.php | 10 ++-------- app/Controllers/BaseController.php | 12 ++++++++++-- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/app/Controllers/Admin/CodeDetail.php b/app/Controllers/Admin/CodeDetail.php index d0ec40a..74f903c 100644 --- a/app/Controllers/Admin/CodeDetail.php +++ b/app/Controllers/Admin/CodeDetail.php @@ -56,14 +56,11 @@ class CodeDetail extends BaseController helper('admin'); - return view('admin/layout', [ - 'title' => '세부코드 등록 — ' . $kind->ck_name, - 'content' => view('admin/code_detail/create', [ - 'kind' => $kind, - 'canPlatformScope' => $canPlatformScope, - 'localGovernments' => $govs, - 'effectiveLgIdx' => admin_effective_lg_idx(), - ]), + return $this->renderWorkPage('세부코드 등록 — ' . $kind->ck_name, 'admin/code_detail/create', [ + 'kind' => $kind, + 'canPlatformScope' => $canPlatformScope, + 'localGovernments' => $govs, + 'effectiveLgIdx' => admin_effective_lg_idx(), ]); } @@ -156,12 +153,9 @@ class CodeDetail extends BaseController $kind = $this->kindModel->find($item->cd_ck_idx); - return view('admin/layout', [ - 'title' => '세부코드 수정 — ' . ($kind->ck_name ?? ''), - 'content' => view('admin/code_detail/edit', [ - 'item' => $item, - 'kind' => $kind, - ]), + return $this->renderWorkPage('세부코드 수정 — ' . ($kind->ck_name ?? ''), 'admin/code_detail/edit', [ + 'item' => $item, + 'kind' => $kind, ]); } diff --git a/app/Controllers/Admin/CodeKind.php b/app/Controllers/Admin/CodeKind.php index d3577a2..58d9011 100644 --- a/app/Controllers/Admin/CodeKind.php +++ b/app/Controllers/Admin/CodeKind.php @@ -34,10 +34,7 @@ class CodeKind extends BaseController return $r; } - return view('admin/layout', [ - 'title' => '기본코드 종류 등록', - 'content' => view('admin/code_kind/create'), - ]); + return $this->renderWorkPage('기본코드 종류 등록', 'admin/code_kind/create'); } public function store() @@ -76,10 +73,7 @@ class CodeKind extends BaseController return redirect()->to(site_url('bag/code-kinds'))->with('error', '코드 종류를 찾을 수 없습니다.'); } - return view('admin/layout', [ - 'title' => '기본코드 종류 수정', - 'content' => view('admin/code_kind/edit', ['item' => $item]), - ]); + return $this->renderWorkPage('기본코드 종류 수정', 'admin/code_kind/edit', ['item' => $item]); } public function update(int $id) diff --git a/app/Controllers/BaseController.php b/app/Controllers/BaseController.php index 6c752bc..5b98975 100644 --- a/app/Controllers/BaseController.php +++ b/app/Controllers/BaseController.php @@ -74,9 +74,17 @@ abstract class BaseController extends Controller while (str_starts_with($path, 'index.php/')) { $path = substr($path, strlen('index.php/')); } + // 워크스페이스 탭(iframe) 안이면 경로와 무관하게 임베드 레이아웃 → 셸 중첩 방지 + // (예: bag/code-kinds 탭에서 admin/code-kinds/create 등록 화면을 열 때) + if ($this->isEmbeddedRequest()) { + return view('bag/layout/embed', [ + 'title' => $title, + 'content' => $content, + ]); + } + if ($path === 'bag' || str_starts_with($path, 'bag/')) { - // /workspace 탭(iframe) 안에서는 임베드 레이아웃, 아니면 gov-portal 셸 - return view($this->isEmbeddedRequest() ? 'bag/layout/embed' : 'bag/layout/portal', [ + return view('bag/layout/portal', [ 'title' => $title, 'content' => $content, ]);