diff --git a/app/Controllers/Cloudflare/AccountController.php b/app/Controllers/Cloudflare/AccountController.php index 49c5f76..1c4d7d4 100644 --- a/app/Controllers/Cloudflare/AccountController.php +++ b/app/Controllers/Cloudflare/AccountController.php @@ -28,10 +28,27 @@ class AccountController extends CloudflareController } return $this->_myLibrary; } + //Field별 Form Input용 + protected function getFormFieldInput(string $field, string $value, array $inputs = []): array + { + switch ($field) { + case 'type': + $inputs[$field] = form_dropdown( + $field, + $this->getFormFieldInputOption($field), + $value + ); + break; + default: + $inputs[$field] = parent::getFormFieldInput($field, $value, $inputs); + break; + } + return $inputs; + } protected function create_init(): void { $this->fields = [$this->getMyLibrary()->getMyStorage()::TITLE, 'authkey', 'status']; - $this->filter_fields = ['status']; + $this->filter_fields = ['type', 'status']; $this->action = DB_ACTION['CREATE']; $this->getMyLibrary()->getMyStorage()->setAction($this->action); } diff --git a/app/Controllers/MVController.php b/app/Controllers/MVController.php index c5ed381..ca79565 100644 --- a/app/Controllers/MVController.php +++ b/app/Controllers/MVController.php @@ -24,7 +24,7 @@ abstract class MVController extends CommonController default: $options = [ "" => lang($this->class_name . '.label.' . $field) . ' 선택', - ...lang($this->class_name . '.' . strtoupper($field)), + lang($this->class_name . '.' . strtoupper($field)), ]; break; } @@ -57,7 +57,7 @@ abstract class MVController extends CommonController if (is_array($field)) { throw new \Exception(__FUNCTION__ . "에서 field array 입니다.\n" . var_export($field, true)); } - $inputs = $this->getFormFieldInput($field, old($field) ?? DEFAULTS['EMPTY'], $inputs); + $inputs = $this->getFormFieldInput($field, old($field) ?: DEFAULTS['EMPTY'], $inputs); } return $inputs; } @@ -283,6 +283,8 @@ abstract class MVController extends CommonController public function list_process(): string { try { + //입력폼처리 + $this->forminputs = $this->getFormFieldInputs(); //URL처리 $this->uri = $this->request->getUri(); //total 처리 diff --git a/app/Views/cloudflare/account/index.php b/app/Views/cloudflare/account/index.php index a0690b9..435033d 100644 --- a/app/Views/cloudflare/account/index.php +++ b/app/Views/cloudflare/account/index.php @@ -4,7 +4,8 @@
"get")) ?> include('templates/admin/index_head') ?> @@ -16,7 +17,7 @@ # - @ + @ @@ -43,10 +44,10 @@ - - + +