diff --git a/app/Config/Constants.php b/app/Config/Constants.php index e746a14..7600ef7 100644 --- a/app/Config/Constants.php +++ b/app/Config/Constants.php @@ -105,7 +105,7 @@ define('DEFAULTS', [ define('FORMS', [ 'MODAL' => 'modal_form', 'IFRAME' => 'iframe_form', - 'ACTION' => 'action_form', + 'DIRECT' => 'direct_form', ]); //URL define('URLS', [ diff --git a/app/Controllers/Admin/AdminController.php b/app/Controllers/Admin/AdminController.php index d760af9..7b63115 100644 --- a/app/Controllers/Admin/AdminController.php +++ b/app/Controllers/Admin/AdminController.php @@ -18,5 +18,6 @@ abstract class AdminController extends MVController $this->root = "Admin/"; $this->layout = "admin"; $this->session = $this->session_AuthTrait(); + $this->action_form = FORMS['MODAL']; } } diff --git a/app/Controllers/Admin/Cloudflare/AccountController.php b/app/Controllers/Admin/Cloudflare/AccountController.php index 3f767b2..2d07541 100644 --- a/app/Controllers/Admin/Cloudflare/AccountController.php +++ b/app/Controllers/Admin/Cloudflare/AccountController.php @@ -22,7 +22,6 @@ class AccountController extends CloudflareController $this->class_name = "Account"; $this->class_path = $this->root . $this->class_name; $this->title = lang("{$this->class_path}.title"); - $this->action_form = getenv("mvc.default." . strtolower($this->class_name) . ".form") ?: "modal_form"; helper($this->class_path); } final protected function getModel(): AccountModel diff --git a/app/Controllers/Admin/Cloudflare/AuthController.php b/app/Controllers/Admin/Cloudflare/AuthController.php index 1cccd12..4c2ef34 100644 --- a/app/Controllers/Admin/Cloudflare/AuthController.php +++ b/app/Controllers/Admin/Cloudflare/AuthController.php @@ -19,7 +19,6 @@ class AuthController extends CloudflareController $this->class_name = "Auth"; $this->class_path = $this->root . $this->class_name; $this->title = lang("{$this->class_path}.title"); - $this->action_form = getenv("mvc.default." . strtolower($this->class_name) . ".form") ?: "modal_form"; helper($this->class_path); } final protected function getModel(): AuthModel diff --git a/app/Controllers/Admin/Cloudflare/CloudflareController.php b/app/Controllers/Admin/Cloudflare/CloudflareController.php index 1935f35..ba654e7 100644 --- a/app/Controllers/Admin/Cloudflare/CloudflareController.php +++ b/app/Controllers/Admin/Cloudflare/CloudflareController.php @@ -10,7 +10,6 @@ use App\Models\Cloudflare\ZoneModel; use App\Models\Cloudflare\RecordModel; use App\Models\Cloudflare\AuthModel; use App\Models\Cloudflare\AccountModel; -use App\Entities\Cloudflare\AccountEntity; use App\Controllers\Admin\AdminController; abstract class CloudflareController extends AdminController diff --git a/app/Controllers/Admin/Cloudflare/RecordController.php b/app/Controllers/Admin/Cloudflare/RecordController.php index f6e1703..7bf5bff 100644 --- a/app/Controllers/Admin/Cloudflare/RecordController.php +++ b/app/Controllers/Admin/Cloudflare/RecordController.php @@ -19,7 +19,6 @@ class RecordController extends CloudflareController $this->class_name = "Record"; $this->class_path = $this->root . $this->class_name; $this->title = lang("{$this->class_path}.title"); - $this->action_form = getenv("mvc.default." . strtolower($this->class_name) . ".form") ?: "modal_form"; helper($this->class_path); } final protected function getModel(): RecordModel diff --git a/app/Controllers/Admin/Cloudflare/ZoneController.php b/app/Controllers/Admin/Cloudflare/ZoneController.php index 615d74f..3fe0e45 100644 --- a/app/Controllers/Admin/Cloudflare/ZoneController.php +++ b/app/Controllers/Admin/Cloudflare/ZoneController.php @@ -22,7 +22,6 @@ class ZoneController extends CloudflareController $this->class_name = "Zone"; $this->class_path = $this->root . $this->class_name; $this->title = lang("{$this->class_path}.title"); - $this->action_form = getenv("mvc.default." . strtolower($this->class_name) . ".form") ?: "modal_form"; helper($this->class_path); } final protected function getModel(): ZoneModel diff --git a/app/Controllers/Admin/MapurlController.php b/app/Controllers/Admin/MapurlController.php index 490ddb4..ff734b8 100644 --- a/app/Controllers/Admin/MapurlController.php +++ b/app/Controllers/Admin/MapurlController.php @@ -19,7 +19,6 @@ class MapurlController extends AdminController $this->class_name = "Mapurl"; $this->class_path = $this->root . $this->class_name; $this->title = lang("{$this->class_path}.title"); - $this->action_form = getenv("mvc.default." . strtolower($this->class_name) . ".form") ?: "modal_form"; helper($this->class_path); } protected function getModel(): MapurlModel diff --git a/app/Controllers/Admin/UserController.php b/app/Controllers/Admin/UserController.php index 0f4dd2c..a08a52f 100644 --- a/app/Controllers/Admin/UserController.php +++ b/app/Controllers/Admin/UserController.php @@ -20,7 +20,6 @@ class UserController extends AdminController $this->class_name = "User"; $this->class_path = $this->root . $this->class_name; $this->title = lang("{$this->class_path}.title"); - $this->action_form = getenv("mvc.default." . strtolower($this->class_name) . ".form") ?: "modal_form"; helper($this->class_path); } protected function getModel(): UserModel diff --git a/app/Helpers/Admin/Cloudflare/Account_helper.php b/app/Helpers/Admin/Cloudflare/Account_helper.php index 1f60982..3f1e7bb 100644 --- a/app/Helpers/Admin/Cloudflare/Account_helper.php +++ b/app/Helpers/Admin/Cloudflare/Account_helper.php @@ -1,6 +1,5 @@ $field ?: DEFAULTS['EMPTY']; + $value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY']; switch ($field) { case AccountModel::PARENT: - if ($extras['old_auth'] === $entity->getParent()) { + if ($viewDatas['old_auth'] === $viewDatas['entity']->getParent()) { $value = ""; } else { // dd($viewDatas['field_options']); $value = anchor( - base_url() . strtolower($viewDatas['root']) . "auth/reload/" . $entity->getParent(), + base_url() . strtolower($viewDatas['root']) . "auth/reload/" . $viewDatas['entity']->getParent(), ICONS["RELOAD"], [ "class" => "btn btn-sm btn-primary btn-circle", @@ -76,7 +75,7 @@ function getFieldView_AccountHelper(string $field, AccountEntity $entity, array break; case AccountModel::TITLE: $value = anchor( - current_url() . '/reload/' . $entity->getPK(), + current_url() . '/reload/' . $viewDatas['entity']->getPK(), ICONS["RELOAD"], [ "class" => "btn btn-sm btn-primary btn-circle", @@ -84,7 +83,7 @@ function getFieldView_AccountHelper(string $field, AccountEntity $entity, array ] ) . " " . anchor( - base_url() . strtolower($viewDatas['root']) . "zone?account_uid=" . $entity->getPK(), + base_url() . strtolower($viewDatas['root']) . "zone?account_uid=" . $viewDatas['entity']->getPK(), ICONS["FLAG"], [ "class" => "btn btn-sm btn-primary btn-circle", @@ -110,17 +109,17 @@ function getFieldView_AccountHelper(string $field, AccountEntity $entity, array // $extras["onChange"] = sprintf( // 'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value', // current_url(), - // $entity->getPK(), + // $viewDatas['entity']->getPK(), // $field, // $field // ); - // $value = getFieldForm_AccountHelper($field, $entity->$field, $viewDatas, $extras); + // $value = getFieldForm_AccountHelper($field, $viewDatas['entity']->$field, $viewDatas, $extras); // } break; } return $value; } // -function getListColumns_AccountHelper(string $field, array $viewDatas, array $extras = []): string +function getListLabel_AccountHelper(string $field, array $viewDatas, array $extras = []): string { $label = getFieldLabel_AccountHelper($field, $viewDatas, $extras); if ($field == $viewDatas['order_field']) { @@ -131,10 +130,66 @@ function getListColumns_AccountHelper(string $field, array $viewDatas, array $ex $viewDatas['uri']->addQuery('order_value', $order_value); $label = anchor((string)$viewDatas['uri'], $label); switch ($field) { - case AccountModel::PARENT: - break; case AccountModel::TITLE: break; } return sprintf("%s", implode(" ", $extras), $label); } +function getListButtonLabel_AccountHelper(string $action, string $label, array $viewDatas, array $extras = []): string +{ + switch ($viewDatas['action_form']) { + case FORMS['MODAL']: + $label = form_label( + $label, + "", + [ + "data-src" => $viewDatas['list_action_url'], + "data-bs-toggle" => "modal", + "data-bs-target" => "#index_action_form", + ...$extras + ] + ); + break; + case FORMS['IFRAME']: + if ($action == 'create') { + $label = form_label($label, "", [ + "onClick" => "changeIframe_src('{$viewDatas['list_action_url']}')", + ...$extras, + ]); + } else { + $label = ""; + } + break; + default: + $label = anchor($viewDatas['list_action_url'], $label, $extras); + break; + } + return $label; +} +function getListButton_AccountHelper(string $action, array $viewDatas, array $extras = []): string +{ + switch ($action) { + case 'create': + $viewDatas['list_action_url'] = $url = current_url() . '/' . $action; + $extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras]; + $action = getListButtonLabel_AccountHelper($action, '입력', $viewDatas, $extras); + break; + case 'modify': + // $checkbox = form_checkbox([ + // "id" => "checkbox_uid_{$viewDatas['entity']->getPK()}", + // "name" => "batchjob_uids[]", + // "value" => $viewDatas['entity']->getPK(), + // "class" => "batchjobuids_checkboxs" + // ]); + // $viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK(); + // $action = $checkbox . getListButtonLabel_AccountHelper($action, $viewDatas['cnt'], $viewDatas, $extras); + $action = $viewDatas['cnt']; + break; + case 'delete': + $viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK(); + $extras = ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras]; + $action = anchor($viewDatas['list_action_url'], ICONS['DELETE'], $extras); + break; + } + return $action; +} diff --git a/app/Helpers/Admin/Cloudflare/Auth_helper.php b/app/Helpers/Admin/Cloudflare/Auth_helper.php index 4f58b19..65359cf 100644 --- a/app/Helpers/Admin/Cloudflare/Auth_helper.php +++ b/app/Helpers/Admin/Cloudflare/Auth_helper.php @@ -1,6 +1,5 @@ $field ?: DEFAULTS['EMPTY']; + $value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY']; switch ($field) { case AuthModel::TITLE: $value = anchor( - current_url() . '/reload/' . $entity->getPK(), + current_url() . '/reload/' . $viewDatas['entity']->getPK(), ICONS["RELOAD"], [ "class" => "btn btn-sm btn-primary btn-circle", @@ -52,7 +51,7 @@ function getFieldView_AuthHelper(string $field, AuthEntity $entity, array $viewD ] ) . " " . anchor( - base_url() . strtolower($viewDatas['root']) . "account?auth_uid=" . $entity->getPK(), + base_url() . strtolower($viewDatas['root']) . "account?auth_uid=" . $viewDatas['entity']->getPK(), ICONS["FLAG"], [ "class" => "btn btn-sm btn-primary btn-circle", @@ -78,64 +77,17 @@ function getFieldView_AuthHelper(string $field, AuthEntity $entity, array $viewD $extras["onChange"] = sprintf( 'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value', current_url(), - $entity->getPK(), + $viewDatas['entity']->getPK(), $field, $field ); - $value = getFieldForm_AuthHelper($field, $entity->$field, $viewDatas, $extras); + $value = getFieldForm_AuthHelper($field, $viewDatas['entity']->$field, $viewDatas, $extras); } break; } return $value; } // -function getListAction_AuthHelper(string $action, $entity, array $viewDatas, array $extras = []): string -{ - switch ($action) { - case 'modify': - $cnt = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $extras['cnt']); - $checkbox = form_checkbox([ - "id" => "checkbox_uid_{$entity->getPK()}", - "name" => "batchjob_uids[]", - "value" => $entity->getPK(), - "class" => "batchjobuids_checkboxs" - ]); - $url = current_url() . '/' . $action . '/' . $entity->getPK(); - switch ($viewDatas['action_form']) { - case FORMS['MODAL']: - $value = form_label( - $cnt, - "", - [ - "data-src" => $url, - "data-bs-toggle" => "modal", - "data-bs-target" => "#index_action_form", - ...$extras - ] - ); - break; - case FORMS['IFRAME']: - $value = form_label($cnt, "", [ - "onClick" => "changeIframe_src('{$url}')", - ...$extras - ]); - break; - default: - $value = anchor($url, $cnt, $extras); - break; - } - $result = $checkbox . $value; - break; - case 'delete': - $result = anchor( - current_url() . '/delete/' . $entity->getPK(), - ICONS['DELETE'], - ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras] - ); - break; - } - return $result; -} -function getListColumns_AuthHelper(string $field, array $viewDatas, array $extras = []): string +function getListLabel_AuthHelper(string $field, array $viewDatas, array $extras = []): string { $label = getFieldLabel_AuthHelper($field, $viewDatas, $extras); if ($field == $viewDatas['order_field']) { @@ -151,3 +103,60 @@ function getListColumns_AuthHelper(string $field, array $viewDatas, array $extra } return sprintf("%s", implode(" ", $extras), $label); } +function getListButtonLabel_AuthHelper(string $action, string $label, array $viewDatas, array $extras = []): string +{ + switch ($viewDatas['action_form']) { + case FORMS['MODAL']: + $label = form_label( + $label, + "", + [ + "data-src" => $viewDatas['list_action_url'], + "data-bs-toggle" => "modal", + "data-bs-target" => "#index_action_form", + ...$extras + ] + ); + break; + case FORMS['IFRAME']: + if ($action == 'create') { + $label = form_label($label, "", [ + "onClick" => "changeIframe_src('{$viewDatas['list_action_url']}')", + ...$extras, + ]); + } else { + $label = ""; + } + break; + default: + $label = anchor($viewDatas['list_action_url'], $label, $extras); + break; + } + return $label; +} +function getListButton_AuthHelper(string $action, array $viewDatas, array $extras = []): string +{ + switch ($action) { + case 'create': + $viewDatas['list_action_url'] = $url = current_url() . '/' . $action; + $extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras]; + $action = getListButtonLabel_AuthHelper($action, '입력', $viewDatas, $extras); + break; + case 'modify': + $checkbox = form_checkbox([ + "id" => "checkbox_uid_{$viewDatas['entity']->getPK()}", + "name" => "batchjob_uids[]", + "value" => $viewDatas['entity']->getPK(), + "class" => "batchjobuids_checkboxs" + ]); + $viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK(); + $action = $checkbox . getListButtonLabel_AuthHelper($action, $viewDatas['cnt'], $viewDatas, $extras); + break; + case 'delete': + $viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK(); + $extras = ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras]; + $action = anchor($viewDatas['list_action_url'], ICONS['DELETE'], $extras); + break; + } + return $action; +} diff --git a/app/Helpers/Admin/Cloudflare/Record_helper.php b/app/Helpers/Admin/Cloudflare/Record_helper.php index a6f8745..48a589b 100644 --- a/app/Helpers/Admin/Cloudflare/Record_helper.php +++ b/app/Helpers/Admin/Cloudflare/Record_helper.php @@ -1,6 +1,5 @@ $field ?: DEFAULTS['EMPTY']; + $value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY']; switch ($field) { case RecordModel::PARENT: - if ($extras['old_zone'] === $entity->getParent()) { + if ($viewDatas['old_zone'] === $viewDatas['entity']->getParent()) { $value = ""; } else { $value = anchor( - base_url() . strtolower($viewDatas['root']) . 'zone/reload/' . $entity->getParent(), + base_url() . strtolower($viewDatas['root']) . 'zone/reload/' . $viewDatas['entity']->getParent(), ICONS["RELOAD"], [ "class" => "btn btn-sm btn-primary btn-circle", @@ -81,8 +80,8 @@ function getFieldView_RecordHelper(string $field, RecordEntity $entity, array $v } break; case RecordModel::TITLE: - $url = sprintf("%s/toggle/%s?fixed=%s", current_url(), $entity->getPK(), $entity->fixed == 'on' ? "off" : "on"); - $value = sprintf("%s%s", $entity->fixed == 'on' ? ICONS['LOCK'] : "", $value); + $url = sprintf("%s/toggle/%s?fixed=%s", current_url(), $viewDatas['entity']->getPK(), $viewDatas['entity']->fixed == 'on' ? "off" : "on"); + $value = sprintf("%s%s", $viewDatas['entity']->fixed == 'on' ? ICONS['LOCK'] : "", $value); $value = anchor($url, $value, ["target" => "_self"]); break; case 'category_uid': @@ -108,45 +107,18 @@ function getFieldView_RecordHelper(string $field, RecordEntity $entity, array $v $extras["onChange"] = sprintf( 'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value', current_url(), - $entity->getPK(), + $viewDatas['entity']->getPK(), $field, $field ); - $value = getFieldForm_RecordHelper($field, $entity->$field, $viewDatas, $extras); + $value = getFieldForm_RecordHelper($field, $viewDatas['entity']->$field, $viewDatas, $extras); } break; } return $value; } // -function getListAction_RecordHelper(string $action, $entity, array $viewDatas, array $extras = []): string -{ - switch ($action) { - case 'sync': - $cnt = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $extras['cnt']); - $checkbox = ""; - if ($entity->fixed == 'off' && $entity->type == 'A') { - $checkbox = form_checkbox([ - "id" => "checkbox_uid_{$entity->getPK()}", - "name" => "batchjob_uids[]", - "value" => $entity->getPK(), - "class" => "batchjobuids_checkboxs", - ]); - } - $url = current_url() . '/' . $action . '/' . $entity->getPK(); - $value = anchor($url, $cnt, $extras); - $result = $checkbox . $value; - break; - case 'delete': - $result = anchor( - current_url() . '/delete/' . $entity->getPK(), - ICONS['DELETE'], - ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras] - ); - break; - } - return $result; -} -function getListColumns_RecordHelper(string $field, array $viewDatas, array $extras = []): string + +function getListLabel_RecordHelper(string $field, array $viewDatas, array $extras = []): string { $label = getFieldLabel_RecordHelper($field, $viewDatas, $extras); if ($field == $viewDatas['order_field']) { @@ -166,3 +138,86 @@ function getListColumns_RecordHelper(string $field, array $viewDatas, array $ext } return sprintf("%s", implode(" ", $extras), $label); } +function getListButtonLabel_RecordHelper(string $action, string $label, array $viewDatas, array $extras = []): string +{ + switch ($action) { + case 'create': + switch ($viewDatas['action_form']) { + case FORMS['MODAL']: + $value = form_label( + $label, + "", + [ + "data-src" => $viewDatas['list_action_url'], + "data-bs-toggle" => "modal", + "data-bs-target" => "#index_action_form", + ...$extras + ] + ); + break; + case FORMS['IFRAME']: + $value = ""; + break; + default: + $value = anchor($viewDatas['list_action_url'], $label, $extras); + break; + } + break; + case 'modify': + switch ($viewDatas['action_form']) { + case FORMS['MODAL']: + $value = form_label( + $label, + "", + [ + "data-src" => $viewDatas['list_action_url'], + "data-bs-toggle" => "modal", + "data-bs-target" => "#index_action_form", + ...$extras + ] + ); + break; + case FORMS['IFRAME']: + $value = form_label($label, "", [ + "onClick" => "changeIframe_src('{$viewDatas['list_action_url']}')", + ...$extras + ]); + break; + default: + $value = anchor($viewDatas['list_action_url'], $label, $extras); + break; + } + break; + default: + break; + } + return $value; +} +function getListButton_RecordHelper(string $action, array $viewDatas, array $extras = []): string +{ + switch ($action) { + case 'create': + $viewDatas['list_action_url'] = $url = current_url() . '/' . $action; + $extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras]; + $action = getListButtonLabel_RecordHelper($action, '입력', $viewDatas, $extras); + break; + case 'sync': + $checkbox = ""; + if ($viewDatas['entity']->type == "A" && $viewDatas['entity']->fixed != 'on') + $checkbox = form_checkbox([ + "id" => "checkbox_uid_{$viewDatas['entity']->getPK()}", + "name" => "batchjob_uids[]", + "value" => $viewDatas['entity']->getPK(), + "class" => "batchjobuids_checkboxs" + ]); + $viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK(); + $action = $checkbox . anchor($viewDatas['list_action_url'], $viewDatas['cnt'], $extras); + break; + case 'delete': + $viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK(); + $extras = ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras]; + $action = anchor($viewDatas['list_action_url'], ICONS['DELETE'], $extras); + break; + } + return $action; +} diff --git a/app/Helpers/Admin/Cloudflare/Zone_helper.php b/app/Helpers/Admin/Cloudflare/Zone_helper.php index b63f73c..dfb3c0a 100644 --- a/app/Helpers/Admin/Cloudflare/Zone_helper.php +++ b/app/Helpers/Admin/Cloudflare/Zone_helper.php @@ -1,6 +1,5 @@ $field ?: DEFAULTS['EMPTY']; + $value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY']; switch ($field) { case ZoneModel::PARENT: - if ($extras['old_account'] === $entity->getParent()) { + if ($viewDatas['old_account'] === $viewDatas['entity']->getParent()) { $value = ""; } else { $value = anchor( - base_url() . strtolower($viewDatas['root']) . "account/reload/" . $entity->getParent(), + base_url() . strtolower($viewDatas['root']) . "account/reload/" . $viewDatas['entity']->getParent(), ICONS["RELOAD"], [ "class" => "btn btn-sm btn-primary btn-circle", @@ -93,7 +92,7 @@ function getFieldView_ZoneHelper(string $field, ZoneEntity $entity, array $viewD break; case ZoneModel::TITLE: $value = anchor( - current_url() . '/reload/' . $entity->getPK(), + current_url() . '/reload/' . $viewDatas['entity']->getPK(), ICONS["RELOAD"], [ "class" => "btn btn-sm btn-primary btn-circle", @@ -101,7 +100,7 @@ function getFieldView_ZoneHelper(string $field, ZoneEntity $entity, array $viewD ] ) . " " . anchor( - base_url() . strtolower($viewDatas['root']) . "record?zone_uid=" . $entity->getPK(), + base_url() . strtolower($viewDatas['root']) . "record?zone_uid=" . $viewDatas['entity']->getPK(), ICONS["FLAG"], [ "class" => "btn btn-sm btn-primary btn-circle", @@ -136,42 +135,17 @@ function getFieldView_ZoneHelper(string $field, ZoneEntity $entity, array $viewD $extras["onChange"] = sprintf( 'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value', current_url(), - $entity->getPK(), + $viewDatas['entity']->getPK(), $field, $field ); - $value = getFieldForm_ZoneHelper($field, $entity->$field, $viewDatas, $extras); + $value = getFieldForm_ZoneHelper($field, $viewDatas['entity']->$field, $viewDatas, $extras); } break; } return $value; } // -function getListAction_ZoneHelper(string $action, $entity, array $viewDatas, array $extras = []): string -{ - switch ($action) { - case 'sync': - $cnt = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $extras['cnt']); - $checkbox = form_checkbox([ - "id" => "checkbox_uid_{$entity->getPK()}", - "name" => "batchjob_uids[]", - "value" => $entity->getPK(), - "class" => "batchjobuids_checkboxs", - ]); - $url = current_url() . '/' . $action . '/' . $entity->getPK(); - $value = anchor($url, $cnt, $extras); - $result = $checkbox . $value; - break; - case 'delete': - $result = anchor( - current_url() . '/delete/' . $entity->getPK(), - ICONS['DELETE'], - ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras] - ); - break; - } - return $result; -} -function getListColumns_ZoneHelper(string $field, array $viewDatas, array $extras = []): string +function getListLabel_ZoneHelper(string $field, array $viewDatas, array $extras = []): string { $label = getFieldLabel_ZoneHelper($field, $viewDatas, $extras); if ($field == $viewDatas['order_field']) { @@ -190,3 +164,84 @@ function getListColumns_ZoneHelper(string $field, array $viewDatas, array $extra } return sprintf("%s", implode(" ", $extras), $label); } +function getListButtonLabel_ZoneHelper(string $action, string $label, array $viewDatas, array $extras = []): string +{ + switch ($action) { + case 'create': + switch ($viewDatas['action_form']) { + case FORMS['MODAL']: + $value = form_label( + $label, + "", + [ + "data-src" => $viewDatas['list_action_url'], + "data-bs-toggle" => "modal", + "data-bs-target" => "#index_action_form", + ...$extras + ] + ); + break; + case FORMS['IFRAME']: + $value = ""; + break; + default: + $value = anchor($viewDatas['list_action_url'], $label, $extras); + break; + } + break; + case 'modify': + switch ($viewDatas['action_form']) { + case FORMS['MODAL']: + $value = form_label( + $label, + "", + [ + "data-src" => $viewDatas['list_action_url'], + "data-bs-toggle" => "modal", + "data-bs-target" => "#index_action_form", + ...$extras + ] + ); + break; + case FORMS['IFRAME']: + $value = form_label($label, "", [ + "onClick" => "changeIframe_src('{$viewDatas['list_action_url']}')", + ...$extras + ]); + break; + default: + $value = anchor($viewDatas['list_action_url'], $label, $extras); + break; + } + break; + default: + break; + } + return $value; +} +function getListButton_ZoneHelper(string $action, array $viewDatas, array $extras = []): string +{ + switch ($action) { + case 'create': + $viewDatas['list_action_url'] = $url = current_url() . '/' . $action; + $extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras]; + $action = getListButtonLabel_ZoneHelper($action, '입력', $viewDatas, $extras); + break; + case 'sync': + $checkbox = form_checkbox([ + "id" => "checkbox_uid_{$viewDatas['entity']->getPK()}", + "name" => "batchjob_uids[]", + "value" => $viewDatas['entity']->getPK(), + "class" => "batchjobuids_checkboxs" + ]); + $viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK(); + $action = $checkbox . anchor($viewDatas['list_action_url'], $viewDatas['cnt'], $extras); + break; + case 'delete': + $viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK(); + $extras = ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras]; + $action = anchor($viewDatas['list_action_url'], ICONS['DELETE'], $extras); + break; + } + return $action; +} diff --git a/app/Helpers/Admin/Mapurl_helper.php b/app/Helpers/Admin/Mapurl_helper.php index 53dc882..a3916bf 100644 --- a/app/Helpers/Admin/Mapurl_helper.php +++ b/app/Helpers/Admin/Mapurl_helper.php @@ -1,6 +1,5 @@ $field ?: DEFAULTS['EMPTY']; + $value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY']; switch ($field) { case MapurlModel::TITLE: // $value = anchor( - // current_url() . '/view/' . $entity->getPK(), + // current_url() . '/view/' . $viewDatas['entity']->getPK(), // $value, // [ // "target" => "_self", @@ -72,64 +71,17 @@ function getFieldView_MapurlHelper(string $field, MapurlEntity $entity, array $v $extras["onChange"] = sprintf( 'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value', current_url(), - $entity->getPK(), + $viewDatas['entity']->getPK(), $field, $field ); - $value = getFieldForm_MapurlHelper($field, $entity->$field, $viewDatas, $extras); + $value = getFieldForm_MapurlHelper($field, $viewDatas['entity']->$field, $viewDatas, $extras); } break; } return $value; } // -function getListAction_MapurlHelper(string $action, $entity, array $viewDatas, array $extras = []): string -{ - switch ($action) { - case 'modify': - $cnt = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $extras['cnt']); - $checkbox = form_checkbox([ - "id" => "checkbox_uid_{$entity->getPK()}", - "name" => "batchjob_uids[]", - "value" => $entity->getPK(), - "class" => "batchjobuids_checkboxs" - ]); - $url = current_url() . '/' . $action . '/' . $entity->getPK(); - switch ($viewDatas['action_form']) { - case FORMS['MODAL']: - $value = form_label( - $cnt, - "", - [ - "data-src" => $url, - "data-bs-toggle" => "modal", - "data-bs-target" => "#index_action_form", - ...$extras - ] - ); - break; - case FORMS['IFRAME']: - $value = form_label($cnt, "", [ - "onClick" => "changeIframe_src('{$url}')", - ...$extras - ]); - break; - default: - $value = anchor($url, $cnt, $extras); - break; - } - $result = $checkbox . $value; - break; - case 'delete': - $result = anchor( - current_url() . '/delete/' . $entity->getPK(), - ICONS['DELETE'], - ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras] - ); - break; - } - return $result; -} -function getListColumns_MapurlHelper(string $field, array $viewDatas, array $extras = []): string +function getListLabel_MapurlHelper(string $field, array $viewDatas, array $extras = []): string { $label = getFieldLabel_MapurlHelper($field, $viewDatas, $extras); if ($field == $viewDatas['order_field']) { @@ -145,22 +97,78 @@ function getListColumns_MapurlHelper(string $field, array $viewDatas, array $ext } return sprintf("%s", implode(" ", $extras), $label); } - +function getListButtonLabel_MapurlHelper(string $action, string $label, array $viewDatas, array $extras = []): string +{ + switch ($viewDatas['action_form']) { + case FORMS['MODAL']: + $label = form_label( + $label, + "", + [ + "data-src" => $viewDatas['list_action_url'], + "data-bs-toggle" => "modal", + "data-bs-target" => "#index_action_form", + ...$extras + ] + ); + break; + case FORMS['IFRAME']: + if ($action == 'create') { + $label = form_label($label, "", [ + "onClick" => "changeIframe_src('{$viewDatas['list_action_url']}')", + ...$extras, + ]); + } else { + $label = ""; + } + break; + default: + $label = anchor($viewDatas['list_action_url'], $label, $extras); + break; + } + return $label; +} +function getListButton_MapurlHelper(string $action, array $viewDatas, array $extras = []): string +{ + switch ($action) { + case 'create': + $viewDatas['list_action_url'] = $url = current_url() . '/' . $action; + $extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras]; + $action = getListButtonLabel_MapurlHelper($action, '입력', $viewDatas, $extras); + break; + case 'modify': + $checkbox = form_checkbox([ + "id" => "checkbox_uid_{$viewDatas['entity']->getPK()}", + "name" => "batchjob_uids[]", + "value" => $viewDatas['entity']->getPK(), + "class" => "batchjobuids_checkboxs" + ]); + $viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK(); + $action = $checkbox . getListButtonLabel_MapurlHelper($action, $viewDatas['cnt'], $viewDatas, $extras); + break; + case 'delete': + $viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK(); + $extras = ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras]; + $action = anchor($viewDatas['list_action_url'], ICONS['DELETE'], $extras); + break; + } + return $action; +} function getRemapPage_MapurlHelper(array $viewDatas): string { $urls = []; - foreach ($viewDatas['entitys'] as $entity) { + foreach ($viewDatas['entitys'] as $viewDatas['entity']) { //한글을 포함하고 있는지 체크 HTTP 나 HTTPS 와 도메인 분리해서 한글도메인을 Punycode로 변환 - if (preg_match("/[\xE0-\xFF][\x80-\xFF][\x80-\xFF]/", $entity->oldurl)) { - preg_match("/^(https?:\/\/)(.*)/", $entity->oldurl, $matches); + if (preg_match("/[\xE0-\xFF][\x80-\xFF][\x80-\xFF]/", $viewDatas['entity']->oldurl)) { + preg_match("/^(https?:\/\/)(.*)/", $viewDatas['entity']->oldurl, $matches); $oldurl = $matches[1] . idn_to_ascii($matches[2]); } else { - $oldurl = trim($entity->oldurl); + $oldurl = trim($viewDatas['entity']->oldurl); } $urls[] = sprintf( "case '%s': window.location.href='%s'; break;", $oldurl, - trim($entity->newurl) + trim($viewDatas['entity']->newurl) ); } return sprintf(" diff --git a/app/Helpers/Admin/User_helper.php b/app/Helpers/Admin/User_helper.php index 1d82eb6..e295e60 100644 --- a/app/Helpers/Admin/User_helper.php +++ b/app/Helpers/Admin/User_helper.php @@ -1,6 +1,5 @@ $field ?: DEFAULTS['EMPTY']; + $value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY']; switch ($field) { case UserModel::TITLE: // $value = anchor( - // current_url() . '/view/' . $entity->getPK(), + // current_url() . '/view/' . $viewDatas['entity']->getPK(), // $value, // [ // "target" => "_self", @@ -91,64 +90,17 @@ function getFieldView_UserHelper(string $field, UserEntity $entity, array $viewD $extras["onChange"] = sprintf( 'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value', current_url(), - $entity->getPK(), + $viewDatas['entity']->getPK(), $field, $field ); - $value = getFieldForm_UserHelper($field, $entity->$field, $viewDatas, $extras); + $value = getFieldForm_UserHelper($field, $viewDatas['entity']->$field, $viewDatas, $extras); } break; } return $value; } // -function getListAction_UserHelper(string $action, $entity, array $viewDatas, array $extras = []): string -{ - switch ($action) { - case 'modify': - $cnt = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $extras['cnt']); - $checkbox = form_checkbox([ - "id" => "checkbox_uid_{$entity->getPK()}", - "name" => "batchjob_uids[]", - "value" => $entity->getPK(), - "class" => "batchjobuids_checkboxs" - ]); - $url = current_url() . '/' . $action . '/' . $entity->getPK(); - switch ($viewDatas['action_form']) { - case FORMS['MODAL']: - $value = form_label( - $cnt, - "", - [ - "data-src" => $url, - "data-bs-toggle" => "modal", - "data-bs-target" => "#index_action_form", - ...$extras - ] - ); - break; - case FORMS['IFRAME']: - $value = form_label($cnt, "", [ - "onClick" => "changeIframe_src('{$url}')", - ...$extras - ]); - break; - default: - $value = anchor($url, $cnt, $extras); - break; - } - $result = $checkbox . $value; - break; - case 'delete': - $result = anchor( - current_url() . '/delete/' . $entity->getPK(), - ICONS['DELETE'], - ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras] - ); - break; - } - return $result; -} -function getListColumns_UserHelper(string $field, array $viewDatas, array $extras = []): string +function getListLabel_UserHelper(string $field, array $viewDatas, array $extras = []): string { $label = getFieldLabel_UserHelper($field, $viewDatas, $extras); if ($field == $viewDatas['order_field']) { @@ -164,3 +116,60 @@ function getListColumns_UserHelper(string $field, array $viewDatas, array $extra } return sprintf("%s", implode(" ", $extras), $label); } +function getListButtonLabel_UserHelper(string $action, string $label, array $viewDatas, array $extras = []): string +{ + switch ($viewDatas['action_form']) { + case FORMS['MODAL']: + $label = form_label( + $label, + "", + [ + "data-src" => $viewDatas['list_action_url'], + "data-bs-toggle" => "modal", + "data-bs-target" => "#index_action_form", + ...$extras + ] + ); + break; + case FORMS['IFRAME']: + if ($action == 'create') { + $label = form_label($label, "", [ + "onClick" => "changeIframe_src('{$viewDatas['list_action_url']}')", + ...$extras, + ]); + } else { + $label = ""; + } + break; + default: + $label = anchor($viewDatas['list_action_url'], $label, $extras); + break; + } + return $label; +} +function getListButton_UserHelper(string $action, array $viewDatas, array $extras = []): string +{ + switch ($action) { + case 'create': + $viewDatas['list_action_url'] = $url = current_url() . '/' . $action; + $extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras]; + $action = getListButtonLabel_UserHelper($action, '입력', $viewDatas, $extras); + break; + case 'modify': + $checkbox = form_checkbox([ + "id" => "checkbox_uid_{$viewDatas['entity']->getPK()}", + "name" => "batchjob_uids[]", + "value" => $viewDatas['entity']->getPK(), + "class" => "batchjobuids_checkboxs" + ]); + $viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK(); + $action = $checkbox . getListButtonLabel_UserHelper($action, $viewDatas['cnt'], $viewDatas, $extras); + break; + case 'delete': + $viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK(); + $extras = ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras]; + $action = anchor($viewDatas['list_action_url'], ICONS['DELETE'], $extras); + break; + } + return $action; +} diff --git a/app/Libraries/MySocket/Cloudflare/AccountSocket.php b/app/Libraries/MySocket/Cloudflare/AccountSocket.php index 7bf8060..ab3665b 100644 --- a/app/Libraries/MySocket/Cloudflare/AccountSocket.php +++ b/app/Libraries/MySocket/Cloudflare/AccountSocket.php @@ -53,12 +53,11 @@ class AccountSocket extends CloudflareSocket log_message("notice", "-----{$this->_auth_entity->getTitle()} 처리 시작-----"); $entity_uids = []; $results = $this->reload_procedure("accounts"); + //DB수정 foreach ($results as $result) { - foreach ($result as $item) { - $formDatas = $this->getArrayByResult($item); - $entity = $this->getModel()->modify($this->getModel()->getEntity(), $formDatas); - $entity_uids[] = $entity->getPK(); - } + $formDatas = $this->getArrayByResult($result); + $entity = $this->getModel()->modify($this->getModel()->getEntity(), $formDatas); + $entity_uids[] = $entity->getPK(); } //부모키를 기준으로 CF에 존재하지 않는 데이터 삭제용 $this->getModel()->where(AccountModel::PARENT, $this->_auth_entity); diff --git a/app/Libraries/MySocket/Cloudflare/RecordSocket.php b/app/Libraries/MySocket/Cloudflare/RecordSocket.php index ac1a2b1..a66aae9 100644 --- a/app/Libraries/MySocket/Cloudflare/RecordSocket.php +++ b/app/Libraries/MySocket/Cloudflare/RecordSocket.php @@ -6,7 +6,6 @@ use App\Models\Cloudflare\RecordModel; use App\Libraries\MySocket\CloudflareSocket; use App\Entities\Cloudflare\ZoneEntity; use App\Entities\Cloudflare\RecordEntity; -use App\Entities\Cloudflare\AuthEntity; class RecordSocket extends CloudflareSocket { @@ -136,13 +135,10 @@ class RecordSocket extends CloudflareSocket $entity_uids = []; $results = $this->reload_procedure("zones/{$this->_zone_entity->getPK()}/dns_records"); //DB수정 - dd($results); foreach ($results as $result) { - foreach ($result as $item) { - $formDatas = $this->getArrayByResult($item); - $entity = $this->getModel()->modify($this->getModel()->getEntity(), $formDatas); - $entity_uids[] = $entity->getPK(); - } + $formDatas = $this->getArrayByResult($result); + $entity = $this->getModel()->modify($this->getModel()->getEntity(), $formDatas); + $entity_uids[] = $entity->getPK(); } //부모키를 기준으로 CF에 존재하지 않는 데이터 DB삭제 $this->getModel()->where(RecordModel::PARENT, $this->_zone_entity); diff --git a/app/Libraries/MySocket/Cloudflare/ZoneSocket.php b/app/Libraries/MySocket/Cloudflare/ZoneSocket.php index 5713baa..418239a 100644 --- a/app/Libraries/MySocket/Cloudflare/ZoneSocket.php +++ b/app/Libraries/MySocket/Cloudflare/ZoneSocket.php @@ -5,7 +5,6 @@ namespace App\Libraries\MySocket\Cloudflare; use App\Models\Cloudflare\ZoneModel; use App\Libraries\MySocket\CloudflareSocket; use App\Entities\Cloudflare\ZoneEntity; -use App\Entities\Cloudflare\AuthEntity; use App\Entities\Cloudflare\AccountEntity; class ZoneSocket extends CloudflareSocket @@ -167,12 +166,11 @@ class ZoneSocket extends CloudflareSocket log_message("notice", "-----{$this->_account_entity->getTitle()} 처리 시작-----"); $entity_uids = []; $results = $this->reload_procedure('zones'); + //DB수정 foreach ($results as $result) { - foreach ($result as $item) { - $formDatas = $this->getArrayByResult($item); - $entity = $this->getModel()->modify($this->getModel()->getEntity(), $formDatas); - $entity_uids[] = $entity->getPK(); - } + $formDatas = $this->getArrayByResult($result); + $entity = $this->getModel()->modify($this->getModel()->getEntity(), $formDatas); + $entity_uids[] = $entity->getPK(); } //부모키를 기준으로 CF에 존재하지 않는 데이터 삭제용 $this->getModel()->where(ZoneModel::PARENT, $this->_account_entity); diff --git a/app/Libraries/MySocket/CloudflareSocket.php b/app/Libraries/MySocket/CloudflareSocket.php index 4c91572..8af570f 100644 --- a/app/Libraries/MySocket/CloudflareSocket.php +++ b/app/Libraries/MySocket/CloudflareSocket.php @@ -83,9 +83,14 @@ abstract class CloudflareSocket extends CommonLibrary if (!$cf->success) { throw new \Exception(__FUNCTION__ . "에서 실패:\n" . var_export($cf, true)); } - $results[] = $cf->result; //Loop 제한 : 한페이지에서 가져온 갯수가 perpage_max보다 적다는것은 더이상 다음페이지기 없으므로 0로 종료시키기 위함 - $page = count($cf->result) < $perpage_max ? 0 : $page + 1; + if (count($cf->result) < $perpage_max) { + $results = $cf->result; + $page = 0; + } else { + $results = array_merge($results, $cf->result); + $page++; + } } while (0 < $page); return $results; } diff --git a/app/Views/admin/cloudflare/account/index.php b/app/Views/admin/cloudflare/account/index.php index d061290..4e38b93 100644 --- a/app/Views/admin/cloudflare/account/index.php +++ b/app/Views/admin/cloudflare/account/index.php @@ -3,31 +3,53 @@ include('templates/' . $viewDatas['layout'] . '/index_top'); ?> + - + + - + - status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>> + status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>> + + + - + + + getParent() ?> - getParent(); ?>
번호 작업
- getPK(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?> + "cursor:pointer"]) ?> $old_auth]) ?> + +
-
+
+ +
+ +
+ + include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?> + endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/cloudflare/auth/create.php b/app/Views/admin/cloudflare/auth/create.php index 0fe150e..10a25aa 100644 --- a/app/Views/admin/cloudflare/auth/create.php +++ b/app/Views/admin/cloudflare/auth/create.php @@ -1,4 +1,4 @@ -extend("layouts/empty") ?> +extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?> section('content') ?> diff --git a/app/Views/admin/cloudflare/auth/index.php b/app/Views/admin/cloudflare/auth/index.php index 359ef45..23fd24e 100644 --- a/app/Views/admin/cloudflare/auth/index.php +++ b/app/Views/admin/cloudflare/auth/index.php @@ -9,7 +9,7 @@ 번호 - + 작업 @@ -17,15 +17,17 @@ - status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>> + status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>> + + - $cnt, "style" => "cursor:pointer"]) ?> + "cursor:pointer"]) ?> - + - + @@ -39,10 +41,12 @@ - + -
-include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?> +
+ + include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?> + endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/cloudflare/auth/modify.php b/app/Views/admin/cloudflare/auth/modify.php index 189531a..1190381 100644 --- a/app/Views/admin/cloudflare/auth/modify.php +++ b/app/Views/admin/cloudflare/auth/modify.php @@ -1,4 +1,4 @@ -extend("layouts/empty") ?> +extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?> section('content') ?> diff --git a/app/Views/admin/cloudflare/record/create.php b/app/Views/admin/cloudflare/record/create.php index 67f1546..464defb 100644 --- a/app/Views/admin/cloudflare/record/create.php +++ b/app/Views/admin/cloudflare/record/create.php @@ -1,4 +1,4 @@ -extend("layouts/empty") ?> +extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?> section('content') ?> diff --git a/app/Views/admin/cloudflare/record/index.php b/app/Views/admin/cloudflare/record/index.php index 0b84e57..f11d4cb 100644 --- a/app/Views/admin/cloudflare/record/index.php +++ b/app/Views/admin/cloudflare/record/index.php @@ -9,28 +9,31 @@ 번호 - + 작업 - + - locked != 'on' ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>> + locked != 'on' ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>> + + + - $cnt, "style" => "cursor:pointer"]) ?> + "cursor:pointer"]) ?> - $old_zone]) ?> + - + + getParent() ?> - getParent(); ?> @@ -41,10 +44,12 @@ - + -
-include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?> +
+ + include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?> + endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/cloudflare/zone/create.php b/app/Views/admin/cloudflare/zone/create.php index 4ff05a1..bc3bcab 100644 --- a/app/Views/admin/cloudflare/zone/create.php +++ b/app/Views/admin/cloudflare/zone/create.php @@ -1,4 +1,4 @@ -extend("layouts/empty") ?> +extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?> section('content') ?> diff --git a/app/Views/admin/cloudflare/zone/index.php b/app/Views/admin/cloudflare/zone/index.php index e2596e0..243eeb2 100644 --- a/app/Views/admin/cloudflare/zone/index.php +++ b/app/Views/admin/cloudflare/zone/index.php @@ -9,28 +9,31 @@ 번호 - + 작업 - + - status != 'active' ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>> + status != 'active' ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>> + + + - $cnt, "style" => "cursor:pointer"]) ?> + "cursor:pointer"]) ?> - $old_account]) ?> + - + + getParent() ?> - getParent(); ?> @@ -41,10 +44,12 @@ - + -
-include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?> +
+ + include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?> + endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/mapurl/create.php b/app/Views/admin/mapurl/create.php index a53d048..3199283 100644 --- a/app/Views/admin/mapurl/create.php +++ b/app/Views/admin/mapurl/create.php @@ -1,4 +1,4 @@ -extend("layouts/empty") ?> +extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?> section('content') ?> diff --git a/app/Views/admin/mapurl/index.php b/app/Views/admin/mapurl/index.php index cf029ba..0765c8d 100644 --- a/app/Views/admin/mapurl/index.php +++ b/app/Views/admin/mapurl/index.php @@ -2,14 +2,14 @@ section('content') ?> - include('templates/' . $viewDatas['layout'] . '/index_top'); ?> + - + @@ -17,15 +17,17 @@ - status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>> + status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>> + + - + @@ -39,10 +41,12 @@ - + -
-include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?> +
+ + include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?> +endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/mapurl/modify.php b/app/Views/admin/mapurl/modify.php index 239196e..f40cd93 100644 --- a/app/Views/admin/mapurl/modify.php +++ b/app/Views/admin/mapurl/modify.php @@ -1,4 +1,4 @@ -extend("layouts/empty") ?> +extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?> section('content') ?> diff --git a/app/Views/admin/user/create.php b/app/Views/admin/user/create.php index 9f6cec5..4a55aef 100644 --- a/app/Views/admin/user/create.php +++ b/app/Views/admin/user/create.php @@ -1,4 +1,4 @@ -extend("layouts/empty") ?> +extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?> section('content') ?> diff --git a/app/Views/admin/user/index.php b/app/Views/admin/user/index.php index beb9192..6999fc1 100644 --- a/app/Views/admin/user/index.php +++ b/app/Views/admin/user/index.php @@ -9,7 +9,7 @@ - + @@ -18,14 +18,16 @@ status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>> + + - + @@ -39,10 +41,12 @@ - +
-include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?> + + include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?> +endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/user/modify.php b/app/Views/admin/user/modify.php index 9f260a8..19f1529 100644 --- a/app/Views/admin/user/modify.php +++ b/app/Views/admin/user/modify.php @@ -1,4 +1,4 @@ -extend("layouts/empty") ?> +extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?> section('content') ?> diff --git a/app/Views/layouts/admin/direct_form.php b/app/Views/layouts/admin/direct_form.php new file mode 100644 index 0000000..3b49891 --- /dev/null +++ b/app/Views/layouts/admin/direct_form.php @@ -0,0 +1,42 @@ + + + + + + + + <?= $viewDatas['title'] ?> + + + + + + + + + + + + + + +
+ include(LAYOUTS[$viewDatas['layout']]['path'] . '/top'); ?> +
+
+
include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?>
+
+
include('templates/admin/header'); ?>
+
renderSection('content') ?>
+ +
+
+
+ include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?> +
+ + + \ No newline at end of file diff --git a/app/Views/layouts/admin/iframe_form.php b/app/Views/layouts/admin/iframe_form.php new file mode 100644 index 0000000..2631393 --- /dev/null +++ b/app/Views/layouts/admin/iframe_form.php @@ -0,0 +1,29 @@ + + + + + + + + <?= $viewDatas['title'] ?> + + + + + + + + + + + + + + +
renderSection('content') ?>
+ + + \ No newline at end of file diff --git a/app/Views/layouts/admin/modal_form.php b/app/Views/layouts/admin/modal_form.php new file mode 100644 index 0000000..2631393 --- /dev/null +++ b/app/Views/layouts/admin/modal_form.php @@ -0,0 +1,29 @@ + + + + + + + + <?= $viewDatas['title'] ?> + + + + + + + + + + + + + + +
renderSection('content') ?>
+ + + \ No newline at end of file diff --git a/app/Views/templates/admin/modal_form.php b/app/Views/templates/admin/modal_form.php index aafee54..b7753f0 100644 --- a/app/Views/templates/admin/modal_form.php +++ b/app/Views/templates/admin/modal_form.php @@ -8,7 +8,9 @@
번호 작업
- $cnt, "style" => "cursor:pointer"]) ?> + "cursor:pointer"]) ?> - +
번호 작업
- $cnt, "style" => "cursor:pointer"]) ?> + "cursor:pointer"]) ?> - +